# smolvla-inspect — common tasks. # # The deploy targets push this repo to the Hugging Face Space so the public # viewer at https://subirmansukhani-smolvla-inspect.hf.space picks up new # run data. The Docker build on HF bakes `runs/` into the image, so anything # you add under `runs/` ships with the next push. SPACE := subirmansukhani/smolvla-inspect SPACE_URL := https://huggingface.co/spaces/$(SPACE) APP_URL := https://subirmansukhani-smolvla-inspect.hf.space HF_BRANCH := main BRANCH := $(shell git rev-parse --abbrev-ref HEAD) MSG ?= Update HF Space deploy .PHONY: help deploy deploy-full frontend-build push-origin space-status space-open space-logs help: @echo "smolvla-inspect — make targets" @echo "" @echo " make deploy Stage runs/ + frontend dist, commit, push to HF." @echo " Rebuilds the Space in ~30-60s." @echo " make deploy MSG='...' Same, with a custom commit message." @echo " make deploy-full frontend-build + deploy (use after UI changes)." @echo " make frontend-build npm run build in web/frontend/." @echo " make push-origin Also push current branch to GitHub." @echo " make space-status Show HF Space build stage (e.g. BUILDING / RUNNING)." @echo " make space-open Open the Space dashboard in a browser." @echo " make space-logs Open the Space build logs in a browser." @echo "" @echo " Space: $(SPACE_URL)" @echo " App: $(APP_URL)" frontend-build: cd web/frontend && npm run build deploy: @git add runs/ web/frontend/dist/ 2>/dev/null || true @if git diff --cached --quiet; then \ echo "Nothing new to commit; pushing current HEAD to the Space anyway."; \ else \ git commit -m "$(MSG)"; \ fi git push hf $(BRANCH):$(HF_BRANCH) @echo "" @echo "Pushed. Monitor build: $(SPACE_URL)" @echo "Poll status: make space-status" deploy-full: frontend-build deploy push-origin: git push origin $(BRANCH) space-status: @python3 -c "import urllib.request, json; \ r = json.loads(urllib.request.urlopen('https://huggingface.co/api/spaces/$(SPACE)').read()); \ rt = r.get('runtime', {}); \ print('stage: ', rt.get('stage')); \ print('sha: ', r.get('sha', '')[:10]); \ err = rt.get('errorMessage'); \ print('error: ', err[:400]) if err else None" space-open: @open "$(SPACE_URL)" || xdg-open "$(SPACE_URL)" || echo "Open manually: $(SPACE_URL)" space-logs: @open "$(SPACE_URL)/logs/build" || xdg-open "$(SPACE_URL)/logs/build" || echo "Open manually: $(SPACE_URL)/logs/build"