@@ -25,7 +25,6 @@ import {
2525} from "./workloadManager/runCrd.js" ;
2626import { RestoreWatcher , type RestoreFailure } from "./services/restoreWatcher.js" ;
2727import { DockerWorkloadManager } from "./workloadManager/docker.js" ;
28- import { ComputeWorkloadManager } from "./workloadManager/compute.js" ;
2928import {
3029 HttpServer ,
3130 CheckpointClient ,
@@ -41,12 +40,11 @@ import { FailedPodHandler } from "./services/failedPodHandler.js";
4140import { DequeueDrain } from "./services/dequeueDrain.js" ;
4241import { getWorkerToken } from "./workerToken.js" ;
4342import { mintDeploymentToken } from "./workloadToken.js" ;
44- import { OtlpTraceService } from "./services/otlpTraceService.js" ;
4543import {
4644 WarmStartVerificationService ,
4745 type WarmStartTimings ,
4846} from "./services/warmStartVerificationService.js" ;
49- import { extractTraceparent , getRestoreRunnerId } from "./util.js" ;
47+ import { extractTraceparent } from "./util.js" ;
5048import { Redis } from "ioredis" ;
5149import { BackpressureMonitor } from "./backpressure/backpressureMonitor.js" ;
5250import { RedisBackpressureSignalSource } from "./backpressure/redisBackpressureSignalSource.js" ;
@@ -101,8 +99,7 @@ class ManagedSupervisor {
10199 private readonly metricsServer ?: HttpServer ;
102100 private readonly workloadServer : WorkloadServer ;
103101 private readonly workloadManager : WorkloadManager ;
104- private readonly workloadManagerBackend : "compute" | "kubernetes" | "run-crd" | "docker" ;
105- private readonly computeManager ?: ComputeWorkloadManager ;
102+ private readonly workloadManagerBackend : "kubernetes" | "run-crd" | "docker" ;
106103 private readonly runCrdManager ?: RunCrdWorkloadManager ;
107104 private readonly restoreInformer ?: RunnerRestoreInformer ;
108105 private readonly restoreWatcher ?: RestoreWatcher ;
@@ -113,7 +110,6 @@ class ManagedSupervisor {
113110
114111 private readonly podCleaner ?: PodCleaner ;
115112 private readonly failedPodHandler ?: FailedPodHandler ;
116- private readonly tracing ?: OtlpTraceService ;
117113 private readonly backpressureMonitors : BackpressureMonitor [ ] = [ ] ;
118114 private readonly backpressureRedis ?: Redis ;
119115
@@ -135,7 +131,6 @@ class ManagedSupervisor {
135131 const {
136132 TRIGGER_WORKER_TOKEN ,
137133 MANAGED_WORKER_SECRET ,
138- COMPUTE_GATEWAY_AUTH_TOKEN ,
139134 DOCKER_REGISTRY_PASSWORD ,
140135 TRIGGER_DEQUEUE_BACKPRESSURE_REDIS_PASSWORD ,
141136 WORKLOAD_TOKEN_SECRET ,
@@ -172,48 +167,7 @@ class ManagedSupervisor {
172167 : new DockerResourceMonitor ( new Docker ( ) )
173168 : new NoopResourceMonitor ( ) ;
174169
175- if ( env . COMPUTE_GATEWAY_URL ) {
176- if ( ! env . TRIGGER_WORKLOAD_API_DOMAIN ) {
177- throw new Error ( "TRIGGER_WORKLOAD_API_DOMAIN is not set, cannot create compute manager" ) ;
178- }
179-
180- const callbackUrl = `${ env . TRIGGER_WORKLOAD_API_PROTOCOL } ://${ env . TRIGGER_WORKLOAD_API_DOMAIN } :${ env . TRIGGER_WORKLOAD_API_PORT_EXTERNAL } /api/v1/compute/snapshot-complete` ;
181-
182- if ( env . COMPUTE_TRACE_SPANS_ENABLED ) {
183- this . tracing = new OtlpTraceService ( {
184- endpointUrl : env . COMPUTE_TRACE_OTLP_ENDPOINT ,
185- } ) ;
186- }
187-
188- const computeManager = new ComputeWorkloadManager ( {
189- ...workloadManagerOptions ,
190- gateway : {
191- url : env . COMPUTE_GATEWAY_URL ,
192- authToken : env . COMPUTE_GATEWAY_AUTH_TOKEN ,
193- timeoutMs : env . COMPUTE_GATEWAY_TIMEOUT_MS ,
194- } ,
195- snapshots : {
196- enabled : env . COMPUTE_SNAPSHOTS_ENABLED ,
197- delayMs : env . COMPUTE_SNAPSHOT_DELAY_MS ,
198- dispatchLimit : env . COMPUTE_SNAPSHOT_DISPATCH_LIMIT ,
199- callbackUrl,
200- } ,
201- tracing : this . tracing ,
202- runner : {
203- instanceName : env . TRIGGER_WORKER_INSTANCE_NAME ,
204- otelEndpoint : env . OTEL_EXPORTER_OTLP_ENDPOINT ,
205- prettyLogs : env . RUNNER_PRETTY_LOGS ,
206- sendRunDebugLogs : env . SEND_RUN_DEBUG_LOGS ,
207- } ,
208- createRetry : {
209- maxAttempts : env . COMPUTE_INSTANCE_CREATE_MAX_ATTEMPTS ,
210- baseDelayMs : env . COMPUTE_INSTANCE_CREATE_RETRY_BASE_DELAY_MS ,
211- } ,
212- } ) ;
213- this . computeManager = computeManager ;
214- this . workloadManager = computeManager ;
215- this . workloadManagerBackend = "compute" ;
216- } else if ( this . isKubernetes && env . KUBERNETES_RUN_CRD_ENABLED ) {
170+ if ( this . isKubernetes && env . KUBERNETES_RUN_CRD_ENABLED ) {
217171 // Only a process that dequeues creates resumes, and only the microvm lane restores.
218172 if (
219173 env . KUBERNETES_RUNNER_RESTORE_INFORMER_ENABLED &&
@@ -522,66 +476,10 @@ class ManagedSupervisor {
522476
523477 const { checkpoint, ...rest } = message ;
524478
525- // Register trace context early so snapshot spans work for all paths
526- // (cold create, restore, warm start). Re-registration on restore is safe
527- // since dequeue always provides fresh context.
528- if ( this . computeManager ?. traceSpansEnabled && traceparent ) {
529- this . workloadServer . registerRunTraceContext ( message . run . friendlyId , {
530- traceparent,
531- envId : message . environment . id ,
532- orgId : message . organization . id ,
533- projectId : message . project . id ,
534- } ) ;
535- }
536-
537479 if ( checkpoint ) {
538480 setExtra ( fromContext ( ) , "path_taken" , "restore" ) ;
539481 this . logger . debug ( "Restoring run" , { runId : message . run . id } ) ;
540482
541- if ( this . computeManager ) {
542- const restoreStart = performance . now ( ) ;
543- try {
544- const runnerId = getRestoreRunnerId ( message . run . friendlyId , checkpoint . id ) ;
545-
546- const didRestore = await this . computeManager . restore ( {
547- snapshotId : checkpoint . location ,
548- runnerId,
549- runFriendlyId : message . run . friendlyId ,
550- snapshotFriendlyId : message . snapshot . friendlyId ,
551- machine : message . run . machine ,
552- traceContext : message . run . traceContext ,
553- envId : message . environment . id ,
554- orgId : message . organization . id ,
555- projectId : message . project . id ,
556- hasPrivateLink : message . organization . hasPrivateLink ,
557- dequeuedAt : message . dequeuedAt ,
558- } ) ;
559- recordPhaseSince ( "restore" , restoreStart , undefined ) ;
560- setExtra ( fromContext ( ) , "did_restore" , didRestore ) ;
561-
562- if ( didRestore ) {
563- this . logger . debug ( "Compute restore successful" , {
564- runId : message . run . id ,
565- runnerId,
566- } ) ;
567- } else {
568- this . logger . error ( "Compute restore failed" , {
569- runId : message . run . id ,
570- runnerId,
571- } ) ;
572- }
573- } catch ( error ) {
574- recordPhaseSince (
575- "restore" ,
576- restoreStart ,
577- error instanceof Error ? error : new Error ( String ( error ) )
578- ) ;
579- this . logger . error ( "Failed to restore run (compute)" , { error } ) ;
580- }
581-
582- return ;
583- }
584-
585483 if ( this . runCrdManager ?. restores ( checkpoint ) ) {
586484 await this . restoreRunner ( this . runCrdManager , message , checkpoint ) ;
587485 return ;
@@ -673,10 +571,7 @@ class ManagedSupervisor {
673571 host : env . TRIGGER_WORKLOAD_API_HOST_INTERNAL ,
674572 workerClient : this . workerSession . httpClient ,
675573 checkpointClient : this . checkpointClient ,
676- computeManager : this . computeManager ,
677574 runnerSnapshotter : this . runCrdManager ,
678- tracing : this . tracing ,
679- snapshotCallbackSecret : workerToken ,
680575 wideEventOpts : this . wideEventOpts ,
681576 wideEventsNoisyRoutes : this . wideEventsNoisyRoutes ,
682577 } ) ;
0 commit comments