Option
HeimHeim Skill DevOps und CI/CD tao-run-on-local-docker

tao-run-on-local-docker

NVIDIA/skills NVIDIA/skills

Führen Sie TAO-SDK-Jobs als Docker-Container auf einem lokalen oder entfernten Docker-Daemon mit NVIDIA-GPU-Unterstützung aus, einschließlich Vorabprüfungen und der Verwaltung von Anmeldedaten.

...Alle erweitern
0
Zeit aktualisiert 25. September 2026

Lokale Docker-

Ein-Knoten-Ausführungsplattform, die TAO-Jobs als benannte Docker-Container auf einem Docker-Daemon ausführt. Der Daemon kann lokal auf dem Agenten-Host oder remote über DOCKER_HOST=ssh://user@host / einem Docker-Kontext betrieben werden. Dies ist nützlich für die Entwicklung, Fehlerbehebung, kleine Laufdurchgänge und Workflows, bei denen ein lokaler Codierungsagent Jobs an einen entfernten GPU-Rechner übermittelt.

Verwenden Sie „Lokaler Docker“, wenn sich die Daten lokal auf dem Docker-Host befinden oder über eingebundene Volumes/Cloud-Anmeldedaten zugänglich sind. Verwenden Sie ihn nicht für die Planung in Remote-Clustern, Training auf mehreren Knoten oder Jobs, die eine SLURM-Warteschlange erfordern.

Verwenden Sie Remote-Docker, wenn der Agent auf einer Workstation oder einem Laptop läuft, der Docker-Daemon und die GPUs sich jedoch auf einem anderen Server mit einer einzelnen GPU befinden. Im Remote-Docker-Modus werden alle lokalen Dateisystempfade in den Spezifikationen auf dem Remote-Docker-Host interpretiert, nicht auf dem Agentenrechner.

Vorabprüfung

Der Workflow muss die GPU-Laufzeitumgebung des Hosts vor dem Start von Docker-Jobs überprüfen. Falls die Überprüfung fehlschlägt, soll der Benutzer aufgefordert werden, die Installation zu genehmigen, den angezeigten Installationsbefehl auszuführen und die Vorabprüfung erneut durchzuführen.

# Host GPU runtime: NVIDIA driver 580, CUDA 13.0, NVIDIA Container Toolkit 1.19.0.
TAO_SKILL_BANK_ROOT="${TAO_SKILL_BANK_ROOT:-$PWD}"
SETUP_SCRIPT="${TAO_SKILL_BANK_ROOT}/skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh"

bash "$SETUP_SCRIPT" --backend docker --check-only || {
  echo "MISSING: TAO GPU host runtime is not ready."
  echo "After user approval, run:"
  echo "  bash \"$SETUP_SCRIPT\" --backend docker --install --yes"
  exit 1
}

# Mode 1 — direct docker (no Python). All you need is docker + the GPU runtime.
docker info >/dev/null 2>&1 || { echo "MISSING: docker daemon not reachable. Start Docker."; exit 1; }
docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi >/dev/null 2>&1 || {
  echo "MISSING: NVIDIA Container Toolkit not installed/configured. See:"
  echo "  bash \"$SETUP_SCRIPT\" --backend docker --install --yes"
  exit 1
}

# Mode 2 — TAO SDK wrapper. Adds Job handles, S3 I/O wrapping, ActionWorkflow.
# Skip this block if Mode 1 is sufficient for the user's request.
# When Mode 2 is in scope, read `tao-skill-bank:tao-run-platform` for the DockerSDK
# kwarg contract, build_entrypoint, and monitoring patterns.
# nvidia-tao-sdk is on public PyPI; pin lives in versions.yaml (wheels.tao_sdk_docker).
PIN=$("${TAO_SKILL_BANK_PATH:?}/scripts/resolve_versions_key.py" wheels.tao_sdk_docker)
python -c "import tao_sdk" 2>/dev/null || python -m pip install "$PIN"
python -c "import docker" 2>/dev/null || python -m pip install "$PIN"
python -c "import tao_sdk, docker"

