@@ -110,8 +110,7 @@ fn runtime_config() -> DockerDriverRuntimeConfig {
110110 key : PathBuf :: from ( "/tmp/tls.key" ) ,
111111 } ) ,
112112 daemon_version : "28.0.0" . to_string ( ) ,
113- supports_gpu : false ,
114- allow_all_default_gpu : false ,
113+ gpu : DockerGpuRuntimeConfig :: default ( ) ,
115114 sandbox_pids_limit : DEFAULT_SANDBOX_PIDS_LIMIT ,
116115 enable_bind_mounts : false ,
117116 }
@@ -178,7 +177,7 @@ impl SupervisorReadiness for DisconnectedSupervisorReadiness {
178177}
179178
180179fn test_driver_with_config ( config : DockerDriverRuntimeConfig ) -> DockerComputeDriver {
181- let allow_all_default_gpu = config. allow_all_default_gpu ;
180+ let allow_all_default_gpu = config. gpu . allow_all_default ;
182181 DockerComputeDriver {
183182 docker : Arc :: new (
184183 Docker :: connect_with_http ( "http://127.0.0.1:2375" , 1 , bollard:: API_DEFAULT_VERSION )
@@ -1270,7 +1269,7 @@ fn validate_sandbox_rejects_unknown_driver_config_fields() {
12701269#[ test]
12711270fn validate_sandbox_accepts_gpu_count_request_shape ( ) {
12721271 let mut config = runtime_config ( ) ;
1273- config. supports_gpu = true ;
1272+ config. gpu . supports_gpu = true ;
12741273 let mut sandbox = test_sandbox ( ) ;
12751274 sandbox. spec . as_mut ( ) . unwrap ( ) . resource_requirements = Some ( gpu_resources ( Some ( 2 ) ) ) ;
12761275
@@ -1281,7 +1280,7 @@ fn validate_sandbox_accepts_gpu_count_request_shape() {
12811280#[ test]
12821281fn validate_sandbox_accepts_gpu_count_matching_cdi_devices ( ) {
12831282 let mut config = runtime_config ( ) ;
1284- config. supports_gpu = true ;
1283+ config. gpu . supports_gpu = true ;
12851284 let mut sandbox = test_sandbox ( ) ;
12861285 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
12871286 spec. resource_requirements = Some ( gpu_resources ( Some ( 2 ) ) ) ;
@@ -1297,7 +1296,7 @@ fn validate_sandbox_accepts_gpu_count_matching_cdi_devices() {
12971296#[ test]
12981297fn validate_sandbox_accepts_single_cdi_device_without_gpu_count ( ) {
12991298 let mut config = runtime_config ( ) ;
1300- config. supports_gpu = true ;
1299+ config. gpu . supports_gpu = true ;
13011300 let mut sandbox = test_sandbox ( ) ;
13021301 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
13031302 spec. resource_requirements = Some ( gpu_resources ( None ) ) ;
@@ -1310,7 +1309,7 @@ fn validate_sandbox_accepts_single_cdi_device_without_gpu_count() {
13101309#[ test]
13111310fn validate_sandbox_rejects_multiple_cdi_devices_without_gpu_count ( ) {
13121311 let mut config = runtime_config ( ) ;
1313- config. supports_gpu = true ;
1312+ config. gpu . supports_gpu = true ;
13141313 let mut sandbox = test_sandbox ( ) ;
13151314 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
13161315 spec. resource_requirements = Some ( gpu_resources ( None ) ) ;
@@ -1331,7 +1330,7 @@ fn validate_sandbox_rejects_multiple_cdi_devices_without_gpu_count() {
13311330#[ test]
13321331fn validate_sandbox_rejects_cdi_devices_without_gpu_request ( ) {
13331332 let mut config = runtime_config ( ) ;
1334- config. supports_gpu = true ;
1333+ config. gpu . supports_gpu = true ;
13351334 let mut sandbox = test_sandbox ( ) ;
13361335 sandbox
13371336 . spec
@@ -1351,7 +1350,7 @@ fn validate_sandbox_rejects_cdi_devices_without_gpu_request() {
13511350#[ test]
13521351fn validate_sandbox_rejects_gpu_count_mismatched_cdi_devices ( ) {
13531352 let mut config = runtime_config ( ) ;
1354- config. supports_gpu = true ;
1353+ config. gpu . supports_gpu = true ;
13551354 let mut sandbox = test_sandbox ( ) ;
13561355 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
13571356 spec. resource_requirements = Some ( gpu_resources ( Some ( 2 ) ) ) ;
@@ -1407,7 +1406,7 @@ fn validate_sandbox_auth_accepts_gateway_token() {
14071406#[ test]
14081407fn build_container_create_body_maps_default_gpu_to_selected_cdi_device ( ) {
14091408 let mut config = runtime_config ( ) ;
1410- config. supports_gpu = true ;
1409+ config. gpu . supports_gpu = true ;
14111410 let mut sandbox = test_sandbox ( ) ;
14121411 sandbox. spec . as_mut ( ) . unwrap ( ) . resource_requirements = Some ( gpu_resources ( None ) ) ;
14131412
@@ -1437,7 +1436,7 @@ fn build_container_create_body_maps_default_gpu_to_selected_cdi_device() {
14371436#[ test]
14381437fn build_container_create_body_omits_devices_without_resolved_default_cdi_devices ( ) {
14391438 let mut config = runtime_config ( ) ;
1440- config. supports_gpu = true ;
1439+ config. gpu . supports_gpu = true ;
14411440 let mut sandbox = test_sandbox ( ) ;
14421441 sandbox. spec . as_mut ( ) . unwrap ( ) . resource_requirements = Some ( gpu_resources ( None ) ) ;
14431442
@@ -1455,7 +1454,7 @@ fn build_container_create_body_omits_devices_without_resolved_default_cdi_device
14551454#[ test]
14561455fn build_container_create_body_passes_explicit_cdi_device_id_through ( ) {
14571456 let mut config = runtime_config ( ) ;
1458- config. supports_gpu = true ;
1457+ config. gpu . supports_gpu = true ;
14591458 let mut sandbox = test_sandbox ( ) ;
14601459 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
14611460 spec. resource_requirements = Some ( gpu_resources ( None ) ) ;
@@ -1479,7 +1478,7 @@ fn build_container_create_body_passes_explicit_cdi_device_id_through() {
14791478#[ test]
14801479fn build_container_create_body_rejects_gpu_count_mismatched_cdi_devices ( ) {
14811480 let mut config = runtime_config ( ) ;
1482- config. supports_gpu = true ;
1481+ config. gpu . supports_gpu = true ;
14831482 let mut sandbox = test_sandbox ( ) ;
14841483 let spec = sandbox. spec . as_mut ( ) . unwrap ( ) ;
14851484 spec. resource_requirements = Some ( gpu_resources ( Some ( 2 ) ) ) ;
@@ -1526,7 +1525,7 @@ fn build_container_create_body_rejects_empty_cdi_devices() {
15261525#[ test]
15271526fn driver_default_gpu_selection_consumes_distinct_devices_for_creates ( ) {
15281527 let mut config = runtime_config ( ) ;
1529- config. supports_gpu = true ;
1528+ config. gpu . supports_gpu = true ;
15301529 let driver = test_driver_with_config ( config) ;
15311530 driver. gpu_selector . refresh (
15321531 CdiGpuInventory :: new ( [ "nvidia.com/gpu=0" , "nvidia.com/gpu=1" ] ) ,
0 commit comments