Source: Dreamverse repo at will/integrate-public-fastvideo @ ec8ef92.
Cross-repo move; original history retained in archived Dreamverse repo.
Per .agents/memory/dreamverse-integration/integration-plan.md Phase 2.
* PRODUCT files moved to apps/dreamverse/server/: main.py, config.py,
video_generation.py, session/controller.py, session/messages.py,
routes/presets.py + 5 product test files + product prompts.
* GENERIC-PENDING shims carried (replaced in Phase 4/5): runtime.py,
utils.py, prompt_safety.py, rewrite_prompt_payload.py,
routes/health.py, prompt_enhancer.py.
* Imports rewritten: gpu_pool/worker_ipc/session_init_image/session_logger
now import from fastvideo.entrypoints.streaming.* public modules.
* Public streaming compatibility aliases added for the migrated product
controller: GPUSlot/get_available_gpus, MediaChunk/MediaComplete,
cleanup_session_init_image, and SessionEventLogger.
* Path rewrites: _APP_ROOT/"apps"/"web" -> _APP_ROOT/"web" in config.py.
* GPU marker: test_realtime_stress.py and test_session_logging.py
marked @pytest.mark.gpu (skip-by-default in CI).
* New: apps/dreamverse/server/tests/test_import_contract.py — AST gate
forbidding fastvideo.{pipelines,models,layers,worker,fastvideo_args}.
Generic-merged files NOT copied (already on public FastVideo):
gpu_pool.py, av_streaming.py, worker_ipc.py, mock_server.py,
session_init_image.py, session_logger.py.
Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
23 lines
908 B
Python
23 lines
908 B
Python
"""Runtime service singletons.
|
|
|
|
Assigned by ``main.lifespan`` at server startup and read by routes and the
|
|
session controller via attribute access (``runtime.gpu_pool``). Do NOT import
|
|
these names directly (``from runtime import gpu_pool``) — ``from``-import
|
|
copies the current binding, freezing it at ``None`` before lifespan runs.
|
|
"""
|
|
# pyright: reportMissingImports=false
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from fastvideo.entrypoints.streaming.gpu_pool import GpuPool as GPUPool
|
|
from fastvideo.entrypoints.streaming.session_logger import SessionEventLogger
|
|
from prompt_enhancer import PromptEnhancer
|
|
from prompt_safety import PromptSafetyFilter
|
|
|
|
gpu_pool: GPUPool | None = None
|
|
prompt_enhancer: PromptEnhancer | None = None
|
|
session_event_logger: SessionEventLogger | None = None
|
|
prompt_safety_filter: PromptSafetyFilter | None = None
|