Skip to content
Draft
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Deploy the namespace, worker pool, and API service:
```bash
export GOOGLE_CLOUD_PROJECT=$(gcloud config get-value project)
ate-env manifest \
--api-image gcr.io/$GOOGLE_CLOUD_PROJECT/ate-env-api@sha256:0952ad3fa121597c5ff2943b701f6f0968ba51fdd93b0985d1e831d7cad804a4 \
--worker-image gcr.io/$GOOGLE_CLOUD_PROJECT/ateom-gvisor-715889664656de67e44382a8d6ab981d@sha256:0e69688125a167ffd62ab084a9ab1a50e3f06e9107b36dcb01c3fb3ac0b23fcb | kubectl apply -f -
--api-image gcr.io/$GOOGLE_CLOUD_PROJECT/ate-env-api@sha256:b3dcf23bedef13fa5478b5a5e1753ef48eb9fad00c7577a1ff51242be28ca1cc \
--worker-image gcr.io/$GOOGLE_CLOUD_PROJECT/ate-images/ateom-gvisor-715889664656de67e44382a8d6ab981d@sha256:9aaf0729e2fc85976936ad68a75399184d0e846f95a203a805fa00409c40c792 | kubectl apply -f -

# Ensure that the pods are running:
kubectl get pods -n ate-env
Expand All @@ -61,7 +61,7 @@ Substrate manages ActorTemplates directly in its control plane rather than Kuber

```bash
ate-env manifest template \
--guest-image gcr.io/$GOOGLE_CLOUD_PROJECT/ate-env-guest@sha256:47f18ee80fbdc4aa86ca7bccb78c37add6314ca278b38b88641eb49757921b73 \
--guest-image gcr.io/$GOOGLE_CLOUD_PROJECT/ate-env-guest@sha256:d9ea8650c2d6706cc3e44722a23702cbba0942eca2b10d2e7cebff49d7e5f344 \
--snapshots-bucket gs://$GOOGLE_CLOUD_PROJECT/ate-env/ | kubectl-ate create actor-template -f -
```

Expand Down
19 changes: 16 additions & 3 deletions cmd/ate-env/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ func prune(v any) any {
switch val := v.(type) {
case map[string]any:
for k, child := range val {
if k == "durableDir" || k == "durable_dir" {
continue
}
cleaned := prune(child)
if cleaned == nil {
delete(val, k)
Expand All @@ -232,9 +235,6 @@ func prune(v any) any {
}
val[k] = cleaned
}
if len(val) == 0 {
return nil
}
return val
case []any:
for i, elem := range val {
Expand Down Expand Up @@ -294,9 +294,22 @@ func buildActorTemplate(cfg templateConfig) *ateapipb.ActorTemplate {
Port: 80,
},
},
VolumeMounts: []*ateapipb.VolumeMount{{
Name: "workspace",
MountPath: "/workspace",
}},
}},
Volumes: []*ateapipb.Volume{{
Name: "workspace",
DurableDir: &ateapipb.DurableDirVolumeSource{},
}},
SnapshotsConfig: &ateapipb.SnapshotsConfig{
StorageLocation: cfg.snapshotsBucket,
OnPause: ateapipb.SnapshotContentScope_SNAPSHOT_CONTENT_SCOPE_DATA,
OnCommit: ateapipb.SnapshotContentScope_SNAPSHOT_CONTENT_SCOPE_DATA,
OnResume: &ateapipb.OnResumeConfig{
FromData: ateapipb.ResumeSource_RESUME_SOURCE_GOLDEN,
},
},
SandboxConfig: &ateapipb.SandboxConfig{
SandboxClass: ateapipb.SandboxClass_SANDBOX_CLASS_GVISOR,
Expand Down
17 changes: 13 additions & 4 deletions cmd/ate-env/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,20 @@ func TestWriteActorTemplate(t *testing.T) {
if strings.Contains(out, "pauseImage") {
t.Errorf("output should not contain pauseImage field:\n%s", out)
}
if strings.Contains(out, "onResume") {
t.Errorf("output should not contain empty onResume field:\n%s", out)
if !strings.Contains(out, "onResume") || !strings.Contains(out, "RESUME_SOURCE_GOLDEN") {
t.Errorf("output missing onResume with RESUME_SOURCE_GOLDEN:\n%s", out)
}
if strings.Contains(out, "{}") {
t.Errorf("output should not contain empty map literals ({}):\n%s", out)
if !strings.Contains(out, "onPause: SNAPSHOT_CONTENT_SCOPE_DATA") {
t.Errorf("output missing onPause: SNAPSHOT_CONTENT_SCOPE_DATA:\n%s", out)
}
if !strings.Contains(out, "onCommit: SNAPSHOT_CONTENT_SCOPE_DATA") {
t.Errorf("output missing onCommit: SNAPSHOT_CONTENT_SCOPE_DATA:\n%s", out)
}
if !strings.Contains(out, "mountPath: /workspace") {
t.Errorf("output missing mountPath: /workspace:\n%s", out)
}
if !strings.Contains(out, "durableDir: {}") && !strings.Contains(out, "durableDir:") {
t.Errorf("output missing durableDir:\n%s", out)
}
}

Expand Down