diff options
| author | hc <hc@email.ch> | 2025-05-31 23:44:40 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2025-05-31 23:44:40 +0800 |
| commit | d6eb567da3e6d2e64ebf22adf1fc6d21c47090f8 (patch) | |
| tree | 14c15830a8014001d5cc587b5b4d4454c880396e /docs | |
| parent | ce511f49438761549e904d6e972b8c0635306ff9 (diff) | |
hehe
Diffstat (limited to 'docs')
| -rw-r--r-- | docs | 69 |
1 files changed, 67 insertions, 2 deletions
@@ -1,4 +1,42 @@ # Rocky SSH Container +## Setup +### SSH Keys +Place your SSH public keys in the `docker_build/ssh-keys/` directory: +```bash +cp ~/.ssh/id_ed25519.pub docker_build/ssh-keys/ +``` +The container will automatically add all `.pub` files from this directory to `/root/.ssh/authorized_keys`. + +## Building Containers +### Base Development Container +```bash +# From the dev_env directory +podman build -t rocky_dev:latest -f docker_build/Dockerfile . +``` +### GPU-Enabled Container +The GPU container builds on top of the base container using multi-stage build: +```bash +# First build the base container (from dev_env directory) +podman build -t rocky_dev:latest -f docker_build/Dockerfile . +# Then build the GPU version +podman build -t rocky_dev_gpu:latest -f docker_build/Dockerfile.gpu . +``` + +## GPU Support +The GPU-enabled container includes: +- NVIDIA Container Toolkit for GPU access +- GPU test script at `/usr/local/bin/gpu-test.sh` +- Environment variables configured for NVIDIA GPU visibility +- Workspace directory at `/workspace` for GPU workloads + +### Running with GPU Support +```bash +# Run GPU-enabled container +podman run -it --device nvidia.com/gpu=all rocky_dev_gpu:latest +# Test GPU inside container +gpu-test.sh +nvidia-smi +``` ## Podman ```bash @@ -18,6 +56,15 @@ kubectl delete pod rocky-dev-0 kubectl scale statefulset rocky-dev --replicas=10 kubectl delete -f rocky-ssh-deployment.yaml ``` +### Kubernetes GPU Deployment +```bash +kubectl apply -f rocky-ssh-gpu-deployment.yaml +kubectl get pods -l app=rocky-dev-gpu -o wide +kubectl describe pod rocky-dev-gpu-0 | grep nvidia +kubectl exec -it rocky-dev-gpu-0 -- nvidia-smi +kubectl scale statefulset rocky-dev-gpu --replicas=4 +kubectl delete -f rocky-ssh-gpu-deployment.yaml +``` ## Local Registry ```bash @@ -30,11 +77,29 @@ podman push localhost:5000/rocky_dev:latest --tls-verify=false ```bash # Direct shell kubectl exec -it rocky-dev-0 -- /bin/bash - # SSH with agent forwarding (2 terminals) kubectl port-forward rocky-dev-0 2222:22 ssh-agent bash -c 'ssh-add ~/macm4-resident && ssh -A -p 2222 root@localhost' - # External kubectl port-forward --address 0.0.0.0 rocky-dev-0 9999:22 ``` + +## Features +### Development Tools +- C/C++ development: gcc, gcc-c++, make, cmake +- Python 3 with pip and development headers +- Rust toolchain with cargo tools (cargo-edit, bacon, evcxr_jupyter) +- Node.js v22 via nvm +- Claude Code CLI tool + +### System Utilities +- SSH server with key-based authentication +- tmux, vim, nano editors +- htop, bmon for system monitoring +- git, wget, tree, bat +- Network tools: nc, net-tools, wireguard-tools + +### GPU Computing (GPU version only) +- NVIDIA GPU support via container toolkit +- GPU test utilities +- Dedicated /workspace directory for ML/GPU workloads |