# DockerSDK attaches every job container to ${DOCKER_NETWORK:-tao_default}.
# Create the network if it is missing; the operation is local and idempotent.
DOCKER_NETWORK_NAME="${DOCKER_NETWORK:-tao_default}"
docker network inspect "$DOCKER_NETWORK_NAME" >/dev/null 2>&1 || \
  docker network create "$DOCKER_NETWORK_NAME" >/dev/null

Wenn eine Prüfung fehlschlägt, fordert der Agent den Benutzer auf, die Installation bzw. Korrektur über Bash zu autorisieren, bevor fortgefahren wird. Über „pip“ installierbare Python-Voraussetzungen und die oben beschriebene Einrichtung des Docker-Netzwerks bilden Ausnahmen: Diese sind automatisch zu installieren bzw. einzurichten, anschließend ist die Vorabprüfung erneut durchzuführen.

Anmeldedaten

Es sind keine Plattform-Anmeldedaten erforderlich, die über den Zugriff auf den Docker-Daemon hinausgehen.

Optionale Umgebungsvariable:

  • DOCKER_HOST: Optionale URL des Docker-Daemons. Ist diese nicht gesetzt, verwendet das SDK die normale Umgebung bzw. die Standard-Socket-Auflösung des Docker-Python-Clients. Erforderlich für die remote-docker Plattformoption erforderlich.
  • DOCKER_NETWORK: Docker-Netzwerk für Job-Container. Standardwert ist tao_default.
  • DOCKER_USERNAME: Benutzername für das Registry. Standardwert ist $oauthtoken für NGC.
  • NGC_KEY: Wird beim Abrufen privater Images von nvcr.io.
  • HOST_SSH_PATH: Wird in AutoML-Brain-Container eingebunden, wenn diese SSH-Schlüssel benötigen, um entfernte SLURM-Unterjobs zu überwachen.
  • ACCESS_KEY, SECRET_KEY, S3_ENDPOINT_URL, S3_BUCKET_NAME: Optionale S3-kompatible Speichereinstellungen für Jobs, die weiterhin Cloud-Speicher von einem lokalen Container aus lesen und beschreiben.

Vorabprüfung vor dem Start

Vor dem Generieren von Skripten oder dem Starten von Containern:

  1. Stellen Sie sicher, dass der Docker-Daemon erreichbar ist, das NVIDIA Container Toolkit als Docker-Laufzeitumgebung registriert ist, GPUs und Treiberversion gemeldet werden und ein Smoke-Container vor dem Start die GPUs erkennen kann. Bei Remote-Docker fragen Sie die GPUs über docker run ... nvidia-smi über den Remote-Daemon ab; verwenden Sie keine lokalen nvidia-smi vom Agent-Rechner aus.
  2. Stellen Sie sicher, dass alle lokalen/Datei-Datensatz-Annotationen und Medienpfade auf dem Docker-Host vorhanden sind.
  3. Für s3:// Datensätze/Ergebnisse: Stellen Sie sicher, ACCESS_KEY und SECRET_KEY sind gesetzt und die genauen Pfade sind mit aws s3 ls. Falls aws fehlt, melden Sie die fehlende Abhängigkeit und fragen Sie vor der Installation nach; führen Sie den Preflight nach der Installation erneut durch.
  4. Überprüfen Sie modellspezifische Anmeldedaten wie HF_TOKEN vor dem Start.
  5. Überprüfen Sie die aktuelle GPU-Auslastung mit nvidia-smi und vermeiden Sie GPUs, die bereits von anderen laufenden Jobs genutzt werden, wenn der Benutzer diese Einschränkung angefordert hat. Zeigen Sie die ausgewählten GPU-IDs in der Startübersicht an.
  6. Bei Modell-/Container-Kombinationen mit bekannten Architekturgrenzen die Rechenleistung der Host-GPU vor dem Start mit dem Container-Stack vergleichen. Wenn das ausgewählte Image kein JIT ausführen oder keine Kernel für die Host-Architektur ausführen kann, den Vorgang frühzeitig blockieren und nach einem kompatiblen Image oder einer kompatiblen Plattform fragen.

Verwenden Sie nach Möglichkeit das mitgelieferte Hilfsprogramm für diese Überprüfungen:

${TAO_SKILL_BANK_PATH:-~/tao-skills-external}/scripts/check_tao_launch_preflight.py \
  --platform local-docker \
  --container-image "" \
  --path train_annotation=/abs/path/to/annotations.json \
  --path train_media=/abs/path/to/media

