Skip to content

Commit c6109d1

Browse files
committed
OmpSs docker script completely rewritten
1 parent b93d0f5 commit c6109d1

28 files changed

+70
-8223
lines changed
File renamed without changes.
File renamed without changes.

OmpSs/apps/dotproduct/compile.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
echo "Compiling the bitstream for the ZCU102 board..."
4+
#make bitstream-p BOARD=zcu102
5+
6+
echo "Compiling executable for the ZCU102 board..."
7+
export CROSS_COMPILE=aarch64-linux-gnu-
8+
make dotproduct-p dotproduct-d dotproduct-i
File renamed without changes.
File renamed without changes.

OmpSs/dotproduct/build/dotproduct-i

-27.7 KB
Binary file not shown.

OmpSs/dotproduct/build/dotproduct-p

-27.7 KB
Binary file not shown.

OmpSs/dotproduct/build/dotproduct.ait.log

-3,641
This file was deleted.

OmpSs/dotproduct/build/dotproduct.bin

-7.97 MB
Binary file not shown.

OmpSs/dotproduct/build/dotproduct.bit

-7.97 MB
Binary file not shown.

OmpSs/dotproduct/build/dotproduct.datainterfaces.txt

-6
This file was deleted.

OmpSs/dotproduct/build/dotproduct.resources-hls.txt

-4
This file was deleted.

OmpSs/dotproduct/build/dotproduct.resources-impl.txt

-4
This file was deleted.

OmpSs/dotproduct/build/dotproduct.timing-impl.txt

-4
This file was deleted.

OmpSs/dotproduct/build/dotproduct.xtasks.config

-2
This file was deleted.
-35.9 KB
Binary file not shown.
-30.8 KB
Binary file not shown.
-30.8 KB
Binary file not shown.

OmpSs/example_print/build/reverse_print.ait.log

-4,524
This file was deleted.
-8.65 MB
Binary file not shown.
-8.65 MB
Binary file not shown.

OmpSs/example_print/build/reverse_print.datainterfaces.txt

-7
This file was deleted.

OmpSs/example_print/build/reverse_print.resources-hls.txt

-4
This file was deleted.

OmpSs/example_print/build/reverse_print.resources-impl.txt

-4
This file was deleted.

OmpSs/example_print/build/reverse_print.timing-impl.txt

-4
This file was deleted.

OmpSs/example_print/build/reverse_print.xtasks.config

-3
This file was deleted.

OmpSs/run.sh

+62-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,62 @@
1-
chmod 666 dotproduct -R
2-
chmod 666 example_print -R
3-
docker run -it \
4-
-v $HOME:$HOME \
5-
-v /tmp/.X11-unix:/tmp/.X11-unix \
6-
-v /media/:/media/ \
7-
-v /media/tls/bb85d90f-e2ee-425a-98fb-5dc0f287682c/tools/Xilinx/:/opt/xilinx/ \
8-
-v /media/tls/bb85d90f-e2ee-425a-98fb-5dc0f287682c/tools/Xilinx/Xilinx.lic:/home/ompss/Xilinx.lic \
9-
-v $(pwd)/dotproduct:/home/ompss/host_apps/dotproduct \
10-
-v $(pwd)/example_print:/home/ompss/host_apps/example_print \
11-
-e DISPLAY=$DISPLAY \
12-
-e PATH="/opt/xilinx/Vivado/2024.1/bin/:/opt/xilinx/Vitis_HLS/2024.1/bin/:$PATH" \
13-
--network host \
14-
ompss_2_at_fpga:unknwn bash
15-
16-
# -v /opt/petalinux/:/opt/petalinux/ \
1+
#!/bin/bash
2+
3+
IMAGE="bscpm/ompss_2_at_fpga:latest"
4+
CONTAINER_NAME_PREFIX="ompss_2_at_fpga"
5+
CONTAINER_APPS_DEST="/home/ompss/apps"
6+
CONTAINER_USER="ompss"
7+
CONTAINER_GROUP="ompss"
8+
9+
HOST_APPS_SRC=$(pwd)/apps
10+
HOST_XILINX_TOOLS="/tools/Xilinx"
11+
HOST_XILINX_LIC="/tools/Xilinx/Xilinx.lic"
12+
HOST_PETALINUX="/tools/Xilinx/PetaLinux"
13+
14+
# Generate a unique container name with a timestamp
15+
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
16+
CONTAINER_NAME="${CONTAINER_NAME_PREFIX}_${TIMESTAMP}"
17+
18+
# Check if Docker is installed
19+
if ! command -v docker &> /dev/null; then
20+
echo "Docker is not installed. Please install Docker and try again."
21+
exit 1
22+
fi
23+
24+
# Start the Docker container as root
25+
echo "Starting Docker container as root with name: $CONTAINER_NAME..."
26+
docker run -itd \
27+
-v $HOST_XILINX_TOOLS:/opt/xilinx/ \
28+
-v $HOST_PETALINUX:/opt/petalinux/ \
29+
-v $HOST_XILINX_LIC:/home/ompss/.Xilinx/Xilinx.lic \
30+
-e DISPLAY=$DISPLAY \
31+
-e PATH="/opt/xilinx/Vivado/2024.2/bin/:/opt/xilinx/Vitis_HLS/2024.2/bin/:$PATH" \
32+
--network host \
33+
--name $CONTAINER_NAME \
34+
$IMAGE bash
35+
36+
# Check if the container is running
37+
if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
38+
echo "Failed to start the container."
39+
exit 1
40+
fi
41+
42+
# Copy each folder from the host to the container
43+
echo "Copying apps from host to container..."
44+
docker cp $HOST_APPS_SRC $CONTAINER_NAME:$CONTAINER_APPS_DEST
45+
46+
# Check if the copy was successful
47+
if [ $? -eq 0 ]; then
48+
echo "Folder $HOST_APPS_SRC successfully copied to the container."
49+
else
50+
echo "Failed to copy folder $HOST_APPS_SRC to the container."
51+
exit 1
52+
fi
53+
54+
# Adjust permissions inside the container as root
55+
echo "Adjusting permissions inside the container as root..."
56+
docker exec -u root $CONTAINER_NAME chown -R $CONTAINER_USER:$CONTAINER_GROUP $CONTAINER_APPS_DEST
57+
docker exec -u root $CONTAINER_NAME chown $CONTAINER_USER:$CONTAINER_GROUP /home/$CONTAINER_USER/.Xilinx
58+
59+
# Attach to the container interactively as the specified user
60+
echo "Attaching to the container interactively..."
61+
docker exec -it \
62+
-u $CONTAINER_USER $CONTAINER_NAME /bin/bash

0 commit comments

Comments
 (0)