Skip to content

Commit

Permalink
Fixes to containers; auto-mount the repo folder (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlebRyabtsev authored Oct 9, 2024
1 parent 684d064 commit 9529193
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Empty file modified containers/apps/surface/entrypoint-workstation.sh
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions containers/scripts/build-workstation.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ set -e

if [ -n "$GITHUB_WORKSPACE" ]; then
# If inside GitHub Actions, use GITHUB_WORKSPACE as the repo root
REPO_ROOT="$GITHUB_WORKSPACE"
CONTAINERS_DIR="$GITHUB_WORKSPACE/containers"
else
REPO_ROOT=$(pwd)
CONTAINERS_DIR="$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
fi

cd $REPO_ROOT/containers
cd $CONTAINERS_DIR

docker build --file platform/Dockerfile.x86-nvidia-turbovnc --tag tauv/x86-nvidia-turbovnc-platform .
docker build --build-arg BASE_IMAGE=tauv/x86-nvidia-turbovnc-platform --file common/Dockerfile.common --tag tauv/x86-nvidia-common .
Expand Down
14 changes: 11 additions & 3 deletions containers/run.sh → containers/scripts/run-workstation.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

#!/bin/bash

# Check if there are any running Docker containers
if [ "$(docker ps -q)" ]; then
echo "There are running container. You can see them by running 'docker ps' and stop them by calling 'docker kill <container name>'. Aborting..."
Expand All @@ -19,6 +17,16 @@ echo "Using shared folder: $SHARED_DIR"

echo "Starting container, VNC address: http://tauv-dev.lan.local.cmu.edu:60$(id -u | rev | cut -c1-3 | rev)/vnc.html"

rocker --nvidia --privileged --port 60$(id -u | rev | cut -c1-3 | rev):8080 --volume $SHARED_DIR:/shared --volume /dev/shm:/dev/shm -- tauv/x86-nvidia-workstation
CONTAINERS_DIR="$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
TAUV_MONO_DIR="$(dirname "$(dirname "$CONTAINER_DIR")")"

rocker \
--nvidia \
--privileged \
--port 60$(id -u | rev | cut -c1-3 | rev):8080 \
--volume $SHARED_DIR:/shared \
--volume $TAUV_MONO_DIR:/tauv-mono \
--volume /dev/shm:/dev/shm \
-- tauv/x86-nvidia-workstation


0 comments on commit 9529193

Please sign in to comment.