@@ -4,7 +4,7 @@ use std::collections::{HashMap, HashSet, VecDeque};
44use std:: path:: PathBuf ;
55use std:: sync:: Arc ;
66
7- use nativelink_config:: warm_worker_pools:: IsolationStrategy ;
7+ use nativelink_config:: warm_worker_pools:: { IsolationStrategy , WarmWorkerPoolsConfig } ;
88use nativelink_error:: { Code , Error , ResultExt , make_err} ;
99use nativelink_metric:: MetricsComponent ;
1010use nativelink_util:: action_messages:: WorkerId ;
@@ -14,7 +14,6 @@ use uuid::Uuid;
1414
1515use crate :: cache:: CachePrimingAgent ;
1616use crate :: config:: WorkerPoolConfig ;
17- use nativelink_config:: warm_worker_pools:: WarmWorkerPoolsConfig ;
1817use crate :: cri_client:: {
1918 ContainerConfig , ContainerMetadata , CriClient , ImageSpec , KeyValue , LinuxContainerConfig ,
2019 LinuxContainerResources , LinuxPodSandboxConfig , LinuxSandboxSecurityContext , NamespaceOptions ,
@@ -83,7 +82,11 @@ impl WarmWorkerPoolManager {
8382 ///
8483 /// If the pool has isolation enabled, this will create an ephemeral COW clone
8584 /// of a warm template. Otherwise, it falls back to regular acquisition.
86- pub async fn acquire_isolated ( & self , pool : & str , job_id : & str ) -> Result < WarmWorkerLease , Error > {
85+ pub async fn acquire_isolated (
86+ & self ,
87+ pool : & str ,
88+ job_id : & str ,
89+ ) -> Result < WarmWorkerLease , Error > {
8790 let worker_pool = self
8891 . pools
8992 . get ( pool)
@@ -159,7 +162,8 @@ impl WorkerPool {
159162 let template = self . get_or_create_template ( ) . await ?;
160163
161164 // Create isolated clone
162- self . clone_from_template ( & template, job_id, isolation_config) . await
165+ self . clone_from_template ( & template, job_id, isolation_config)
166+ . await
163167 }
164168
165169 /// Gets the existing template or creates a new one.
@@ -261,11 +265,7 @@ impl WorkerPool {
261265 job_id : & str ,
262266 isolation_config : & nativelink_config:: warm_worker_pools:: IsolationConfig ,
263267 ) -> Result < WarmWorkerLease , Error > {
264- let worker_id = WorkerId ( format ! (
265- "crio:{}:isolated:{}" ,
266- self . config. name,
267- job_id
268- ) ) ;
268+ let worker_id = WorkerId ( format ! ( "crio:{}:isolated:{}" , self . config. name, job_id) ) ;
269269
270270 // Create OverlayFS mount structure
271271 let mount = OverlayFsMount :: new (
@@ -305,7 +305,12 @@ impl WorkerPool {
305305 . runtime
306306 . create_container ( & sandbox_id, & container_config, & sandbox_config)
307307 . await
308- . err_tip ( || format ! ( "while creating container for isolated worker {}" , worker_id. 0 ) ) ?;
308+ . err_tip ( || {
309+ format ! (
310+ "while creating container for isolated worker {}" ,
311+ worker_id. 0
312+ )
313+ } ) ?;
309314
310315 self . runtime
311316 . start_container ( & container_id)
@@ -844,7 +849,13 @@ impl WarmWorkerLease {
844849 // For isolated workers, we need different cleanup
845850 if let Some ( mount) = self . isolation_mount . take ( ) {
846851 self . pool
847- . release_isolated_worker ( worker_id, & self . container_id , & self . sandbox_id , mount, outcome)
852+ . release_isolated_worker (
853+ worker_id,
854+ & self . container_id ,
855+ & self . sandbox_id ,
856+ mount,
857+ outcome,
858+ )
848859 . await
849860 . err_tip ( || "while releasing isolated worker" )
850861 } else {
0 commit comments