mirror of
https://github.com/exo-explore/exo.git
synced 2025-12-23 22:27:50 -05:00
Co-authored-by: Gelu Vrabie <gelu@exolabs.net> Co-authored-by: Alex Cheema <41707476+AlexCheema@users.noreply.github.com> Co-authored-by: Seth Howes <71157822+sethhowes@users.noreply.github.com> Co-authored-by: Matt Beton <matthew.beton@gmail.com> Co-authored-by: Alex Cheema <alexcheema123@gmail.com>
36 lines
993 B
Python
36 lines
993 B
Python
from copy import deepcopy
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from shared.types.common import Host
|
|
from shared.types.events import (
|
|
InstanceId,
|
|
RunnerStatusUpdated,
|
|
)
|
|
from shared.types.worker.common import RunnerId
|
|
from shared.types.worker.runners import (
|
|
RunnerStatus,
|
|
)
|
|
from shared.types.worker.shards import ShardMetadata
|
|
from worker.runner.runner_supervisor import RunnerSupervisor
|
|
|
|
|
|
class AssignedRunner(BaseModel):
|
|
runner_id: RunnerId
|
|
instance_id: InstanceId
|
|
shard_metadata: ShardMetadata # just data
|
|
hosts: list[Host]
|
|
|
|
status: RunnerStatus
|
|
failures: list[tuple[float, Exception]] = []
|
|
runner: Optional[RunnerSupervisor] # set if the runner is 'up'
|
|
|
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
|
|
def status_update_event(self) -> RunnerStatusUpdated:
|
|
return RunnerStatusUpdated(
|
|
runner_id=self.runner_id,
|
|
runner_status=deepcopy(self.status),
|
|
)
|