Commit Graph
44 Commits
Author SHA1 Message Date
tao.chen c4529782b5 test: Isolation jupyter env 2026-08-05 18:59:33 +08:00
Winnie 78c3f1e954 Merge remote-tracking branch 'origin/develop' into develop 2026-08-05 17:53:49 +08:00
tao.chen 264faecb0d fix: python3.10 build error 2026-08-05 17:49:53 +08:00
Winnie cec6a4468e Merge remote-tracking branch 'origin/develop' into develop 2026-08-05 17:49:29 +08:00
tao.chen 450609d868 feat: support python3.10 2026-08-05 17:46:13 +08:00
Winnie 2bfe43a63f Merge branch 'develop' of http://8.153.151.51:8888/team_group/model-develop into develop 2026-08-05 17:46:05 +08:00
tao.chen c2617da61c feat: support python3.8 2026-08-05 17:10:53 +08:00
tao.chen d851f98581 fix: runtime error 2026-08-05 15:04:07 +08:00
tao.chen 07d2423c13 update: remove workspace operation table and refactor 2026-08-05 14:43:48 +08:00
tao.chen d2bb450d30 storage: add local filesystem backend option (STORAGE_BACKEND toggle)
The factory now picks between two backends based on
settings.storage_backend ("s3" default, "local" for dev / single-node /
air-gapped deployments). The new factory helper build_storage_config()
takes one of the 4 PURPOSE_BUCKETS ("workspace" | "version" |
"run_log" | "trash") and returns the kwargs for create_storage(...).

  s3   mode: AsyncStorageBackend over an S3-compatible service
           (S3_WORKSPACE_BUCKET etc. as separate buckets).
  local mode: AsyncStorageBackend over on-disk files; the 4 buckets
           become subdirectories of LOCAL_STORAGE_BASE_DIR (default
           "/data"), so the same 4-bucket layout works in both modes.

Concretely:
  - common/config.py: add storage_backend (default "s3") +
    local_storage_base_dir (default "/data").
  - common/storage/factory.py: add PURPOSE_BUCKETS constant +
    build_storage_config(bucket_name) helper.
  - backend/main.py + backend/storage_api.py: lifespan collapses the
    4-instance construction into one dict comprehension:
      app.state.object_stores = {
        name: create_storage(build_storage_config(name))
        for name in PURPOSE_BUCKETS
      }
    (was 4x ~10-line dicts, one per bucket).
  - runtime/mount.py: when STORAGE_BACKEND=local, skip the rclone mount
    entirely (the shared docker volume at LOCAL_STORAGE_BASE_DIR is the
    store; runtime reads directly).
  - docker-compose.yml: mount the shared local-storage volume at /data
    in both backend and runtime containers.
  - .env.example: document STORAGE_BACKEND + LOCAL_STORAGE_BASE_DIR.

Dependencies added to support both backends:
  - aiofiles>=25.1.0 (local async I/O) to backend + common + runtime.
  - aioboto3>=15.5.0 (async S3) to common.
  - uv.lock regenerated.

After this commit, both modes deploy end-to-end. The s3 mode is the
production default; local mode is opt-in via STORAGE_BACKEND=local.
2026-08-05 13:10:05 +08:00
tao.chen 7c456a04ce update: update custom css 2026-08-05 11:07:54 +08:00
tao.chen 87382d7bda refactor: update Dockerfile 2026-08-04 18:39:30 +08:00
tao.chen 7cf3a9d02a fix: runtime build failed 2026-08-04 18:00:06 +08:00
tao.chen a6692338cc fix: runtime build failed 2026-08-04 17:58:10 +08:00
tao.chen 004d7289ca update: update jupyter css 2026-08-04 17:45:23 +08:00
tao.chen 4919fe0909 update: create file 2026-08-04 12:40:38 +08:00
tao.chen a27cda5a0c fix: jupyter start params 2026-08-04 12:03:43 +08:00
tao.chen 60b17f5bef update: jupyter start dir 2026-08-04 11:59:04 +08:00
tao.chen ddf112034d update: jupyter api payload, wire os.environ 2026-08-04 11:29:33 +08:00
tao.chen e1172a0091 update: rclone add remote control 2026-08-03 20:02:42 +08:00
tao.chen 85791ab1ea update: rclone add remote control 2026-08-03 19:57:29 +08:00
tao.chen e19340332a update: hide top-panel 2026-08-03 19:51:24 +08:00
tao.chen 6c4bf47487 update: hide top-panel 2026-08-03 19:43:51 +08:00
tao.chen 2c54f88181 fix: notebook-dir 2026-08-03 19:12:40 +08:00
Winnie d7bd88335c merge: integrate feat/auth into develop 2026-08-03 17:44:00 +08:00
tao.chen a44b984203 chore: rollback mount path 2026-07-31 19:49:02 +08:00
Winnie 4ac8485d3e Merge branch 'develop' of http://8.153.151.51:8888/team_group/model-develop into develop 2026-07-31 19:17:24 +08:00
Winnie 49ee2c0a4a feat: 完善模型平台相关功能 2026-07-31 19:10:37 +08:00
tao.chen 838cbfdc16 chore: else bug 2026-07-31 18:39:44 +08:00
tao.chen d31fde6abc chore: fix debian source 2026-07-31 15:48:16 +08:00
tao.chen ba96f4f52a chore: update debian source 2026-07-31 15:45:17 +08:00
tao.chenandClaude 9fc886a55e perf: decouple notebook execution and tune pools
schedule:
- New _execution_loop runs alongside _database_event_loop. It claims
  job.node.execute rows, sets a 30-min lease on available_at, then
  dispatches each as asyncio.create_task under a Semaphore(N).
  Polling loop is back to sub-millisecond turnaround for
  schedule.run.requested and job.node.finished. Long notebook
  execution no longer blocks DAG advance events.
