MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / load

Method load

dstack-util/src/system_setup.rs:271–289  ·  view source on GitHub ↗
(host_shared_dir: impl Into<HostShareDir>)

Source from the content-addressed store, hash-verified

269 }
270
271 fn load(host_shared_dir: impl Into<HostShareDir>) -> Result<Self> {
272 let host_shared_dir = host_shared_dir.into();
273 let sys_config = deserialize_json_file(host_shared_dir.sys_config_file())?;
274 let app_compose = deserialize_json_file(host_shared_dir.app_compose_file())?;
275 let instance_info_file = host_shared_dir.instance_info_file();
276 let instance_info = if instance_info_file.exists() {
277 deserialize_json_file(instance_info_file)?
278 } else {
279 InstanceInfo::default()
280 };
281 let encrypted_env = fs::read(host_shared_dir.encrypted_env_file()).unwrap_or_default();
282 Ok(Self {
283 dir: host_shared_dir.clone(),
284 sys_config,
285 app_compose,
286 encrypted_env,
287 instance_info,
288 })
289 }
290
291 fn copy(host_shared_dir: &Path, host_shared_copy_dir: &Path) -> Result<HostShared> {
292 const SZ_1KB: u64 = 1024;

Callers

nothing calls this directly

Calls 7

deserialize_json_fileFunction · 0.85
sys_config_fileMethod · 0.80
app_compose_fileMethod · 0.80
instance_info_fileMethod · 0.80
encrypted_env_fileMethod · 0.80
cloneMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected