-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move docker build
from build script to xtask
#2127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that we don't run cargo xtask test-docker
anywhere in CI (unless I missed it). Maybe if test-docker
were broken out into two subcommands, one for building the container images and one that uses them in a test, then the former could be used in the janus_interop_docker
job and the latter could be used in janus_build
?
Or if we ran cargo xtask test-docker
in janus_build
after loading the Docker images tarball emitted by janus_interop_docker
, would docker buildx bake
swiftly notice that the images it wants to build are already present in the local repository and move on, or would it insist on rebuilding them?
.github/workflows/ci-build.yml
Outdated
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will upload the three docker images, which are 40ish MB apiece, on every PR build. I'm concerned about our utilization of artifacts storage. The GitHub docs discuss a 90 day default retention period for artifacts, but nothing about a maximum on storage. Maybe we should go ahead with this and see if we start getting angry emails about using up our storage quota?
Or maybe we should preemptively tighten the retention period down to maybe 1 day, since we expect the artifacts emitted by this job to be immediately consumed by the test job.
integration_tests/tests/daphne.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems easier to put #[cfg(feature = "testcontainer")]
at the module level, since I don't think we ever intend to support testing Daphne outside of a container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one test, janus_in_process_daphne
, that can be run using an in-process Janus leader and a Daphne helper in a container. It's disabled for the time being until we can upgrade Daphne, but I'd like to keep it available with default features.
interop_binaries/build.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🙌🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still wary of moving tests out of the default cargo test
workflow -- folks, especially newer contributors, are likely to encounter mysterious failures in CI that they didn't see locally because they didn't run the tests locally. But let's see how it goes; we can always point folks at the README.
6dac275
to
e19d422
Compare
I added separate subcommands for just building container images and just running tests. I changed the CI to use Getting rid of artifacts uploads/downloads and relying on layer caching might work, plus keeping the |
77d38fd
to
3ee9b00
Compare
3ee9b00
to
bee40cb
Compare
This closes #2081, removing the build script that was calling
docker build
. A newxtask
package is added, and its executable is aliased to run as a cargo subcommand. Now,cargo xtask test-docker
will invokedocker buildx bake
to build the same images, and pass the image IDs through environment variables tocargo test
, rather than including image contents in the source. All tests that depend on the container images are put behind thetestcontainer
feature flag. Testing in CI invokescargo test
with thetestcontainer
feature viacargo xtask test-docker-with-images
instead, using images loaded from a preceding CI job.