← Về thư mục
openai4s/orchestration/session.py
- RemoteSessionIsolationRequired · class · L98-L109 — class RemoteSessionIsolationRequired(RuntimeError)
- init · method · L101-L109 — def init(self, backend: str) -> None
- _session_credentials_are_isolated · function · L112-L120 — def _session_credentials_are_isolated( check: Callable[[str], bool], backend: str ) -> bool
- SessionReadiness · class · L124-L194 — class SessionReadiness
- ready · method · L146-L153 — def ready(self) -> bool
- gang_complete · method · L156-L169 — def gang_complete(self) -> bool
- blocked_on · method · L172-L182 — def blocked_on(self) -> str | None
- public · method · L184-L194 — def public(self) -> dict[str, Any]
- SessionRuntime · class · L198-L220 — class SessionRuntime
- public · method · L214-L220 — def public(self) -> dict[str, Any]
- worker_launch_command · function · L223-L232 — def worker_launch_command(*, python: str | None = None) -> tuple[str, ...]
- AttemptPreparer · class · L235-L352 — class AttemptPreparer
- init · method · L244-L263 — def init( self, *, authority: BootstrapAuthority, listen_address: Callable[[], tuple[str, int] | None], runtime_dir: Callable[[Workload], Path], python: str | None = None, credential_ttl_s: int = CREDENTIAL_TTL_S, advertise_host: str | None = None, session_credentials_isolated: Callable[[str], bool] | None = None, ) -> None
- call · method · L265-L352 — def call(self, workload: Workload, allocation: Allocation) -> WorkloadSpec
- _default_advertise_host · function · L355-L361 — def _default_advertise_host() -> str
- _registration_alive · function · L364-L379 — def _registration_alive(registration: Any) -> bool
- _close_registrations · function · L382-L394 — def _close_registrations(registrations: list[Any]) -> None
- ComputeSessionManager · class · L397-L958 — class ComputeSessionManager
- init · method · L405-L445 — def init( self, *, store: Any, gateway: Any, authority: BootstrapAuthority, workspace_root: Path | str, kernel_factory: Callable[[Any], Any] | None = None, idle_ttl_s: int = DEFAULT_IDLE_TTL_S, max_lifetime_s: int = DEFAULT_MAX_LIFETIME_S, on_event: Callable[[str, dict], None] | None = None, session_credentials_isolated: Callable[[str], bool] | None = None, ) -> None
- workspace_for · method · L449-L450 — def workspace_for(self, workload_id: str) -> Path
- ensure_workspace · method · L452-L455 — def ensure_workspace(self, workload_id: str) -> Path
- runtime_dir · method · L457-L466 — def runtime_dir(self, workload: Workload) -> Path
- request_session · method · L470-L557 — def request_session( self, *, session_id: str, owner_user_id: str, profile: ResourceProfile, project_id: str | None = None, # No default: naming one here would name a resource plane in the # orchestration core, which is the whole of what INV-2 forbids. # Which plane runs a session is the composition layer's decision. backend: str, environment: dict[str, str] | None = None, recovery: RecoveryStrategy | str = RecoveryStrategy.WORKSPACE_ONLY, ) -> Workload
- readiness · method · L559-L595 — def readiness(self, session_id: str) -> SessionReadiness
- attach_worker · method · L597-L699 — def attach_worker(self, session_id: str, *, timeout_s: float = 60.0) -> bool
- discard_unbound_registration · method · L701-L717 — def discard_unbound_registration(self, session_id: str) -> None
- discard_dead_registration · method · L719-L742 — def discard_dead_registration(self, session_id: str) -> None
- note_state_lost · method · L744-L776 — def note_state_lost(self, workload_id: str, *, epoch: int) -> None
- touch · method · L778-L784 — def touch(self, session_id: str) -> bool
- release · method · L786-L845 — def release( self, session_id: str, *, reason: Any, expected_workload_id: str | None = None, ) -> bool
- bind_kernel · method · L847-L901 — def bind_kernel( self, session_id: str, kernel: Any, *, expected_workload_id: str | None = None, expected_epoch: int | None = None, expected_transport: Any = None, ) -> bool
- kernel_binding_guard · method · L904-L948 — def kernel_binding_guard( self, session_id: str, *, expected_workload_id: str, expected_epoch: int, expected_transport: Any, )
- runtime · method · L950-L952 — def runtime(self, session_id: str) -> SessionRuntime | None
- _emit · method · L954-L958 — def _emit(self, kind: str, payload: dict) -> None