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

Method deploy

supervisor/src/supervisor.rs:54–73  ·  view source on GitHub ↗
(&self, config: ProcessConfig)

Source from the content-addressed store, hash-verified

52 }
53
54 pub fn deploy(&self, config: ProcessConfig) -> Result<()> {
55 if self.freezed() {
56 bail!("Supervisor is freezed");
57 }
58 let id = config.id.clone();
59 if id.is_empty() {
60 return Err(anyhow::anyhow!("Process ID is empty"));
61 }
62 if self
63 .info(&id)
64 .is_some_and(|info| info.state.status.is_running())
65 {
66 bail!("Process is already running");
67 }
68 let process = Process::new(config);
69 process.start()?;
70 info!("Deployed process {id}");
71 self.processes.insert(id, process);
72 Ok(())
73 }
74
75 pub fn start(&self, id: &str) -> Result<()> {
76 let process = self.processes.get(id).context("Process not found")?;

Callers 1

deployFunction · 0.45

Calls 6

freezedMethod · 0.80
cloneMethod · 0.80
is_runningMethod · 0.80
is_emptyMethod · 0.45
infoMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected