diff options
Diffstat (limited to 'containers/docs')
| -rw-r--r-- | containers/docs | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/containers/docs b/containers/docs new file mode 100644 index 0000000..3a0b3cc --- /dev/null +++ b/containers/docs | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | # Rocky SSH Container | ||
| 2 | ## Setup | ||
| 3 | ### SSH Keys | ||
| 4 | Place your SSH public keys in the `docker_build/ssh-keys/` directory: | ||
| 5 | ```bash | ||
| 6 | cp ~/.ssh/id_ed25519.pub docker_build/ssh-keys/ | ||
| 7 | ``` | ||
| 8 | The container will automatically add all `.pub` files from this directory to `/root/.ssh/authorized_keys`. | ||
| 9 | |||
| 10 | ## Building Containers | ||
| 11 | ### Base Development Container | ||
| 12 | ```bash | ||
| 13 | # From the dev_env directory | ||
| 14 | podman build -t rocky_dev:latest -f docker_build/Dockerfile . | ||
| 15 | ``` | ||
| 16 | ### GPU-Enabled Container | ||
| 17 | The GPU container builds on top of the base container using multi-stage build: | ||
| 18 | ```bash | ||
| 19 | # First build the base container (from dev_env directory) | ||
| 20 | podman build -t rocky_dev:latest -f docker_build/Dockerfile . | ||
| 21 | # Then build the GPU version | ||
| 22 | podman build -t rocky_dev_gpu:latest -f docker_build/Dockerfile.gpu . | ||
| 23 | ``` | ||
| 24 | |||
| 25 | ## GPU Support | ||
| 26 | The GPU-enabled container includes: | ||
| 27 | - NVIDIA Container Toolkit for GPU access | ||
| 28 | - GPU test script at `/usr/local/bin/gpu-test.sh` | ||
| 29 | - Environment variables configured for NVIDIA GPU visibility | ||
| 30 | - Workspace directory at `/workspace` for GPU workloads | ||
| 31 | |||
| 32 | ### Running with GPU Support | ||
| 33 | ```bash | ||
| 34 | # Run GPU-enabled container | ||
| 35 | podman run -it --device nvidia.com/gpu=all rocky_dev_gpu:latest | ||
| 36 | # Test GPU inside container | ||
| 37 | gpu-test.sh | ||
| 38 | nvidia-smi | ||
| 39 | ``` | ||
| 40 | |||
| 41 | ## Podman | ||
| 42 | ```bash | ||
| 43 | python3 podman_launch_devenv.py | ||
| 44 | python3 podman_launch_devenv.py run | ||
| 45 | python3 podman_launch_devenv.py run -p 2222 | ||
| 46 | python3 podman_launch_devenv.py list | ||
| 47 | python3 podman_launch_devenv.py cleanup | ||
| 48 | ``` | ||
| 49 | |||
| 50 | ## Kubernetes | ||
| 51 | ```bash | ||
| 52 | kubectl apply -f rocky-ssh-deployment.yaml | ||
| 53 | kubectl get pods -l app=rocky-dev -o wide | ||
| 54 | kubectl get svc rocky-dev-svc | ||
| 55 | kubectl delete pod rocky-dev-0 | ||
| 56 | kubectl scale statefulset rocky-dev --replicas=10 | ||
| 57 | kubectl delete -f rocky-ssh-deployment.yaml | ||
| 58 | ``` | ||
| 59 | ### Kubernetes GPU Deployment | ||
| 60 | ```bash | ||
| 61 | kubectl apply -f rocky-ssh-gpu-deployment.yaml | ||
| 62 | kubectl get pods -l app=rocky-dev-gpu -o wide | ||
| 63 | kubectl describe pod rocky-dev-gpu-0 | grep nvidia | ||
| 64 | kubectl exec -it rocky-dev-gpu-0 -- nvidia-smi | ||
| 65 | kubectl scale statefulset rocky-dev-gpu --replicas=4 | ||
| 66 | kubectl delete -f rocky-ssh-gpu-deployment.yaml | ||
| 67 | ``` | ||
| 68 | |||
| 69 | ## Local Registry | ||
| 70 | ```bash | ||
| 71 | podman run -d -p 5000:5000 --name registry registry:2 | ||
| 72 | podman tag localhost/rocky_dev:latest localhost:5000/rocky_dev:latest | ||
| 73 | podman push localhost:5000/rocky_dev:latest --tls-verify=false | ||
| 74 | ``` | ||
| 75 | |||
| 76 | ## Access | ||
| 77 | ```bash | ||
| 78 | # Direct shell | ||
| 79 | kubectl exec -it rocky-dev-0 -- /bin/bash | ||
| 80 | # SSH with agent forwarding (2 terminals) | ||
| 81 | kubectl port-forward rocky-dev-0 2222:22 | ||
| 82 | ssh-agent bash -c 'ssh-add ~/macm4-resident && ssh -A -p 2222 root@localhost' | ||
| 83 | # External | ||
| 84 | kubectl port-forward --address 0.0.0.0 rocky-dev-0 9999:22 | ||
| 85 | ``` | ||
| 86 | |||
| 87 | ## Features | ||
| 88 | ### Development Tools | ||
| 89 | - C/C++ development: gcc, gcc-c++, make, cmake | ||
| 90 | - Python 3 with pip and development headers | ||
| 91 | - Rust toolchain with cargo tools (cargo-edit, bacon, evcxr_jupyter) | ||
| 92 | - Node.js v22 via nvm | ||
| 93 | - Claude Code CLI tool | ||
| 94 | |||
| 95 | ### System Utilities | ||
| 96 | - SSH server with key-based authentication | ||
| 97 | - tmux, vim, nano editors | ||
| 98 | - htop, bmon for system monitoring | ||
| 99 | - git, wget, tree, bat | ||
| 100 | - Network tools: nc, net-tools, wireguard-tools | ||
| 101 | |||
| 102 | ### GPU Computing (GPU version only) | ||
| 103 | - NVIDIA GPU support via container toolkit | ||
| 104 | - GPU test utilities | ||
| 105 | - Dedicated /workspace directory for ML/GPU workloads | ||
