Skip to content

Commit b8d54af

Browse files
committed
More for the rename
1 parent d6f2254 commit b8d54af

File tree

8 files changed

+15
-17
lines changed

8 files changed

+15
-17
lines changed

docs/deployment.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ GUEST_AGENT_ADDR=127.0.0.1:9205
9797
ETH_RPC_URL=https://rpc.phala.network
9898
GIT_REV=HEAD
9999
OS_IMAGE=dstack-0.5.1
100-
IMAGE_DOWNLOAD_URL=https://files.kvin.wang/images/mr_{MR_IMAGE}.tar.gz
100+
IMAGE_DOWNLOAD_URL=https://files.kvin.wang/images/mr_{OS_IMAGE_HASH}.tar.gz
101101
```
102102

103103
Then run the script again.
@@ -149,18 +149,16 @@ The KMS instance is now ready to use.
149149
## Deploy dstack-gateway in CVM
150150
dstack-gateway can be deployed as a dstack app in the same host as the KMS or in a different host.
151151

152-
### Add base image MRs to the KMS whitelist
153-
In order to run user workloads that use the KMS, the OS image MRs must be added to the KMS whitelist.
152+
### Add OS image hash to the KMS whitelist
153+
In order to run user workloads that use the KMS, the OS image hash must be added to the KMS whitelist.
154154

155-
The `mrSystem` is calculated from the MRTD, RTMR0, RTMR1, and key provider. It varies with the same image given different CPU/MEM configurations.
155+
The `os_image_hash` is generated during the image build process. It is stored in the `digest.txt` file.
156156

157-
You can calculate the `mrSystem` by running `dstack-mr` or simply try deploying an App with the OS image and see it in the serial logs.
158-
159-
After you get the `mrSystem`, you can register it to the KMS whitelist by running the following command:
157+
After you get the `os_image_hash`, you can register it to the KMS whitelist by running the following command:
160158

161159
```bash
162160
cd dstack/kms/auth-eth
163-
npx hardhat kms:add-system --network phala --mr <mr-value>
161+
npx hardhat kms:add-image --network phala --mr <os-image-hash>
164162
```
165163

166164
### Register dstack-gateway in KMS

guest-agent/rpc/proto/agent_rpc.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ message WorkerInfo {
191191
bytes device_id = 8;
192192
// MR Aggregated
193193
bytes mr_aggregated = 9;
194-
// MR Image
194+
// OS Image hash
195195
bytes os_image_hash = 10;
196196
// MR Key Provider
197197
bytes mr_key_provider = 11;

kms/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CVMs running in dstack support three boot modes:
3838
- Quote verification and boot info validation
3939
- Asks `dstack-kms-auth-eth` for permission
4040
- Builtin Replicator for root keys
41-
41+
4242
2. **dstack-kms-auth-eth**
4343
- Chain interface for permission checks
4444
- Two-step validation:
@@ -49,7 +49,7 @@ CVMs running in dstack support three boot modes:
4949
- `KmsAuth.sol`
5050
- Maintains a registry for all Applications
5151
- Maintains the allowed KMS Instance MRs
52-
- Maintains the allowed App Base Image MRs
52+
- Maintains the allowed OS Images
5353
- Registers KMS root keys
5454
- `AppAuth.sol`
5555
- Apps can have either a dedicated `AppAuth` contract or share one with multiple apps

kms/auth-eth/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function build(): Promise<FastifyInstance> {
2121
required: ['mrAggregated', 'osImageHash', 'appId', 'composeHash', 'instanceId', 'deviceId'],
2222
properties: {
2323
mrAggregated: { type: 'string', description: 'Aggregated MR measurement' },
24-
osImageHash: { type: 'string', description: 'MR Image measurement' },
24+
osImageHash: { type: 'string', description: 'OS Image hash' },
2525
appId: { type: 'string', description: 'Application ID' },
2626
composeHash: { type: 'string', description: 'Compose hash' },
2727
instanceId: { type: 'string', description: 'Instance ID' },

kms/dstack-app/deploy-to-vmm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else
3030
# GUEST_AGENT_ADDR=127.0.0.1:9205
3131
3232
# The URL of the dstack app image download URL
33-
# IMAGE_DOWNLOAD_URL=https://files.kvin.wang/images/mr_{MR_IMAGE}.tar.gz
33+
# IMAGE_DOWNLOAD_URL=https://files.kvin.wang/images/mr_{OS_IMAGE_HASH}.tar.gz
3434
3535
# The URL of the Ethereum RPC service
3636
ETH_RPC_URL=https://rpc.phala.network

kms/kms.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ subject_postfix = ".dstack"
2525
[core.image]
2626
verify = true
2727
cache_dir = "/usr/share/dstack/images"
28-
download_url = "http://localhost:8000/{MR_IMAGE}.tar.gz"
28+
download_url = "http://localhost:8000/{OS_IMAGE_HASH}.tar.gz"
2929
download_timeout = "2m"
3030

3131
[core.auth_api]

kms/rpc/proto/kms_rpc.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ message AppKeyResponse {
3333
string tproxy_app_id = 6;
3434
// Reverse proxy app ID from KmsAuth contract.
3535
string gateway_app_id = 7;
36-
// MR Image
36+
// OS Image hash
3737
bytes os_image_hash = 8;
3838
}
3939

kms/src/main_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl RpcHandler {
250250
.config
251251
.image
252252
.download_url
253-
.replace("{MR_IMAGE}", hex_os_image_hash);
253+
.replace("{OS_IMAGE_HASH}", hex_os_image_hash);
254254

255255
// Create a temporary directory for extraction within the cache directory
256256
let cache_dir = self.state.config.image.cache_dir.join("tmp");
@@ -413,7 +413,7 @@ impl RpcHandler {
413413
}
414414
self.verify_os_image_hash(&vm_config, &boot_info)
415415
.await
416-
.context("Failed to verify image MR")?;
416+
.context("Failed to verify os image hash")?;
417417
Ok(BootConfig {
418418
boot_info,
419419
gateway_app_id: response.gateway_app_id,

0 commit comments

Comments
 (0)