diff --git a/src/codegen/runner/models/apis.py b/src/codegen/runner/models/apis.py index 2b7cb918a..9ff4c4ddf 100644 --- a/src/codegen/runner/models/apis.py +++ b/src/codegen/runner/models/apis.py @@ -25,7 +25,6 @@ class ServerInfo(BaseModel): class UtilizationMetrics(BaseModel): - container_id: str timestamp: str memory_rss_gb: float memory_vms_gb: float diff --git a/src/codegen/runner/sandbox/runner.py b/src/codegen/runner/sandbox/runner.py index 846a839ef..b3c07bf10 100644 --- a/src/codegen/runner/sandbox/runner.py +++ b/src/codegen/runner/sandbox/runner.py @@ -24,7 +24,6 @@ class SandboxRunner: """Responsible for orchestrating the lifecycle of a warmed sandbox""" # =====[ __init__ instance attributes ]===== - container_id: str repo: RepoConfig commit: GitCommit op: RemoteRepoOperator | None @@ -35,10 +34,8 @@ class SandboxRunner: def __init__( self, - container_id: str, repo_config: RepoConfig, ) -> None: - self.container_id = container_id self.repo = repo_config self.op = RemoteRepoOperator(repo_config, base_dir=repo_config.base_dir, github_type=GithubType.Github) self.commit = self.op.git_cli.head.commit diff --git a/src/codegen/runner/sandbox/server.py b/src/codegen/runner/sandbox/server.py index 2a97cd853..ebc1c618e 100644 --- a/src/codegen/runner/sandbox/server.py +++ b/src/codegen/runner/sandbox/server.py @@ -39,9 +39,9 @@ async def lifespan(server: FastAPI): try: repo_config = get_repo_config() server_info = ServerInfo(repo_name=repo_config.full_name) - logger.info(f"Starting up sandbox fastapi server for repo_id={server_info.repo_id} in container ID={server_info.container_id}") + logger.info(f"Starting up sandbox fastapi server for repo_name={server_info.repo_name}") - runner = SandboxRunner(container_id=server_info.container_id, repo_config=repo_config) + runner = SandboxRunner(repo_config=repo_config) server_info.warmup_state = WarmupState.PENDING await runner.warmup() server_info.warmup_state = WarmupState.COMPLETED @@ -82,7 +82,6 @@ async def utilization_metrics() -> UtilizationMetrics: memory_stats = get_memory_stats() return UtilizationMetrics( - container_id=os.getenv("MODAL_TASK_ID"), timestamp=datetime.now(dt.UTC).isoformat(), memory_rss_gb=memory_stats.memory_rss_gb, memory_vms_gb=memory_stats.memory_vms_gb, @@ -94,7 +93,7 @@ async def utilization_metrics() -> UtilizationMetrics: @app.post(SIGNAL_SHUTDOWN_ENDPOINT) async def signal_shutdown() -> SignalShutdownResponse: - logger.info(f"repo_id={server_info.repo_id} container ID={server_info.container_id} received signal_shutdown") + logger.info(f"repo_name={server_info.repo_name} received signal_shutdown") server_info.is_shutting_down = True return SignalShutdownResponse(is_ready_to_shutdown=not server_info.is_running_codemod) diff --git a/tests/unit/codegen/runner/sandbox/conftest.py b/tests/unit/codegen/runner/sandbox/conftest.py index a7f638834..a3125a102 100644 --- a/tests/unit/codegen/runner/sandbox/conftest.py +++ b/tests/unit/codegen/runner/sandbox/conftest.py @@ -36,7 +36,7 @@ def runner(codebase: Codebase, tmpdir): mock_init_codebase.return_value = codebase mock_op.return_value = codebase.op - yield SandboxRunner(container_id="ta-123", repo_config=codebase.op.repo_config) + yield SandboxRunner(repo_config=codebase.op.repo_config) @pytest.fixture(autouse=True)