@@ -1109,7 +1109,6 @@ impl App {
11091109 & manifest,
11101110 & hex:: encode ( compose_hash) ,
11111111 mr_config,
1112- app_compose. key_provider ( ) ,
11131112 app_compose. requirements . as_ref ( ) ,
11141113 ) ?;
11151114 fs:: write ( shared_dir. join ( SYS_CONFIG ) , & sys_config_str)
@@ -1292,7 +1291,6 @@ pub(crate) fn make_sys_config(
12921291 manifest : & Manifest ,
12931292 compose_hash : & str ,
12941293 mr_config : Option < String > ,
1295- key_provider : dstack_types:: KeyProviderKind ,
12961294 requirements : Option < & dstack_types:: Requirements > ,
12971295) -> Result < String > {
12981296 let image_path = cfg. image . path . join ( & manifest. image ) ;
@@ -1312,13 +1310,12 @@ pub(crate) fn make_sys_config(
13121310 bail ! ( "Unsupported image version: {img_ver:?}" ) ;
13131311 }
13141312
1315- let vm_config = make_vm_config_with_key_provider (
1313+ let vm_config = make_vm_config (
13161314 cfg,
13171315 manifest,
13181316 & image,
13191317 compose_hash,
13201318 mr_config. clone ( ) ,
1321- key_provider,
13221319 requirements,
13231320 ) ?;
13241321 let mut sys_config = json ! ( {
@@ -1386,33 +1383,12 @@ fn tdx_attestation_variant_from_requirements(
13861383 } )
13871384}
13881385
1389- #[ cfg( test) ]
13901386fn make_vm_config (
1391- cfg : & Config ,
1392- manifest : & Manifest ,
1393- image : & Image ,
1394- compose_hash : & str ,
1395- mr_config : Option < String > ,
1396- requirements : Option < & dstack_types:: Requirements > ,
1397- ) -> Result < serde_json:: Value > {
1398- make_vm_config_with_key_provider (
1399- cfg,
1400- manifest,
1401- image,
1402- compose_hash,
1403- mr_config,
1404- dstack_types:: KeyProviderKind :: None ,
1405- requirements,
1406- )
1407- }
1408-
1409- fn make_vm_config_with_key_provider (
14101387 cfg : & Config ,
14111388 manifest : & Manifest ,
14121389 image : & Image ,
14131390 _compose_hash : & str ,
14141391 mr_config : Option < String > ,
1415- _key_provider : dstack_types:: KeyProviderKind ,
14161392 requirements : Option < & dstack_types:: Requirements > ,
14171393) -> Result < serde_json:: Value > {
14181394 let platform = cfg. cvm . resolved_platform ( ) ;
@@ -1516,19 +1492,12 @@ fn make_vm_config_with_key_provider(
15161492 Ok ( config)
15171493}
15181494
1519- pub ( crate ) fn simulated_platform_provides_tpm ( platform : Option < dstack_types:: TeeVariant > ) -> bool {
1520- matches ! (
1521- platform,
1522- Some ( dstack_types:: TeeVariant :: DstackGcpTdx | dstack_types:: TeeVariant :: DstackAwsNitroTpm )
1523- )
1524- }
1525-
15261495pub ( crate ) fn needs_swtpm (
15271496 key_provider : dstack_types:: KeyProviderKind ,
15281497 simulated_tee : Option < dstack_types:: TeeVariant > ,
15291498) -> bool {
15301499 matches ! ( key_provider, dstack_types:: KeyProviderKind :: Tpm )
1531- && !simulated_platform_provides_tpm ( simulated_tee)
1500+ && !simulated_tee. is_some_and ( mock_attestation :: platform_provides_tpm )
15321501}
15331502
15341503#[ cfg( test) ]
@@ -2115,14 +2084,8 @@ mod tests {
21152084 let build_hash = Sha256 :: digest ( sha256sum. as_bytes ( ) ) . to_vec ( ) ;
21162085 fs:: write ( image_dir. join ( "digest.txt" ) , hex:: encode ( & build_hash) ) ?;
21172086
2118- let sys_config_document = make_sys_config (
2119- & config,
2120- & manifest,
2121- & compose_hash,
2122- Some ( mr_config) ,
2123- dstack_types:: KeyProviderKind :: None ,
2124- None ,
2125- ) ?;
2087+ let sys_config_document =
2088+ make_sys_config ( & config, & manifest, & compose_hash, Some ( mr_config) , None ) ?;
21262089 let sys_config: serde_json:: Value = serde_json:: from_str ( & sys_config_document) ?;
21272090 assert ! ( sys_config. get( "tee_simulator" ) . is_none( ) ) ;
21282091 assert_eq ! ( sys_config[ "pccs_url" ] , config. cvm. pccs_url) ;
0 commit comments