Bei einem Remote-Docker-Daemon die remote-docker „platform“ und übergeben oder exportieren Sie DOCKER_HOST. Der Helfer überprüft die Bereitschaft der Remote-GPU und der Laufzeitumgebung und kontrolliert die Datensatzpfade auf dem Remote-Host über schreibgeschützte Bind-Mounts:

${TAO_SKILL_BANK_PATH:-~/tao-skills-external}/scripts/check_tao_launch_preflight.py \
  --platform remote-docker \
  --docker-host ssh://user@gpu-host \
  --container-image "" \
  --gpu-smoke-image ubuntu:22.04 \
  --path train_annotation=/remote/data/train/annotations.json \
  --path train_media=/remote/data/train

Die --path oben genannten Werte müssen auf dem entfernten Docker-Host vorhanden sein. Geben Sie keine Pfade an, die nur auf dem lokalen Laptop oder dem Codex-Host vorhanden sind.

Multi-GPU und Multi-Knoten

Multi-Knoten wird auf lokalem Docker nicht unterstützt. Ein Job läuft auf dem Host des lokalen Docker-Daemons ohne hostübergreifende Koordination.

Multi-GPU auf dem lokalen Host wird über das NVIDIA Container Toolkit und das --gpus (--gpus all oder --gpus '"device=0,1,2,3"'). DockerSDK.create_job(gpu_count=N) wird an --gpus). Die verteilte Init-Funktion auf einem einzelnen Host nutzt localhost; torchrun --nproc-per-node=N oder PyTorch-DDP-Verfahren wie gewohnt.

Backend-Details

Verwenden Sie den SDK-Backend-Wert local-docker. Das lokale Backend-Schema enthält keine zusätzlichen Backend-Details, daher wird der Großteil des Routings durch Umgebungs- und Job-Parameter gesteuert:

{
  "backend_type": "local-docker",
  "num_gpu": 1
}

Gemäß dem Brev-SDK-Design verbleiben die Werte für Plattform und Steuerungsebene im SDK- Zustand und in den Docker-Labels. Das SDK fügt keine BACKEND, HOST_PLATFORM, MONGOSECRET, DOCKER_HOSToder DOCKER_NETWORK in den Trainingscontainer ein.

Containerausführung

Der lokale Docker-Handler des TAO-SDK startet Container über den Docker-Python-Client :

  • Der Name des Backend-Jobs verwendet das tao-job- Format, das von SDK-Handlern verwendet wird.
  • Der Befehl lautet in der Regel ["/bin/bash", "-c", ""].
  • Container werden im Detached-Modus ausgeführt. Das SDK behält Container standardmäßig bei, sodass Status und Protokolle weiterhin einsehbar sind, es sei denn, DOCKER_AUTO_REMOVE=true.
  • /dev/shm als tmpfs eingebunden ist.
  • Das konfigurierte Docker-Netzwerk wird vom Docker-Daemon für den Job-Container angewendet; es wird nicht als Prozessumgebungsvariable weitergegeben.
  • Vorhandene Container mit derselben Job-ID werden angehalten und entfernt, bevor ein Ersatzcontainer gestartet wird.

Für den GPU-Zugriff erkennt der Handler automatisch den Host-Typ:

  • Tegra- oder Jetson-Hosts verwenden runtime="nvidia" sowie NVIDIA_VISIBLE_DEVICES und NVIDIA_DRIVER_CAPABILITIES=all.
  • Standard-x86-Hosts nutzen Docker device_requests mit GPU-Fähigkeiten.

Falls num_gpus ist 0, werden keine GPUs zugewiesen. Wenn num_gpus ist -1ist, werden alle sichtbaren GPUs angefordert. Bevorzugen Sie explizite GPU-Anzahlen bei gemeinsam genutzten Entwicklungsrechnern. Wenn explizite Geräte-IDs verfügbar sind, ziehen Sie diese der Auswahl nur nach Anzahl auf gemeinsam genutzten Rechnern vor, damit der Start keine GPUs beansprucht, die bereits von anderen Aufgaben belegt sind.

Speicher

