-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun_live_server_docker.sh
More file actions
47 lines (39 loc) · 1.24 KB
/
run_live_server_docker.sh
File metadata and controls
47 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
#
# Run K3D live server in Docker with GPU support
#
# This bypasses the GCC 15 + NVRTC incompatibility on Debian 13
# by running in Ubuntu 22.04 + GCC 11 environment.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Build runtime image if it doesn't exist
if ! docker images | grep -q k3d-runtime; then
echo "Building k3d-runtime Docker image..."
docker build -f Dockerfile.runtime -t k3d-runtime .
fi
# Run live server with GPU support
echo "Starting K3D live server in Docker..."
echo "Server will be available at ws://127.0.0.1:8765"
echo ""
# Set local directory
K3D_LOCAL_DIR="${K3D_LOCAL_DIR:-/K3D/Knowledge3D.local}"
K3D_HOUSE_ID="${K3D_HOUSE_ID:-default}"
echo "Using local directory: $K3D_LOCAL_DIR"
echo "Using House ID: $K3D_HOUSE_ID"
echo ""
docker run --rm -d \
--gpus all \
-v "$SCRIPT_DIR:/workspace" \
-v "$K3D_LOCAL_DIR:/local" \
-e K3D_LOCAL_DIR=/local \
-e K3D_HOUSE_ID="$K3D_HOUSE_ID" \
-e CUPY_CACHE_DIR=/local/cache/.cupy_cache \
-p 8765:8765 \
--name k3d-live-server \
k3d-runtime
# Usage notes:
# - Press Ctrl+C to stop the server
# - Test with: python test_navigate.py (from host)
# - View logs with: docker logs -f k3d-live-server