From ff663cf15216d118601a2f28648bc5228728c690 Mon Sep 17 00:00:00 2001 From: Filip Parag Date: Mon, 18 Mar 2024 16:41:59 +0100 Subject: [PATCH 1/2] install groot to container --- docker/Dockerfile.base | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 6212bbce..9dbbaf17 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -43,9 +43,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y -o Dpkg::Option vim \ rsync \ dialog \ - fish - - + fish \ + fuse # VS Code RUN curl -L -o /tmp/vscode.deb \ @@ -60,8 +59,6 @@ RUN su memristor -c 'code --install-extension eamodio.gitlens' && \ su memristor -c 'code --install-extension redhat.vscode-xml' && \ su memristor -c 'code --install-extension ms-iot.vscode-ros' - - # VS Code server RUN su memristor -c 'curl -fsSL https://code-server.dev/install.sh | sh' && \ su memristor -c 'code-server --install-extension eamodio.gitlens' && \ @@ -78,6 +75,12 @@ RUN curl -L -o /tmp/webots.deb \ rm -f /tmp/webots.deb && \ mkdir -p /memristor/.config/Cyberbotics +# Groot +RUN curl -L -o /opt/Groot2.AppImge \ + 'https://s3.us-west-1.amazonaws.com/download.behaviortree.dev/groot2_linux_installer/Groot2-v1.5.2-x86_64.AppImage' && \ + chmod +x /opt/Groot2.AppImge && \ + ln -sf /opt/Groot2.AppImge /usr/bin/groot2 + RUN python3 -m pip install scipy transforms3d #HOTFIX: https://github.com/ros-controls/ros2_controllers/issues/482 From 00aa992e02b38e0668d73371ef7a6219ee40464e Mon Sep 17 00:00:00 2001 From: Filip Parag Date: Mon, 18 Mar 2024 16:54:42 +0100 Subject: [PATCH 2/2] fix interactive setup target --- docker/Makefile | 2 +- docker/README.md | 68 ++++++++++++++++++++++-------------------- docker/config/setup.sh | 26 ++++++++++------ 3 files changed, 53 insertions(+), 43 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 5fab0d56..6d38615a 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -8,7 +8,7 @@ IMAGE=ghcr.io/memristor/mep3 .PHONY: all -all: destroy test-nvidia run setup-default +all: destroy run setup-default colors: $(eval NC=\033[1;0m) diff --git a/docker/README.md b/docker/README.md index a1327d1a..3c36aa6d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,44 +2,46 @@ ## Local development environment -1) Install `git`, `make`, `curl`, and `docker` - ```sh - sudo apt install git make curl - curl -sSL https://get.docker.com | sh && sudo usermod -aG docker $USER - ``` - and reboot the PC. -2) Clone this repository - ```sh - # Make sure to have your SSH keys added to GitHub - git clone git@github.com:memristor/mep3.git - ``` - -3) Run provisioning script to pull the image and run the container: +1. Install `git`, `make`, `curl`, and `docker` + ```sh + sudo apt install git make curl + curl -sSL https://get.docker.com | sh && sudo usermod -aG docker $USER + ``` + and reboot the PC. +2. Clone this repository + + ```sh + # Make sure to have your SSH keys added to GitHub + git clone git@github.com:memristor/mep3.git + ``` + +3. Run provisioning script to pull the image and run the container: + ```sh cd ./mep3/docker - make run + make all ``` + > Time to time you can run `make destroy run` to get the newest packages. -4) Wait for the provisioning script to finish +4. Wait for the provisioning script to finish -5) _Optional:_ run container setup script - ```sh - make setup-default +5. _Optional:_ run interactive setup if you prefer to manually configure the container - # If you prefer to manually configure setup, you can just do make setup and go through the prompts - make setup-interactive - ``` -6) Acces the environment from any terminal window - ```sh - docker exec -it mep3-devel bash - ``` - Graphical applications started inside this terminal will use your existing Xorg session to display. + ```sh + make setup-interactive + ``` +6. Acces the environment from any terminal window + ```sh + docker exec -it mep3-devel bash + ``` + Graphical applications started inside this terminal will use your existing Xorg session to display. ## Code Server + If you prefer to use browser based VS Code, you can start it in the container and then access it locally through your browser at `localhost:31415` - + ```sh # This will start the VS code server with your mep3 repo make start-code-server @@ -50,20 +52,20 @@ make stop-code-server ## Remote development environment (VNC) - - -1) Follow steps in [Local development environment](#local-development-environment), but add `vnc` after +1. Follow steps in [Local development environment](#local-development-environment), but add `vnc` after `make` in steps 4 and 6 (eg. `make vnc setup`) -2) Enable VNC preferences in step 6 and wait for the container to restart -3) Web-based VNC client will be accessible at `http://localhost:6810/` if you keep default noVNC webserver port -4) In step 6 replace `mep3-devel` with `mep3-vnc` +2. Enable VNC preferences in step 6 and wait for the container to restart +3. Web-based VNC client will be accessible at `http://localhost:6810/` if you keep default noVNC webserver port +4. In step 6 replace `mep3-devel` with `mep3-vnc` **Note:** If you are setting up through SSH, make sure to have a running Xorg server on host machine, and set `DISPLAY` environment variable on step 4 to its value (eg `:0`). + ```sh export DISPLAY=:0 ``` ## NVIDIA GPU + If you happen to have NVIDIA GPUs that you wish to use within these development environments, make sure to have NVIDIA Container Toolkit installed on your system. More info, specific to your distribution [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). diff --git a/docker/config/setup.sh b/docker/config/setup.sh index ebc00655..9ee4f95d 100755 --- a/docker/config/setup.sh +++ b/docker/config/setup.sh @@ -172,20 +172,28 @@ while [ "$#" -gt 0 ]; do shift done -if $_configure_proxy; then +if $_interactive; then configure_proxy -fi -if $_first_time_ros_setup; then first_time_ros_setup -fi -if $_enhanced_shell_prompt; then enhanced_shell_prompt -fi -if $_shell_shortcuts; then shell_shortcuts -fi -if $_vnc; then vnc +else + if $_configure_proxy; then + configure_proxy + fi + if $_first_time_ros_setup; then + first_time_ros_setup + fi + if $_enhanced_shell_prompt; then + enhanced_shell_prompt + fi + if $_shell_shortcuts; then + shell_shortcuts + fi + if $_vnc; then + vnc + fi fi finalize