Lokaler Docker akzeptiert lokale und file:// Pfade, da der Container auf dem selben Docker-Host läuft. Stellen Sie sicher, dass jeder Pfad in der Spezifikation entweder:

  • vom Handler oder dem umgebenden Dienst in den Container eingebunden ist oder
  • bereits von innerhalb des Containers erreichbar ist oder
  • eine Cloud-URI mit passenden Anmeldedaten ist.

Bei entfernten/gemeinsam genutzten Dateisystemen sollten Sie die Plattform bevorzugen, zu der das Dateisystem gehört. Verwenden Sie beispielsweise SLURM in Verbindung mit lustre:///... für Lustre-Pfade in einem Cluster.

Überwachung

  • Der SDK-Handler bildet den Status des Docker-Containers direkt ab: „created“ -> „Pending“, „running/restarting“ -> „Running“, „paused“ -> „Paused“, Exit-Code 0 -> „Complete“, Exit-Code ungleich Null -> „Error“.
  • Protokolle kommen direkt vom genannten Container über den Docker-Python-Client (docker logs tao-job-).

Wenn der Container beendet wurde, abgestürzt ist, gerade entfernt wird oder nicht gefunden werden kann, behandelt die Statusabgleichung den Backend-Prozess als beendet.

Abbruch

Eine Abbruchanforderung stoppt den genannten Container. Die Verwaltung der GPU-Zuweisung erfolgt durch Docker bzw. die NVIDIA-Laufzeitumgebung, nicht durch den lokalen GPU-Manager von TAO Core.

Optional: über das TAO-SDK

Wenn Sie Job-Handles, S3-I/O-Wrapping über die script_runneroder sitzungsübergreifende Dauerhaftigkeit:

from tao_sdk.platforms.docker import DockerSDK

sdk = DockerSDK()  # reads DOCKER_HOST, NGC_KEY, S3 creds from env
job = sdk.create_job(
    image='nvcr.io/nvidia/tao/tao-toolkit:6.26.3-pyt',
    command='dino train -e /tmp/spec.yaml',
    gpu_count=1,
    inputs={'/data/train.json': 's3://bucket/coco/train.json'},
    outputs=['/results/'],
)

status = sdk.get_job_status(job.id)
logs = sdk.get_job_logs(job.id, tail=200)

Dies umhüllt denselben docker run Aufruf unter einem Job Handle und leitet den Einstiegspunkt durch script_runner , sodass inputs/outputs automatisch von S3 heruntergeladen bzw. auf S3 hochgeladen werden. Wenn Sie diese Funktionen nicht benötigen, nutzen Sie einfach docker run direkt – es ist keine SDK-Installation erforderlich.

Fehlermeldungen

Docker-Client nicht initialisiert: Überprüfen Sie, ob das Docker-Python-Paket installiert ist, legen Sie DOCKER_HOST , falls Sie nicht den lokalen Standard-Socket verwenden, und stellen Sie sicher, dass der Prozess mit dem Daemon kommunizieren kann.

GPU-Zuweisung fehlgeschlagen: Die angeforderten GPUs sind nicht verfügbar, das NVIDIA Container Toolkit ist nicht konfiguriert oder der Docker-Daemon kann keine GPU-Geräteanforderungen erstellen. Verwenden Sie weniger GPUs, warten Sie, bis ein anderer Job abgeschlossen ist, oder überprüfen Sie, docker run --gpus ... auf dem Host funktioniert.

Authentifizierung beim Abrufen des Images fehlgeschlagen: Legen Sie eine gültige NGC_KEY für private nvcr.io Images oder führen Sie docker login nvcr.io -u '$oauthtoken' auf dem Docker-Host aus.

Container wurde unerwartet beendet: Überprüfen Sie docker logs tao-job-, das konfigurierte DOCKER_NETWORKund den vom SDK-Action-Runner generierten Befehl.

Pfad im Container fehlt: Ein lokaler Pfad auf dem Host wird nicht zwangsläufig in den Job-Container eingebunden. Verwenden Sie eine vom Aktions-Runner unterstützte Pfadkonvention oder konfigurieren Sie ein explizites Volume über den umgebenden Dienst.

Auf GitHub ansehen
---
name: tao-run-on-local-docker
description: Run TAO SDK jobs as Docker containers on a local or remote Docker daemon with NVIDIA GPU support, including preflight checks and credential handling.
license: Apache-2.0
---

