diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs | 69 |
1 files changed, 67 insertions, 2 deletions
| @@ -1,4 +1,42 @@ | |||
| 1 | # Rocky SSH Container | 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 | ``` | ||
| 2 | 40 | ||
| 3 | ## Podman | 41 | ## Podman |
| 4 | ```bash | 42 | ```bash |
| @@ -18,6 +56,15 @@ kubectl delete pod rocky-dev-0 | |||
| 18 | kubectl scale statefulset rocky-dev --replicas=10 | 56 | kubectl scale statefulset rocky-dev --replicas=10 |
| 19 | kubectl delete -f rocky-ssh-deployment.yaml | 57 | kubectl delete -f rocky-ssh-deployment.yaml |
| 20 | ``` | 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 | ``` | ||
| 21 | 68 | ||
| 22 | ## Local Registry | 69 | ## Local Registry |
| 23 | ```bash | 70 | ```bash |
| @@ -30,11 +77,29 @@ podman push localhost:5000/rocky_dev:latest --tls-verify=false | |||
| 30 | ```bash | 77 | ```bash |
| 31 | # Direct shell | 78 | # Direct shell |
| 32 | kubectl exec -it rocky-dev-0 -- /bin/bash | 79 | kubectl exec -it rocky-dev-0 -- /bin/bash |
| 33 | |||
| 34 | # SSH with agent forwarding (2 terminals) | 80 | # SSH with agent forwarding (2 terminals) |
| 35 | kubectl port-forward rocky-dev-0 2222:22 | 81 | kubectl port-forward rocky-dev-0 2222:22 |
| 36 | ssh-agent bash -c 'ssh-add ~/macm4-resident && ssh -A -p 2222 root@localhost' | 82 | ssh-agent bash -c 'ssh-add ~/macm4-resident && ssh -A -p 2222 root@localhost' |
| 37 | |||
| 38 | # External | 83 | # External |
| 39 | kubectl port-forward --address 0.0.0.0 rocky-dev-0 9999:22 | 84 | kubectl port-forward --address 0.0.0.0 rocky-dev-0 9999:22 |
| 40 | ``` | 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 | ||
