Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Groot2 to Docker image #295

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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' && \
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
68 changes: 35 additions & 33 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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 [email protected]: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
Expand All @@ -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).
26 changes: 17 additions & 9 deletions docker/config/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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