From 9656cdff6635ea2742fba4311834866a358157c9 Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Wed, 10 Apr 2024 11:35:46 -0700 Subject: [PATCH] removing docker remote folder and just have the vscode method --- scripts/docker/remote/astrobee_ssh.Dockerfile | 23 -------- scripts/docker/remote/astrobee_vnc.Dockerfile | 35 ------------ scripts/docker/remote/build_ssh.sh | 5 -- scripts/docker/remote/build_vnc.sh | 5 -- scripts/docker/remote/exec_vnc.sh | 3 - scripts/docker/remote/readme_ssh.md | 32 ----------- scripts/docker/remote/readme_vnc.md | 55 ------------------- scripts/docker/remote/run_ssh.sh | 11 ---- scripts/docker/remote/run_vnc.sh | 4 -- 9 files changed, 173 deletions(-) delete mode 100644 scripts/docker/remote/astrobee_ssh.Dockerfile delete mode 100644 scripts/docker/remote/astrobee_vnc.Dockerfile delete mode 100755 scripts/docker/remote/build_ssh.sh delete mode 100755 scripts/docker/remote/build_vnc.sh delete mode 100755 scripts/docker/remote/exec_vnc.sh delete mode 100644 scripts/docker/remote/readme_ssh.md delete mode 100644 scripts/docker/remote/readme_vnc.md delete mode 100755 scripts/docker/remote/run_ssh.sh delete mode 100755 scripts/docker/remote/run_vnc.sh diff --git a/scripts/docker/remote/astrobee_ssh.Dockerfile b/scripts/docker/remote/astrobee_ssh.Dockerfile deleted file mode 100644 index 6daf6d189a..0000000000 --- a/scripts/docker/remote/astrobee_ssh.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# On top of the normal Astrobee image, this will set up a ssh server -# running inside the Docker container so you can run graphical -# applications and view them. - -ARG UBUNTU_VERSION=20.04 -ARG REMOTE=astrobee -ARG IMAGE=${REMOTE}/astrobee:latest-ubuntu${UBUNTU_VERSION} -FROM ${IMAGE} - -# Install dependencies -RUN apt-get update \ - && apt-get install -y \ - openssh-server \ - xauth \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir /var/run/sshd \ - && echo 'root:astrobee' | chpasswd \ - && sed -i 's/#X11UseLocalhost yes/X11UseLocalhost no/; s/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ - && echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config - -EXPOSE 22 -CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file diff --git a/scripts/docker/remote/astrobee_vnc.Dockerfile b/scripts/docker/remote/astrobee_vnc.Dockerfile deleted file mode 100644 index d80bf92514..0000000000 --- a/scripts/docker/remote/astrobee_vnc.Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# On top of the normal Astrobee image, this will set up a VNC server -# running inside the Docker container so you can run graphical -# applications and view them using a VNC client. - -ARG UBUNTU_VERSION=20.04 -ARG REMOTE=astrobee -ARG IMAGE=${REMOTE}/astrobee:latest-ubuntu${UBUNTU_VERSION} -FROM ${IMAGE} - -# Rationale for packages: -# xvfb: X server that doesn't need GPU or physical display -# x11vnc: VNC server that shares xvfb display with external VNC clients -# xfce4: lightweight window manager -# dbus-x11: inter-process communication needed by xfce -# x11-apps: X11 apps to demo such as xeyes -# x11-utils: debugging commands such as xdpyinfo -# x11-xserver-utils: setup commands such as xset - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - dbus-x11 \ - x11-apps \ - x11-utils \ - x11-xserver-utils \ - x11vnc \ - xfce4 \ - xvfb \ - && rm -rf /var/lib/apt/lists/* - -COPY ./scripts/start_vnc.sh /start_vnc.sh - -CMD ["/start_vnc.sh"] - -# Expose VNC server's port -EXPOSE 5900 diff --git a/scripts/docker/remote/build_ssh.sh b/scripts/docker/remote/build_ssh.sh deleted file mode 100755 index 6bc314c6f5..0000000000 --- a/scripts/docker/remote/build_ssh.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -e - -cd ${HOME}/ros_ws/astrobee/src -docker build . -f ./scripts/docker/remote/astrobee_ssh.Dockerfile --build-arg UBUNTU_VERSION=20.04 --build-arg REMOTE=ghcr.io/nasa -t astrobee/astrobee:latest-ssh-ubuntu20.04 diff --git a/scripts/docker/remote/build_vnc.sh b/scripts/docker/remote/build_vnc.sh deleted file mode 100755 index 4e15f928bf..0000000000 --- a/scripts/docker/remote/build_vnc.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -e - -cd ${HOME}/ros_ws/astrobee/src -docker build . -f ./scripts/docker/remote/astrobee_ssh.Dockerfile --build-arg UBUNTU_VERSION=20.04 --build-arg REMOTE=ghcr.io/nasa -t astrobee/astrobee:latest-vnc-ubuntu20.04 diff --git a/scripts/docker/remote/exec_vnc.sh b/scripts/docker/remote/exec_vnc.sh deleted file mode 100755 index b44d2c1404..0000000000 --- a/scripts/docker/remote/exec_vnc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd ${HOME}/ros_ws/astrobee/src -docker exec -it --env "DISPLAY=:0" astrobee-vnc bash diff --git a/scripts/docker/remote/readme_ssh.md b/scripts/docker/remote/readme_ssh.md deleted file mode 100644 index 3b4560c1a5..0000000000 --- a/scripts/docker/remote/readme_ssh.md +++ /dev/null @@ -1,32 +0,0 @@ -\page ssh-docker Remote using SSH - -# Astrobee Docker container with graphical applications shared via X11 # - -These setup instructions assume you want to run graphical applications inside a Docker container running on a remote host, and view the graphics on your local display. - -We assume the remote host is an Ubuntu host where: -- Docker has been installed and configured to be used by non-admin users. -- You already have the Astrobee source checked out per `INSTALL.md`. - -We'll call the remote host `remotehost` and your local host `laptop`. - -On `remotehost`, run these commands to build and run the `astrobee-vnc` container: -```bash -cd $ASTROBEE_WS/src/scripts/docker/remote -./build_ssh.sh -./run_vnc.sh -``` - -In your ~/.ssh/config file add: -``` -Host docker_* - User root - ProxyCommand ssh $(echo %h | sed 's/docker_//') nc 172.17.0.1 9090 -``` - -To ssh to the docker container, use: -```bash -ssh -X docker_${SERVER_NAME} -``` - -From there you can run graphical applications and the interface should be forwarded to your local computer. \ No newline at end of file diff --git a/scripts/docker/remote/readme_vnc.md b/scripts/docker/remote/readme_vnc.md deleted file mode 100644 index 74a47ef512..0000000000 --- a/scripts/docker/remote/readme_vnc.md +++ /dev/null @@ -1,55 +0,0 @@ -\page vnc-docker Remote using VNC - -# Astrobee Docker container with graphical applications shared via VNC # - -These setup instructions assume you want to run graphical applications inside a Docker container running on a remote host, and view the graphics on your local display. - -We assume the remote host is an Ubuntu host where: -- Docker has been installed and configured to be used by non-admin users. -- You already have the Astrobee source checked out per `INSTALL.md`. - -We'll call the remote host `remotehost` and your local host `laptop`. - -On `remotehost`, run these commands to build and run the `astrobee-vnc` container: -```bash -cd $ASTROBEE_WS/src/scripts/docker/remote -./build_vnc.sh -./run_vnc.sh -``` - -Note that the `run_vnc.sh` command will spout a bunch of warnings that you can safely ignore, and it should keep running indefinitely. If you Ctrl-C out of it you will stop the container. - -In another terminal on `remotehost`, run: -```bash -remotehost$ cd $ASTROBEE_WS/src/scripts/docker/remote -remotehost$ ./exec_vnc.sh -docker# xeyes & -``` - -Note that `exec_vnc.sh` opens up a shell session inside the container. The `xeyes` command demonstrates running an arbitrary X11 application inside the container that will connect to the display of the X server running inside the container. - -On `laptop`, run: -```bash -REMOTE_HOST=remotehost.ndc.nasa.gov # choose your host -ssh -L 127.0.0.1:5900:localhost:5900 $REMOTE_HOST -N -``` - -This will set up port forwarding between port 5900 of the `laptop` loopback interface and port 5900 of the `remotehost` loopback interface (note: explicitly restricting the forwarding to the loopback interface `127.0.0.1` is important for security). In turn, the Docker daemon will forward port 5900 of the `remotehost` loopback interface to port 5900 of the container where the VNC server is listening. That will allow us to run a VNC client on `laptop` and connect to the VNC server using localhost port 5900 with no fuss. - -Note that the `ssh` port forwarding command should keep running indefinitely. If you Ctrl-C out of it you will stop the port forwarding. - -In another terminal on `laptop`, run: -```bash -sudo apt-get install xtightvncviewer -vncviewer localhost::5900 -encodings "copyrect tight hextile zlib corre rre raw" -``` - -The VNC client should show you an X11 desktop running the Xfce lightweight window manager and the `xeyes` example app we ran earlier. Success! This is the end of the demo. - -Note that the `-encodings` argument to `vncviewer` tells it to prefer more compressed encodings for low-bandwidth network connections. If you leave it out, `vncviewer` will notice that it is connecting to a VNC server on localhost, decide it doesn't need to worry about bandwidth, and default to an uncompressed `raw` encoding with poor network performance. - -## Limitations ## - -The `xvfb` server by default will probably not support modern X extensions such as RANDR and GLX that may be used by 3D-heavy applications like Gazebo and the Astrobee GDS Control Station. There are known workarounds for this, but it's currently left for future work. (Potential untested workaround: enable the extensions at the `xvfb` command line, install VirtualGL, and run the apps that need the extensions under `vglrun`.) - -The port should be configurable. Hard coding 5900 will cause conflicts if multiple users work on the same remote host. The VNC server is currently not configured to require authentication once the port forwarding is set up, so in theory you could join another user`s graphical session (is that a bug or a feature?). diff --git a/scripts/docker/remote/run_ssh.sh b/scripts/docker/remote/run_ssh.sh deleted file mode 100755 index ee27f97c08..0000000000 --- a/scripts/docker/remote/run_ssh.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Find root dir -thisdir=$(dirname "$(readlink -f "$0")") -rootdir=$(realpath ${thisdir}/../../..) - -# Note: Explicitly specifying loopback interface (127.0.0.1) in -p is -# important for security. Otherwise the SSH server will be accessible -# from outward-facing network interfaces and you should expect a -# warning from network security admins when it is found in a port scan. -docker run -ti --rm -p 9090:22/tcp --name astrobee-ssh astrobee/astrobee:latest-ssh-ubuntu20.04 bash diff --git a/scripts/docker/remote/run_vnc.sh b/scripts/docker/remote/run_vnc.sh deleted file mode 100755 index 1e21fa805f..0000000000 --- a/scripts/docker/remote/run_vnc.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -cd ${HOME}/ros_ws/astrobee/src - -docker run -ti --rm -p 9090:22/tcp --name astrobee-vnc astrobee/astrobee:latest-vnc-ubuntu20.04