| # Deployment checklist |
|
|
| Hugging Face Space type: Docker, preferably Private while testing. |
|
|
| Required Space Secrets: |
| - `OPENCODE_GO_API_KEY` (or the same key stored as `OPENAI_API_KEY`) |
| - `CODEWHALE_RUNTIME_TOKEN` |
|
|
| Recommended Space Secret: |
| - `HF_TOKEN` with 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` |
|
|
| Optional Space Variables: |
| - `HF_SQUID_DATASET_REPO` (default `globalsquiddatabase/squid_dataset`) |
| - `HF_TUNA_DATASET_REPO` (default `globalsquiddatabase/Tuna-Fisheries-Dataset`) |
| - `HF_SQUID_DATASET_REVISION` and `HF_TUNA_DATASET_REVISION` (optional approved |
| commit SHAs; otherwise each repository's current SHA is resolved and cached) |
| - `PUBLIC_BASE_URL` (normally inferred from `SPACE_HOST`) |
| - `HF_FISHERIES_MAX_CSV_BYTES` and `HF_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: |
| 1. Open `/mobile` if the root does not redirect there. |
| 2. Test Ocean status: `检查我的海洋数据服务器,并告诉我三个数据中心状态。` |
| 3. Test a real fisheries CSV read/export: |
| `实际读取 current/sprfmo_effort.csv,报告字段、记录数、缺失、重复并导出 CSV。` |
| 4. 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. ICCAT `YearC` must be reported as the year field. |
| 5. Expected model-visible tools include |
| `mcp_marine_fisheries_analyze_export`. |
| 6. 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.py` with corresponding tools. |
|
|
| ## v3.4.0 deployment stability |
|
|
| - `VERSION` is the single application version source. |
| - Only root `app.html` is served; do not re-create `templates/app.html`. |
| - `scripts/preflight.py` runs automatically from `start.sh` and 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_state` |
| - `PROJECT_PACKAGE_ROOT=/data/squid_project_packages` |
|
|