Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: mpc-node

services:
mpc-node:
image: "{{IMAGE_NAME}}@{{MANIFEST_DIGEST}}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: mpc-node

services:
mpc-node:
image: "{{IMAGE_NAME}}@{{MANIFEST_DIGEST}}"
Expand Down
24 changes: 19 additions & 5 deletions crates/tee-launcher/src/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ pub fn launch_mpc_container(
let compose_file = render_compose_file(platform, port_mappings, image_name, manifest_digest)?;
let compose_path = compose_file.path().display().to_string();

// Remove any existing container from a previous run (by name, independent of compose file)
let _ = Command::new("docker")
.args(["rm", "-f", MPC_CONTAINER_NAME])
.output();

// The compose file pins a stable top-level project `name`, so the
// container is reused across restarts rather than recreated, preserving its
// logs. Compose recreates it only when the rendered config (e.g. image
// digest) changes.
let run_output = Command::new("docker")
.args(["compose", "-f", &compose_path, "up", "-d"])
.output()
Expand Down Expand Up @@ -265,4 +264,19 @@ mod tests {
// then
assert!(!rendered.contains("environment:"));
}

#[test]
fn includes_stable_project_name() {
// given
let port_mappings = empty_port_mappings();
let digest = sample_digest();

// when
let rendered = render(Platform::Tee, &port_mappings, &digest);

// then — a stable top-level project name keeps Compose reusing the
// container across restarts instead of recreating it (which would wipe
// its logs)
assert!(rendered.contains("name: mpc-node"));
}
}
4 changes: 4 additions & 0 deletions docs/running-an-mpc-node-in-tdx-external-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,10 @@ Full flag reference and `.env` field-by-field documentation:
Dstack provides a dedicated web page to view CVM information, including links to the Docker logs.
More details can be found in [Phala's guide](https://github.com/Dstack-TEE/dstack?tab=readme-ov-file#deploy-an-app).

> **Log retention:** the MPC container is reused across **restarts**, so its
> logs are preserved and remain viewable here after a restart. An **upgrade**
> (new image) recreates the container, which clears its logs.

---

#### Local Access
Expand Down
Loading