Skip to content

test/e2e: cache pre-built Substrate images between CI runs - #521

Merged
rakyll merged 1 commit into
mainfrom
e2e
Oct 28, 2026
Merged

rakyll merged 1 commit into
mainfrom
e2e

Conversation

@rakyll

@rakyll rakyll commented Oct 27, 2026

Copy link
Copy Markdown
Member

Every E2E run compiled Substrate's images from source, even though PRs and pushes always test the same Substrate version from go.mod. Add an optional SUBSTRATE_IMAGE_CACHE_DIR to hack/setup-e2e-kind.sh. When it is set, the script starts the kind-registry container with its storage on that directory. It publishes Substrate's release image set once, tagged with git describe, and then installs those pre-built images through ATE_IMAGE_REPO/ATE_IMAGE_TAG. The ateom-gvisor reference in the WorkerPool is pinned by digest instead of going through ko. If the Substrate checkout is too old to support publish release-images or has local changes, the script logs why and builds from source as before.
In CI, the registry storage is restored from and saved to actions/cache, keyed on the Substrate version in go.mod. Before saving, the AX images are dropped and the registry is garbage-collected, so the cache holds only Substrate images. Nightly and custom substrate_ref runs still build from source.

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rakyll, nice speedup. Workflow looks good: read-only permissions, pinned actions, and the PR-scoped cache keeps fork runs from writing to what others restore. Approving. One heads-up: the cache key uses go list -m github.com/agent-substrate/substrate, and #517 renames the module to go.ate.dev/substrate. After that the key comes back empty and runs quietly fall back to building from source, so whichever lands second should update the path.

@rakyll

rakyll commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

I'll wait for #517 to be merged!

@mayawang

Copy link
Copy Markdown
Collaborator

@rakyll #517 just landed, so the cache key should now use go.ate.dev/substrate instead of github.com/agent-substrate/substrate. Otherwise go list returns nothing and the cache never gets used.

Every E2E run compiled Substrate's images from source, even though PRs
and pushes always test the same Substrate version from go.mod.
Add an optional SUBSTRATE_IMAGE_CACHE_DIR to hack/setup-e2e-kind.sh.
When it is set, the script starts the kind-registry container with its
storage on that directory. It publishes Substrate's release image set
once, tagged with `git describe`, and then installs those pre-built
images through ATE_IMAGE_REPO/ATE_IMAGE_TAG. The ateom-gvisor reference
in the WorkerPool is pinned by digest instead of going through ko.
If the Substrate checkout is too old to support `publish release-images`
or has local changes, the script logs why and builds from source as
before.

In CI, the registry storage is restored from and saved to actions/cache,
keyed on the Substrate version in go.mod. Before saving, the AX images
are dropped and the registry is garbage-collected, so the cache holds
only Substrate images. Nightly and custom substrate_ref runs still build
from source.
@rakyll

rakyll commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Updated the import path to go.ate.dev/substrate.

@rakyll
rakyll merged commit 4b7bf6f into main Oct 28, 2026
10 checks passed
@rakyll
rakyll deleted the e2e branch October 28, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants