Deployment checklist
Hugging Face Space type: Docker, preferably Private while testing.
Required Space Secrets:
ZAI_API_KEY(智谱 API key;启动脚本会映射给官方 Codex CLI)CODEWHALE_RUNTIME_TOKEN
Recommended Space Secret:
HF_TOKENwith read access to any private/restricted fisheries Dataset used by the Space. The two default public repositories can be read without a token.
Required Space Variable:
MARINE_API_URL
For the school deployment, keep MARINE_API_URL=http://127.0.0.1:8000 and set
MARINE_PROXY_UPSTREAM_URL=http://127.0.0.1:8000. The fixed ngrok web domain
continues to point to port 7861; requests sent to /marine/... are forwarded
to the local Marine API. On Hugging Face, set MARINE_API_URL to the public
web URL with the /marine suffix, for example:
https://subway-unbiased-barcode.ngrok-free.dev/marine.
When the school network cannot reach Hugging Face, set these school-only variables so fisheries inventory and downloads use the local mirror:
LOCAL_SQUID_DATA_ROOT=/data0/zqyan/squid_data/rawLOCAL_TUNA_DATA_ROOT=/data0/zqyan/tuna_data/raw
Optional Space Variables:
HF_SQUID_DATASET_REPO(defaultglobalsquiddatabase/squid_dataset)HF_TUNA_DATASET_REPO(defaultglobalsquiddatabase/Tuna-Fisheries-Dataset)HF_SQUID_DATASET_REVISIONandHF_TUNA_DATASET_REVISION(optional approved commit SHAs; otherwise each repository's current SHA is resolved and cached)PUBLIC_BASE_URL(normally inferred fromSPACE_HOST)HF_FISHERIES_MAX_CSV_BYTESandHF_FISHERIES_MAX_ZIP_BYTES
The current temporary Marine API URL can be used for the first smoke test. Later replace the Quick Tunnel with a fixed Named Tunnel URL.
After the Space is Running:
- Open
/mobileif the root does not redirect there. - Test Ocean status:
检查我的海洋数据服务器,并告诉我三个数据中心状态。 - Test a real fisheries CSV read/export:
实际读取 current/sprfmo_effort.csv,报告字段、记录数、缺失、重复并导出 CSV。 - Test Tuna routing and export:
只查询 Tuna-Fisheries-Dataset,查找并读取 ICCAT/EFFDIS_LL2000-2024.csv,报告真实字段、记录数、缺失和重复并导出 CSV。Expected exports: filtered raw detail, exact-deduplicated detail and annual summary. ICCATYearCmust be reported as the year field. - Expected model-visible tools include
mcp_marine_fisheries_analyze_export. - Open the returned
/api/fisheries/download/{token}URL and confirm the CSV downloads successfully.
Next server phase:
- add
/query - add
/subset - add
/download/{token} - add job/update APIs
Then extend
marine_mcp.pywith corresponding tools.
v3.4.0 deployment stability
VERSIONis the single application version source.- Only root
app.htmlis served; do not re-createtemplates/app.html. scripts/preflight.pyruns automatically fromstart.shand fails fast if Space metadata or the frontend entry is inconsistent.- For durable user favorites and project-package downloads, attach Hugging Face Persistent Storage and set:
USER_STATE_ROOT=/data/squid_user_statePROJECT_PACKAGE_ROOT=/data/squid_project_packages