# Local Docker

Single-node execution platform that runs TAO jobs as named Docker containers on
a Docker daemon. The daemon can be local to the agent host or remote through
`DOCKER_HOST=ssh://user@host` / a Docker context. It is useful for development,
debugging, small runs, and workflows where a local coding agent submits jobs to
a remote GPU box.

Use local Docker when the data is local to the Docker host or accessible through
mounted volumes/cloud credentials. Do not use it for remote cluster scheduling,
multi-node training, or jobs that need SLURM queueing.

Use remote Docker when the agent is running on a workstation or laptop but the
Docker daemon and GPUs are on another single GPU server. In remote Docker mode,
all local filesystem paths in specs are interpreted on the remote Docker host,
not on the agent machine.

## Preflight

The workflow must verify the host GPU runtime before starting Docker jobs. If
the check fails, prompt the user to approve the install, run the printed install
command, and rerun the preflight.

```bash
# Host GPU runtime: NVIDIA driver 580, CUDA 13.0, NVIDIA Container Toolkit 1.19.0.
TAO_SKILL_BANK_ROOT="${TAO_SKILL_BANK_ROOT:-$PWD}"
SETUP_SCRIPT="${TAO_SKILL_BANK_ROOT}/skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh"

bash "$SETUP_SCRIPT" --backend docker --check-only || {
  echo "MISSING: TAO GPU host runtime is not ready."
  echo "After user approval, run:"
  echo "  bash \"$SETUP_SCRIPT\" --backend docker --install --yes"
  exit 1
}

# Mode 1 — direct docker (no Python). All you need is docker + the GPU runtime.
docker info >/dev/null 2>&1 || { echo "MISSING: docker daemon not reachable. Start Docker."; exit 1; }
docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi >/dev/null 2>&1 || {
  echo "MISSING: NVIDIA Container Toolkit not installed/configured. See:"
  echo "  bash \"$SETUP_SCRIPT\" --backend docker --install --yes"
  exit 1
}

# Mode 2 — TAO SDK wrapper. Adds Job handles, S3 I/O wrapping, ActionWorkflow.
# Skip this block if Mode 1 is sufficient for the user's request.
# When Mode 2 is in scope, read `tao-skill-bank:tao-run-platform` for the DockerSDK
# kwarg contract, build_entrypoint, and monitoring patterns.
# nvidia-tao-sdk is on public PyPI; pin lives in versions.yaml (wheels.tao_sdk_docker).
PIN=$("${TAO_SKILL_BANK_PATH:?}/scripts/resolve_versions_key.py" wheels.tao_sdk_docker)
python -c "import tao_sdk" 2>/dev/null || python -m pip install "$PIN"
python -c "import docker" 2>/dev/null || python -m pip install "$PIN"
python -c "import tao_sdk, docker"

# DockerSDK attaches every job container to ${DOCKER_NETWORK:-tao_default}.
# Create the network if it is missing; the operation is local and idempotent.
DOCKER_NETWORK_NAME="${DOCKER_NETWORK:-tao_default}"
docker network inspect "$DOCKER_NETWORK_NAME" >/dev/null 2>&1 || \
  docker network create "$DOCKER_NETWORK_NAME" >/dev/null
```

If a check fails, the agent prompts the user to authorize the install/fix via Bash before proceeding. Pip-installable Python requirements and Docker network creation above are exceptions: install/create them automatically, then rerun preflight.

## Credentials

There are no platform credentials required beyond access to the Docker daemon.

Optional environment:

- **DOCKER_HOST**: Optional Docker daemon URL. If unset, the SDK uses the
  Docker Python client's normal environment/default socket resolution. Required
  for the `remote-docker` platform option.
- **DOCKER_NETWORK**: Docker network for job containers. Default is
  `tao_default`.
- **DOCKER_USERNAME**: Registry username. Default is `$oauthtoken` for NGC.
- **NGC_KEY**: Used when pulling private images from `nvcr.io`.
- **HOST_SSH_PATH**: Mounted into AutoML brain containers when they need SSH keys
  to monitor remote SLURM child jobs.
- **ACCESS_KEY**, **SECRET_KEY**, **S3_ENDPOINT_URL**, **S3_BUCKET_NAME**:
  Optional S3-compatible storage settings for jobs that still read/write cloud
  storage from a local container.

## Launch Preflight

Before generating scripts or starting containers:

1. Verify the Docker daemon is reachable, NVIDIA Container Toolkit is registered
   as a Docker runtime, GPUs and driver version are reported, and a smoke
   container can see GPUs before launch. For remote Docker, query GPUs through
   `docker run ... nvidia-smi` against the remote daemon; do not use local
   `nvidia-smi` from the agent machine.
2. Verify every local/file dataset annotation and media path exists on the
   Docker host.
3. For `s3://` datasets/results, verify `ACCESS_KEY` and `SECRET_KEY` are set
   and the exact paths are readable with `aws s3 ls`. If `aws` is missing,
   report the missing dependency and ask before installing it; rerun preflight
   after installation.
4. Verify model-specific credentials such as `HF_TOKEN` before launch.
5. Check current GPU occupancy with `nvidia-smi` and avoid GPUs already used by
   other running jobs when the user requested that constraint. Show the selected
   GPU ids in the launch review.
6. For model/container combinations with known architecture limits, compare
   host GPU compute capability with the container stack before launch. If the
   selected image cannot JIT or run kernels for the host architecture, block
   early and ask for a compatible image or platform.

Use the packaged helper for these checks when possible:

```bash
${TAO_SKILL_BANK_PATH:-~/tao-skills-external}/scripts/check_tao_launch_preflight.py \
  --platform local-docker \
  --container-image "<selected-image>" \
  --path train_annotation=/abs/path/to/annotations.json \
  --path train_media=/abs/path/to/media
```

For a remote Docker daemon, use the `remote-docker` platform and pass or export
`DOCKER_HOST`. The helper verifies remote GPU/runtime readiness and checks
remote-host dataset paths through read-only bind mounts:

```bash
${TAO_SKILL_BANK_PATH:-~/tao-skills-external}/scripts/check_tao_launch_preflight.py \
  --platform remote-docker \
  --docker-host ssh://user@gpu-host \
  --container-image "<selected-image>" \
  --gpu-smoke-image ubuntu:22.04 \
  --path train_annotation=/remote/data/train/annotations.json \
  --path train_media=/remote/data/train
```

The `--path` values above must exist on the remote Docker host. Do not pass
paths that exist only on the local laptop or Codex host.

## Multi-GPU and multi-node

**Multi-node is not supported on local Docker.** One job runs on the local Docker daemon's host with no cross-host coordination.

Multi-GPU **on the local host** is supported via the NVIDIA Container Toolkit's `--gpus` flag (`--gpus all` or `--gpus '"device=0,1,2,3"'`). `DockerSDK.create_job(gpu_count=N)` plumbs through to `--gpus`. Single-host distributed init uses `localhost`; `torchrun --nproc-per-node=N` or PyTorch DDP work as usual.

## Backend Details

Use the SDK backend value `local-docker`. The local backend schema has no extra
backend details, so most routing is controlled by environment and job
parameters:

```json
{
  "backend_type": "local-docker",
  "num_gpu": 1
}
```

Following the Brev SDK design, platform/control-plane values stay in SDK
state and Docker labels. The SDK does not inject `BACKEND`, `HOST_PLATFORM`,
`MONGOSECRET`, `DOCKER_HOST`, or `DOCKER_NETWORK` into the training container.

## Container Execution

The TAO SDK local Docker handler starts containers through the Docker Python
client:

- Backend job name uses the `tao-job-<job_id>` form used by SDK handlers.
- Command is usually `["/bin/bash", "-c", "<job command>"]`.
- Containers run detached. The SDK keeps containers by default so status and
  logs remain inspectable, unless `DOCKER_AUTO_REMOVE=true`.
- `/dev/shm` is mounted as tmpfs.
- The configured Docker network is applied by the Docker daemon for the job
  container; it is not passed through as a process environment variable.
- Existing containers with the same job id are stopped and removed before a
  replacement starts.

For GPU access, the handler auto-detects the host type:

- Tegra or Jetson hosts use `runtime="nvidia"` plus
  `NVIDIA_VISIBLE_DEVICES` and `NVIDIA_DRIVER_CAPABILITIES=all`.