- _process_pending_events filters by event_type IN
  ('schedule.run.requested', 'job.node.finished'); the executor
  loop owns job.node.execute exclusively.
- _process_outbox_event builds a plain dict envelope before
  handler dispatch; the previous ORM-row handoff risked
  DetachedInstanceError once the outer session closed.
- _sync_once uses get_job + reschedule_job for existing job ids
  instead of add_job(replace_existing=True). Each cron schedule
  no longer removed-and-readded every 5s.
- service.py threads settings.schedule_execution_concurrency into
  the orchestrator (default 4).

common:
- create_async_engine gets explicit pool_size=10, max_overflow=20,
  pool_recycle=1800. No more relying on SQLAlchemy defaults.
- New schedule_execution_concurrency setting.

runtime:
- scan_workspaces: add missing 'import os' (NameError on startup)
  and switch to asyncio.gather bounded by Semaphore(4) so N
  workspaces start in parallel instead of sequentially.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-31 15:07:57 +08:00
tao.chenandClaude b0f93d976f build: switch services to gunicorn with per-service config
Replace uvicorn with gunicorn + UvicornWorker in backend, runtime,
and schedule Dockerfiles. New gunicorn.conf.py per service exposes
bind/workers/timeout/graceful_timeout as GUNICORN_* env knobs.

Notable details:
- schedule: timeout=0 (disables gunicorn worker heartbeat) so long
  notebook execution isn't killed by gunicorn's silent-worker kill.
- All three configs: drop dead threads=4 setting; UvicornWorker is
  async and ignores threads.
- Pin gunicorn>=26.0.0 in each pyproject; uv.lock regenerated.
- Drop stale 'COPY contracts ./contracts' from runtime and schedule
  Dockerfiles (contracts dir was deleted in an earlier refactor;
  builds would have failed).
- backend Dockerfile: switch to uv sync layout matching runtime/
  schedule; add build deps for native wheels.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-31 15:07:45 +08:00
tao.chen f288c90d37 refactor: remove local fs, add config class to common pacakge 2026-07-31 12:46:31 +08:00
tao.chen 62c7d7465e Merge branch 'optimize-by-taochen' into develop
# Conflicts:
#	.env.example
#	backend/src/backend/main.py
#	common/src/common/db/models.py
#	common/src/common/eventing.py
#	docker-compose.yml
#	runtime/Dockerfile
#	runtime/pyproject.toml
#	runtime/src/runtime/main.py
#	schedule/src/schedule/main.py
#	schedule/src/schedule/service.py
2026-07-31 09:29:03 +08:00
tao.chen c32e6e4cae Merge branch 'refactor/remove-redis' into develop
# Conflicts:
#	.env.example
#	CLAUDE.md
#	backend/Dockerfile
#	backend/pyproject.toml
#	backend/src/backend/main.py
#	backend/src/backend/schedule_runs.py
#	common/src/common/db/models.py
#	common/src/common/eventing.py
#	contracts/README.md
#	contracts/demo-core-v1.md
#	contracts/events/README.md
#	contracts/events/event-envelope-v1.json
#	contracts/locks/README.md
#	contracts/locks/file-edit-lock-v1.md
#	contracts/schedules/schedule-definition-api-v1.md
#	docker-compose.yml
#	frontend/README.md
#	migrations/README.md
#	migrations/versions/20260724_0001_v1_schema_baseline.py
#	runtime/Dockerfile
#	runtime/README.md
#	runtime/pyproject.toml
#	runtime/src/runtime/main.py
#	schedule/Dockerfile
#	schedule/README.md
#	schedule/pyproject.toml
#	schedule/src/schedule/main.py
#	schedule/src/schedule/service.py
2026-07-30 20:14:53 +08:00
Winnie c74b2abb48 重构模型平台前后端并移除Redis依赖 2026-07-30 19:03:00 +08:00
tao.chen c1e15758a3 refactor 2026-07-30 18:57:18 +08:00
Winnie 6d6c70cea8 refactor: integrate model platform backend 2026-07-30 13:43:29 +08:00
tao.chen 233dc90efe feat: add schedule package 2026-07-29 13:35:32 +08:00
tao.chen 128aa7563f feat: deploy demo test 2026-07-28 13:57:54 +08:00
tao.chen ab731bdc3b feat: add nginx, proxy to jupyter after auth 2026-07-27 19:58:17 +08:00
tao.chen 1c03a32298 update: add common 2026-07-27 15:37:58 +08:00
tao.chen e56bf0e56b init 2026-07-27 15:04:31 +08:00