Host: one place for the instance config; message ids are strings
This commit is contained in:
+2
-16
@@ -29,8 +29,7 @@ use serde_json::{Value, json};
|
||||
use wasmtime::component::Component;
|
||||
|
||||
use crate::broker::{Broker, SHUTDOWN_DEADLINE, shutdown_line, truncate};
|
||||
use crate::fs::Mount;
|
||||
use crate::runtime::{Instance, InstanceConfig};
|
||||
use crate::runtime::Instance;
|
||||
use crate::world;
|
||||
|
||||
const EXPECT_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
@@ -104,20 +103,7 @@ impl Candidate<'_> {
|
||||
world::copy_tree(&from, &dir.join(name))?;
|
||||
}
|
||||
}
|
||||
let cfg = InstanceConfig {
|
||||
mounts: vec![
|
||||
Mount { guest: "/actor".into(), host: self.broker.world.actors_root(), writable: false },
|
||||
Mount { guest: "/public".into(), host: dir.join("public"), writable: true },
|
||||
Mount { guest: "/data".into(), host: dir.join("data"), writable: true },
|
||||
],
|
||||
allow_http: false,
|
||||
stderr_log: dir.join("stderr.log"),
|
||||
env: vec![
|
||||
("SAUSAGE_ACTOR".into(), self.id.to_string()),
|
||||
("SAUSAGE_VERSION".into(), self.version.to_string()),
|
||||
("SAUSAGE_CANDIDATE".into(), "1".into()),
|
||||
],
|
||||
};
|
||||
let cfg = self.broker.instance_config(self.id, self.version, Some(&dir));
|
||||
Ok((self.broker.runtime.start(self.component, cfg)?, scratch))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user