- Standard x86 hosts use Docker `device_requests` with GPU capabilities.

If `num_gpus` is `0`, no GPUs are assigned. If `num_gpus` is `-1`, all visible
GPUs are requested. Prefer explicit GPU counts for shared development machines.
When explicit device ids are available, prefer them over count-only selection
on shared machines so the launch does not steal GPUs occupied by other tasks.

## Storage

Local Docker accepts local and `file://` paths because the container runs on the
same Docker host. Make sure every path in the spec is either:

- mounted into the container by the handler or surrounding service,
- reachable from inside the container already, or
- a cloud URI with matching credentials.

For remote/shared filesystems, prefer the platform that owns that filesystem.
For example, use SLURM plus `lustre:///...` for Lustre paths on a cluster.

## Monitoring

- The SDK handler maps Docker container state directly: created -> Pending,
  running/restarting -> Running, paused -> Paused, exit code 0 -> Complete,
  nonzero exit -> Error.
- Logs come directly from the named container through the Docker Python client
  (`docker logs tao-job-<job_id>`).

If the container has exited, died, is being removed, or cannot be found, status
reconciliation treats the backend process as terminated.

## Cancellation

Cancellation stops the named container. GPU ownership is managed by Docker /
the NVIDIA runtime, not by TAO Core's local GPU manager.

## Optional: via the TAO SDK

If you want Job handles, S3 I/O wrapping via the SDK's `script_runner`, or
durability across sessions:

```python
from tao_sdk.platforms.docker import DockerSDK

sdk = DockerSDK()  # reads DOCKER_HOST, NGC_KEY, S3 creds from env
job = sdk.create_job(
    image='nvcr.io/nvidia/tao/tao-toolkit:6.26.3-pyt',
    command='dino train -e /tmp/spec.yaml',
    gpu_count=1,
    inputs={'/data/train.json': 's3://bucket/coco/train.json'},
    outputs=['/results/'],
)

status = sdk.get_job_status(job.id)
logs = sdk.get_job_logs(job.id, tail=200)
```

This wraps the same `docker run` invocation under a `Job` handle and routes
the entrypoint through `script_runner` so `inputs`/`outputs` get downloaded
from / uploaded to S3 automatically. If you don't need those, just use
`docker run` directly — no SDK install required.

## Failure Modes

**Docker client not initialized**: Verify the Docker Python package is installed,
set `DOCKER_HOST` if you are not using the default local socket, and confirm the
process can talk to the daemon.

**GPU assignment failed**: Requested GPUs are unavailable, the NVIDIA Container
Toolkit is not configured, or the Docker daemon cannot create GPU device
requests. Use fewer GPUs, wait for another job to finish, or verify
`docker run --gpus ...` works on the host.

**Image pull auth failed**: Set a valid `NGC_KEY` for private `nvcr.io` images
or run `docker login nvcr.io -u '$oauthtoken'` on the Docker host.

**Container exited unexpectedly**: Check `docker logs tao-job-<job_id>`, the
configured `DOCKER_NETWORK`, and the command produced by the SDK action runner.

**Path missing inside container**: A local path on the host is not necessarily
mounted into the job container. Use a path convention supported by the action
runner or configure an explicit volume through the surrounding service.

tao-run-on-local-docker installieren

Laden Sie die Skill-Dateien herunter und entpacken Sie sie in Ihr Verzeichnis „.claude/skills/“.

ZIP herunterladen

Klonen Sie das Repository und kopieren Sie die Skill-Dateien in Ihr Projekt.

git clone https://github.com/NVIDIA/skills/tree/main/skills/tao-run-on-local-docker # Copy SKILL.md to your .claude/skills/ directory

Kopieren Kopieren
Schnelle Einrichtung: Kopieren Sie den Skill-Ordner nach .claude/skills/ Claude erkennt den Skill automatisch und nutzt ihn.
Repository NVIDIA/skills

Ähnliche Skills

Verification &amp; Quality Assurance
Zeit aktualisiert 29. Juni 2026
klingai-upgrade-migration
Zeit aktualisiert 3. Juli 2026
base44-cli
Zeit aktualisiert 29. Juni 2026
Railway CLI Management
Zeit aktualisiert 2. Juli 2026
OR