hf-space-recovery

작성자: huggingface

Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…

npx skills add https://github.com/huggingface/openenv --skill hf-space-recovery

HF Space Recovery

Use this skill to recover OpenEnv Hub deployments quickly with minimal blast radius.

Execute This Workflow

1) Confirm release tuple

Use a single release tuple across all commands:

  • Namespace: openenv
  • Version: vX.Y.Z
  • Space suffix: -vX-Y-Z

Default to a version suffix and treat unsuffixed Spaces as legacy.

2) Snapshot runtime status

Collect all versioned spaces and isolate non-running ones:

hf spaces ls --author openenv --limit 500 --expand=runtime \
  | jq -r '.[] | select(.id|test("-v[0-9]+-[0-9]+-[0-9]+$")) \
    | [.id, .runtime.stage, (.runtime.raw.errorMessage // "")] | @tsv' \
  | sort

Treat RUNNING and SLEEPING as healthy. Triage everything else.

3) Classify and extract signal

  • RUNTIME_ERROR: read traceback from .runtime.raw.errorMessage.
  • BUILD_ERROR: read build error text from runtime info, then patch Dockerfile/deps.
  • APP_STARTING longer than 10 minutes: inspect event stream and metrics before changing code.
hf spaces info openenv/<space-id> --expand=runtime
curl -sS -m 10 https://huggingface.co/api/spaces/openenv/<space-id>/events | sed -n '1,140p'
curl -sS -m 10 -i https://huggingface.co/api/spaces/openenv/<space-id>/metrics | sed -n '1,120p'

Read references/troubleshooting.md for symptom-to-fix mappings.

4) Apply minimal fix and targeted redeploy

Prefer targeted redeploys over full-fleet pushes:

scripts/prepare_hf_deployment.sh \
  --hf-namespace openenv \
  --env <env_name> \
  --skip-collection

Use openenv CLI as a supplement, not a replacement, for release triage:

  • Validate env layout quickly (uv run openenv validate ...) when applicable.
  • Keep release deploys on scripts/prepare_hf_deployment.sh to preserve suffix/pinning behavior.

5) Unstick runtime when code is already good

If Space remains in APP_STARTING with no actionable error:

uv run --with huggingface_hub python - <<'PY'
from huggingface_hub import HfApi
api = HfApi()
api.restart_space("openenv/<space-id>", factory_reboot=True)
PY

If still stuck, force recreation as last resort:

hf repo delete openenv/<space-id> --repo-type space
scripts/prepare_hf_deployment.sh --hf-namespace openenv --env <env_name> --skip-collection

6) Verify and close

Verify both runtime stage and health endpoint:

hf spaces info openenv/<space-id> --expand=runtime
curl -sS -m 10 https://<space-subdomain>.hf.space/health

Then verify fleet-wide:

hf spaces ls --author openenv --limit 500 --expand=runtime \
  | jq -r '.[] | select(.id|test("-v[0-9]+-[0-9]+-[0-9]+$")) \
    | select(.runtime.stage!="RUNNING" and .runtime.stage!="SLEEPING") \
    | [.id, .runtime.stage] | @tsv' | sort

7) Reconcile collection

When targeted deploys are done, update collection membership for the same version:

python3 scripts/manage_hf_collection.py \
  --version vX.Y.Z \
  --collection-namespace openenv \
  --space-id openenv/<space-id>

Add one --space-id per redeployed space.

huggingface의 다른 스킬

cpu-kernels
huggingface
C++ CPU 커널을 SIMD 내장 함수(AVX2/AVX512)로 작성, 최적화 및 벤치마킹하는 방법에 대한 지침을 제공하며, Hugging Face 커널 생태계를 대상으로 합니다. 포함 사항…
official
generate-openenv-env
huggingface
구체적인 사용 사례(예: "라이브러리 textarena를 위한 환경 생성")로부터 OpenEnv 환경을 생성합니다. 새로운 환경을 설계하거나 구현하라는 요청을 받았을 때 사용하세요.
official
hf-mcp
huggingface
Hugging Face Hub를 MCP 서버 도구를 통해 사용하세요. 모델, 데이터셋, 스페이스, 논문을 검색하고, 저장소 세부 정보를 확인하며, 문서를 가져오고, 컴퓨팅 작업을 실행하고, Gradio를 사용할 수 있습니다…
official
trl-training
huggingface
트랜스포머 언어 모델을 TRL(Transformers Reinforcement Learning)을 사용하여 학습 및 미세 조정합니다. SFT, DPO, GRPO, KTO, RLOO 및 보상 모델 학습을 지원합니다…
official
deploy-hf
huggingface
OpenEnv 환경을 Hugging Face Spaces에 배포합니다. 배포, Hugging Face로 푸시, 또는 스페이스 업데이트를 요청받았을 때 사용하세요.
official
pre-submit-pr
huggingface
Validate changes before submitting a pull request. Run comprehensive checks including lint, tests, alignment review, and RFC analysis. Use before creating a…
official
example-skill
huggingface
액션 스모크 테스트용 예제 픽스처 스킬
official
cuda-kernels
huggingface
NVIDIA GPU(H100, A100, T4)에서 HuggingFace diffusers 및 transformers를 대상으로 최적화된 CUDA 커널 작성 및 벤치마킹을 위한 지침을 제공합니다…
official