Spaces:
Running on T4
Running on T4
| # SimReady Validator β HuggingFace Space image | |
| # | |
| # Phase-3 of the PRD: validation runs where the dataset lives. The Space | |
| # downloads a target dataset via huggingface_hub, runs the bundled | |
| # simready-report validator with `--no-use-kit` (no Isaac Sim on HF | |
| # hardware), and writes the verdict back to the dataset as a PR. | |
| # | |
| # Image strategy: pre-bake all heavy deps (usd-core, omni.asset_validator, | |
| # simready-validate) and the simready-foundation specs checkout into the | |
| # image so cold-start is fast β the per-validation cost is just the | |
| # dataset download + USD parsing, not pip resolution. | |
| FROM python:3.11-slim | |
| # Base build deps. usd-core ships wheels for x86_64 so we don't need | |
| # build-essential, but git is required to clone simready-foundation at | |
| # build time and rsync is handy for the dashboard `_static/` mirror. | |
| # Node 20 is for the Claude Code CLI (@anthropic-ai/claude-code) that | |
| # the recovery layer in runner.py invokes when the validator crashes. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git curl ca-certificates rsync gnupg \ | |
| && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y --no-install-recommends nodejs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Claude Code CLI. Pinned to a known-good version; bump deliberately | |
| # alongside the recovery skill's wording if the SDK changes shape. | |
| RUN npm install -g @anthropic-ai/claude-code@latest | |
| # HF Spaces run as a non-root user (UID 1000). Match it so the volume | |
| # mounts are writable without permission gymnastics. | |
| ARG USER=appuser | |
| RUN useradd -m -u 1000 ${USER} | |
| WORKDIR /home/${USER}/app | |
| # Python deps first so they layer-cache independently of the validator | |
| # code. Pinned to the same versions install-simready-sdk.sh uses on the | |
| # DGXC runner (single source of truth for "what runs the validator"). | |
| COPY tools/hf_space/requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Foundation specs: pinned to a specific commit so spec churn upstream | |
| # doesn't break the Space's compatibility with the pinned simready- | |
| # validate package. The validator's loader rejects features whose | |
| # requirement codes aren't registered, and the foundation repo's main | |
| # branch has moved ahead of what simready-validate 2026.4.x understands | |
| # β sticking to the 2026.04.0 release tag (commit 805d2c5) matches the | |
| # DGXC runner's working setup. Bump deliberately when both the spec | |
| # and the validator package are tested together. | |
| ENV SIMREADY_FOUNDATIONS_PATH=/opt/simready_foundations | |
| ENV SIMREADY_FOUNDATIONS_COMMIT=805d2c50179a9878c89b0f41baaa0ecafe47c3d7 | |
| RUN git clone https://github.com/NVIDIA/simready-foundation \ | |
| ${SIMREADY_FOUNDATIONS_PATH} \ | |
| && cd ${SIMREADY_FOUNDATIONS_PATH} \ | |
| && git checkout ${SIMREADY_FOUNDATIONS_COMMIT} \ | |
| && chown -R ${USER}:${USER} ${SIMREADY_FOUNDATIONS_PATH} | |
| # Vendored simready-foundation-core wheel. Built offline from the | |
| # foundation repo at commit 805d2c5 using: | |
| # 1. python -m omni.usd_profiles.codegen --docs-root docs | |
| # --destination-dir _build/python --namespace omni.capabilities | |
| # 2. python -m build --wheel nv_core/sr_specs | |
| # Plus a local patch (docs/__init__.py + pyproject.toml entry-point | |
| # declaration) so the wheel ships the SimReadyPlugin entry-point that | |
| # omni.asset_validator's allow-list discovery requires. Without this | |
| # wheel the validator loads only DefaultPlugin and ends up with | |
| # profiles=0. The clone above is still needed for spec markdown | |
| # (SIMREADY_FOUNDATIONS_PATH) β wheel provides the runtime package. | |
| COPY tools/hf_space/wheels/simready_foundation_core-0.2.0a1-py3-none-any.whl /tmp/ | |
| RUN pip install --no-cache-dir /tmp/simready_foundation_core-0.2.0a1-py3-none-any.whl \ | |
| && rm /tmp/simready_foundation_core-0.2.0a1-py3-none-any.whl | |
| # Copy the bundled validator (the same code our DGXC runner uses) and | |
| # the Space's own entry points. Keep the in-repo path so the validator's | |
| # relative imports (report.py, external_deps.py) still resolve. | |
| COPY tools/validation /home/${USER}/app/tools/validation | |
| COPY tools/hf_space/app.py ./app.py | |
| COPY tools/hf_space/runner.py ./runner.py | |
| COPY tools/hf_space/github_issues.py ./github_issues.py | |
| # Claude Code skills, mounted where the CLI auto-discovers them. The | |
| # simready-validator-agent skill drives recovery + issue-filing; the | |
| # simready-report skill is the validator wrapper Claude already knows | |
| # from the local /simready-report workflow. | |
| RUN mkdir -p /home/${USER}/.claude/skills | |
| COPY tools/hf_space/skills/simready-validator-agent /home/${USER}/.claude/skills/simready-validator-agent | |
| COPY tools/validation/plugins/simready-report/skills/simready-report /home/${USER}/.claude/skills/simready-report | |
| RUN chown -R ${USER}:${USER} /home/${USER}/app /home/${USER}/.claude | |
| USER ${USER} | |
| # HF Spaces with the Docker SDK serve whatever listens on $PORT | |
| # (default 7860). Gradio honors GRADIO_SERVER_PORT. | |
| ENV GRADIO_SERVER_NAME=0.0.0.0 | |
| ENV GRADIO_SERVER_PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |