Skip to content

Commit 1636f89

Browse files
authored
doc: add note for building image (#275)
1 parent 0c185c2 commit 1636f89

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Persistent storage
3+
sidebar_position: 4
4+
---
5+
6+
EigenCompute provides a persistent storage volume that survives application upgrades. The boot disk is replaced during image updates, but user data lives on an independent persistent disk that is reattached to the new VM. This means your workload state persists across upgrades, not just reboots.
7+
8+
## Storage path
9+
10+
All persistent data should be written to:
11+
12+
```
13+
/mnt/disks/userdata
14+
```
15+
16+
This path is also available via the environment variable `USER_PERSISTENT_DATA_PATH`:
17+
18+
```bash
19+
echo $USER_PERSISTENT_DATA_PATH
20+
# /mnt/disks/userdata
21+
```
22+
23+
Use this environment variable in your application code to stay forward-compatible if the mount path ever changes.
24+
25+
## Example usage
26+
27+
Write any data you need to persist (databases, configuration, caches) under the persistent storage path:
28+
29+
```python
30+
import os
31+
32+
data_dir = os.environ.get("USER_PERSISTENT_DATA_PATH", "/mnt/disks/userdata")
33+
34+
# Store a SQLite database
35+
db_path = os.path.join(data_dir, "myapp.db")
36+
37+
# Store application state
38+
state_path = os.path.join(data_dir, "state.json")
39+
```
40+
41+
```go
42+
dataDir := os.Getenv("USER_PERSISTENT_DATA_PATH")
43+
if dataDir == "" {
44+
dataDir = "/mnt/disks/userdata"
45+
}
46+
dbPath := filepath.Join(dataDir, "myapp.db")
47+
```
48+
49+
## How it works
50+
51+
The persistent storage volume is encrypted and managed automatically by the platform:
52+
53+
- **With a secondary disk attached** — The volume uses a LUKS-encrypted disk that is formatted on first boot and reopened on subsequent boots.
54+
- **Without a secondary disk** — The platform falls back to a directory on the boot disk that is already encrypted by the platform.
55+
56+
In both cases, the data is available at the same `/mnt/disks/userdata` path and your application code does not need to change.
57+
58+
For more details, see the [Persistent Storage Design Spec](https://github.com/Layr-Labs/go-tpm-tools/blob/main/specs/design-persistent-storage.md).

docs/eigencompute/howto/build/verifiable-builds/build-from-verifiable-source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Build from verifiable source
33
sidebar_position: 1
44
---
55

6+
> Importantly, if you intend to persist application data across upgrades, instruct the source to save the data at the filesystem path /mnt/disks/userdata, which has been mounted to persistent storage. For more details, see [spec](https://github.com/Layr-Labs/go-tpm-tools/blob/main/specs/design-persistent-storage.md#35-shared-mount-point-for-both-modes). This path is also available as the environment variable USER_PERSISTENT_DATA_PATH, which is injected into the container.
7+
68
To build from a verifiable source, options are:
79

810
1. Use the `ecloud compute build submit` command to submit a verifiable build from a GitHub source.

0 commit comments

Comments
 (0)