with one click
agilab-huggingface-spaces
// Maintain and deploy the official AGILAB Hugging Face Docker Space using the sibling thales_agilab/huggingface bundle and public agilab checkout.
// Maintain and deploy the official AGILAB Hugging Face Docker Space using the sibling thales_agilab/huggingface bundle and public agilab checkout.
| name | agilab-huggingface-spaces |
| description | Maintain and deploy the official AGILAB Hugging Face Docker Space using the sibling thales_agilab/huggingface bundle and public agilab checkout. |
| license | BSD-3-Clause (see repo LICENSE) |
| metadata | {"updated":"2026-05-06T00:00:00.000Z"} |
Use this skill when preparing, validating, or deploying the official AGILAB Hugging Face Space.
The current source of truth is the sibling apps/docs checkout, normally
../thales_agilab relative to the public agilab checkout:
<apps-repo>/huggingface/README.md<apps-repo>/huggingface/README.advanced.md<apps-repo>/huggingface/hf_space_deploy.sh<apps-repo>/huggingface/Dockerfile<apps-repo>/huggingface/seed_hf_app_settings.pyDo not default to a generic “lightweight one-page demo” plan when the repo already defines a concrete Space contract.
The official Space is currently:
<user>/agilab for the default first-proof profile<user>/agilab-advanced for the heavier advanced
profile7860agilab repo plus the sibling apps/docs huggingface packaging bundleTreat first-proof as the default target unless the user explicitly asks for
the advanced companion Space.
The current deploy path stages:
thales_agilab/huggingface
README.md for first-proofREADME.advanced.md for advancedDockerfile from thales_agilab/huggingface.dockerignore from thales_agilab/huggingfaceseed_hf_app_settings.py from thales_agilab/huggingfacedocker/install.sh from the public agilab reposrc/ from the public agilab repopyproject.toml from the public agilab repouv_config.toml from the public agilab repoThis is not a raw repo push and not a generic Space scaffold. The deploy script assembles a bounded staging directory and uploads that to Hugging Face.
Profile app/page sets:
first-proof
flight_project, meteo_forecast_projectview_maps, view_forecast_analysis, view_release_decisionadvanced
data_io_2026_project, execution_pandas_project,
execution_polars_project, flight_project, meteo_forecast_project,
mycode_project, uav_queue_project, uav_relay_queue_projectview_data_io_decision, view_forecast_analysis, view_maps,
view_maps_network, view_release_decision, view_uav_queue_analysis,
view_uav_relay_queue_analysisThe advanced profile installs every current built-in demo app, but it still avoids unrelated historical heavyweight pages that are not part of the current Advanced Proof Pack.
Keep the skill aligned with the README contract:
127.0.0.1:8786, {"127.0.0.1": 2}, and a writable in-container
AGI_CLUSTER_SHAREDo not promise:
~/agi-space or ~/wenv semanticsThe current README advertises these Hugging Face secrets:
OPENAI_API_KEY — optionalCLUSTER_CREDENTIALS — optionalWhen updating docs or deploy instructions, keep the wording aligned with the README and do not invent new required secrets unless the Space contract actually changed.
Use the documented flow:
hf auth loginHF_TOKEN in the environment<apps-repo>/huggingface/hf_space_deploy.sh \
--profile first-proof \
--agilab-path </path/to/agilab> \
--space <user>/agilab \
--create
For an existing Space:
<apps-repo>/huggingface/hf_space_deploy.sh \
--profile first-proof \
--agilab-path </path/to/agilab> \
--space <user>/agilab
For the heavier companion Space:
<apps-repo>/huggingface/hf_space_deploy.sh \
--profile advanced \
--agilab-path </path/to/agilab> \
--space <user>/agilab-advanced \
--create
Relevant options from the script:
--profile first-proof|advanced--agilab-path--space--private--createDo not replace this with hand-written deployment steps unless the user explicitly wants a new deploy path.
Before touching the Space deployment, verify:
agilab checkout exists and is the intended source tree.huggingface bundle exists and matches the intended Space contract.hf auth whoami succeeds, or HF_TOKEN is present.src/agilab/apps in the deploy source contains only public entries such as
builtin, templates, install.py, and package metadata. If the working
checkout has ignored private app symlinks, deploy from a temporary clean
worktree at origin/main rather than from the dirty checkout.
Also verify LFS-backed built-in assets are present in that clean worktree
before staging the Space.When feasible, inspect the deploy script rather than paraphrasing it from memory.
Clean worktree pattern when private app symlinks are present:
tmpdir=$(mktemp -d /tmp/agilab-hf-public.XXXXXX)
apps_repo="../thales_agilab"
space_owner="<space-owner>"
git worktree add --detach "$tmpdir" origin/main
git -C "$tmpdir" lfs install --local
git -C "$tmpdir" lfs pull
find "$tmpdir/src/agilab/apps" -maxdepth 1 -mindepth 1 -exec basename {} \; | sort
"$apps_repo/huggingface/hf_space_deploy.sh" \
--profile first-proof \
--agilab-path "$tmpdir" \
--space "$space_owner/agilab"
Use --profile advanced --space "$space_owner/agilab-advanced" for the heavier
Advanced Proof Pack companion Space.
After upload, verify the Space cutover separately from the file upload:
space_owner="<space-owner>"
hf spaces info "$space_owner/agilab" --format json
curl -I -L --max-time 20 "https://${space_owner}-agilab.hf.space/"
If the fix is about a deployed file, download that exact file from the Space and
inspect it. Do not assume the runtime is serving the new code until
runtime.stage is RUNNING and the runtime SHA matches the uploaded Space SHA.
Only remove the temporary worktree after this cutover check passes:
git worktree remove "$tmpdir"
Runtime cutover check:
python3 - <<'PY'
import json
import os
import subprocess
import time
space = os.environ.get("AGILAB_HF_SPACE", "<space-owner>/agilab")
for attempt in range(1, 31):
info = json.loads(subprocess.check_output(
["hf", "spaces", "info", space, "--format", "json"],
text=True,
))
runtime = info.get("runtime") or {}
raw = runtime.get("raw") or {}
stage = runtime.get("stage") or raw.get("stage")
repo_sha = info.get("sha")
runtime_sha = raw.get("sha")
private = info.get("private")
print(f"attempt={attempt} stage={stage} private={private} repo_sha={repo_sha} runtime_sha={runtime_sha}")
if stage in {"RUNNING", "READY"} and private is False and runtime_sha == repo_sha:
raise SystemExit(0)
time.sleep(20)
raise SystemExit(1)
PY
If the Space is stuck in RUNNING_BUILDING or RUNNING_APP_STARTING, inspect
the relevant logs before making another upload:
hf spaces logs <space-owner>/agilab --build --tail 120
hf spaces logs <space-owner>/agilab --tail 160
For worker-install failures, look for local-source staging evidence in the build
logs. A healthy source-checkout install includes lines like Staged uv source 'agi-env' path: ... -> _uv_sources/agi-env for workers that depend on AGILAB
core packages. If logs mention unresolved local paths such as
../../../core/agi-env, fix the source worker pyproject.toml path relative to
that worker manifest before redeploying.
After runtime cutover, run the public smoke:
uv --preview-features extra-build-dependencies run python tools/hf_space_smoke.py --json
If this deployment is part of a release, update release proof with the live Space commit after the smoke passes, then sync and push both docs repos:
uv --preview-features extra-build-dependencies run python tools/release_proof_report.py \
--docs-source ../thales_agilab/docs/source \
--refresh-from-local \
--hf-space-commit <space-sha> \
--render \
--check \
--compact
uv --preview-features extra-build-dependencies run python tools/sync_docs_source.py \
--source ../thales_agilab/docs/source \
--target docs/source \
--apply \
--delete
Do not call the release fully synced until runtime.stage is RUNNING, the
runtime SHA matches the uploaded Space SHA, tools/hf_space_smoke.py --json
passes, and release proof records that Space SHA.
If the user asks to change the Space behavior:
huggingface bundle firstDo not let the public repo docs claim a Space behavior that the private bundle does not implement.
Do not:
hf_space_deploy.sh when the deploy script remains the supported contractUse with:
agilab-docs when adding or updating public demo linksagilab-testing when validating repo-side changes that affect the Space contractrepo-skill-maintenance when syncing this skill between .claude/skills and .codex/skillsthales_agilab/huggingface/README.md.[HINT] Download the complete skill directory including SKILL.md and all related files