From d6acc28f725747b22f6eb5cfd4ef15cb3355c70d Mon Sep 17 00:00:00 2001 From: Michael Katsoulis Date: Fri, 9 Jan 2026 16:53:07 +0100 Subject: [PATCH] Working when secrets manually entered in container --- .gitignore | 3 ++- README.md | 37 +++++++++++++++++++++++++++++++++++-- exwayz_test.dockerfile | 29 ++++++++++++++++++++++------- notes.md | 1 + 4 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 notes.md diff --git a/.gitignore b/.gitignore index 7537556..0be0a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ licenses/** -pkgs/exwayz_3d_mapping* \ No newline at end of file +pkgs/exwayz_3d_mapping* +tmp/** \ No newline at end of file diff --git a/README.md b/README.md index 042b8a4..989fd64 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ -## Building with docker secrets -TODO: Figure out a safer way to include secrets in the docker file +# Build the docker image +'''bash +docker build -t exwayz_test:v1.0 -f exwayz_test.dockerfile . +''' +## TODO Building with docker secrets +We need to improve our handling of secrets and figure out a safer way to include them in the docker file/image + + + +# To run the docker file: +1. We need to enable the use of the display +2. Share the volume with our current code so we can access it in the container +3. start a shell + +'''bash +docker run -it \ + --env="DISPLAY=$DISPLAY" \ + --env="QT_X11_NO_MITSHM=1" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ + -v "$(pwd):/app" \ + exwayz_test +''' + + +Then, run the exways slam on a bag to test everything is workign correctly. +'''bash +exwayz_slam --bag data/exwayz_sample_data_slam_01.bag --bag-hesai /hesai/pandar_packets --hesai-model PandarXT-32 --d-write 0.1 -o ./slam_session_tutorial --no-date +''' +Naturally, change the path to the bagfile for the parameter '--bag' + +Hopefully, you will see something like this: +![Working Exwayz Demo¨¨](media/Exwayz_slam_demo_working.gif) + +# may have to: +source /opt/ros/$ROS_DISTRO/setup.bash \ No newline at end of file diff --git a/exwayz_test.dockerfile b/exwayz_test.dockerfile index e496db8..187b098 100644 --- a/exwayz_test.dockerfile +++ b/exwayz_test.dockerfile @@ -9,20 +9,35 @@ ARG TARGETARCH=amd64 COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-amd64.deb /tmp/exwayz_amd64.deb COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-aarch64.deb /tmp/exwayz_aarch64.deb +#If debug, install the following: +RUN apt update && apt install -y libgl1-mesa-dev libosmesa6-dev libglew-dev libgles2-mesa-dev libglfw3-dev libstdc++6 mesa-utils +#TODO we're installing unneccessary things like the humanity-icons package, clean this up later. + +# RUN --mount=type=secret,id=exwayz_license set -eux; \ +# if [ "${TARGETARCH}" = "aarch64" ]; then \ +# pkg=/tmp/exwayz_aarch64.deb; \ +# else \ +# pkg=/tmp/exwayz_amd64.deb; \ +# fi; \ +# apt-get update; \ +# apt-get install -fy "$pkg"; \ +# if [ -s /run/secrets/exwayz_license ]; then \ +# exwayz_license --query "$(cat /run/secrets/exwayz_license)" || true; \ +# fi; \ +# rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \ +# rm -rf /var/lib/apt/lists/* + RUN --mount=type=secret,id=exwayz_license set -eux; \ - if [ "${TARGETARCH}" = "aarch64" ]; then \ - pkg=/tmp/exwayz_aarch64.deb; \ - else \ - pkg=/tmp/exwayz_amd64.deb; \ - fi; \ apt-get update; \ - apt-get install -fy "$pkg"; \ + apt-get install -fy /tmp/exwayz_amd64.deb; \ if [ -s /run/secrets/exwayz_license ]; then \ exwayz_license --query "$(cat /run/secrets/exwayz_license)" || true; \ + else \ + echo "No license file provided"; \ + exit 1; \ fi; \ rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \ rm -rf /var/lib/apt/lists/* - # TODO verify license was applied successfully # Set entrypoint diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..a07157c --- /dev/null +++ b/notes.md @@ -0,0 +1 @@ +## fixing broken s \ No newline at end of file