From 13aa8b2273476099a26b08f2b45ac5c9ea45499c Mon Sep 17 00:00:00 2001 From: Jaana Dogan Date: Wed, 16 Sep 2026 23:11:56 -0700 Subject: [PATCH] Enable settings to use warm cache --- README.md | 6 +++--- cmd/ate-env/manifest.go | 19 ++++++++++++++++--- cmd/ate-env/manifest_test.go | 17 +++++++++++++---- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 67978ef..6415a4d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 - ``` diff --git a/cmd/ate-env/manifest.go b/cmd/ate-env/manifest.go index a83a04a..d678328 100644 --- a/cmd/ate-env/manifest.go +++ b/cmd/ate-env/manifest.go @@ -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) @@ -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 { @@ -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, diff --git a/cmd/ate-env/manifest_test.go b/cmd/ate-env/manifest_test.go index 42a5426..f16a321 100644 --- a/cmd/ate-env/manifest_test.go +++ b/cmd/ate-env/manifest_test.go @@ -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) } }