-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
feat(oci_pull): expose the digest as a file #542
feat(oci_pull): expose the digest as a file #542
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.
Nice, do you mind also adding some usage of it in the e2e or examples, so we have some form of test coverage that we don't drop or break this in the future?
@aignas do you want to finish this PR? |
Could you please give some guidance on where the tests should go and if I am expected to bump the lock files? I would still love the feature, but if someone would like to take over and finish this PR, I am OK with that. |
This makes the external image repos also expose the digest file, similarly how the `oci_image` creates a `.digest` target. The actual name of the file can be something else and I am just putting this out to initate a discussion.
d8acbd5
to
cce6558
Compare
The tests are now passing, @thesayyn, let me know what is left to do here: $ bazel test :test_bzlmod
INFO: Analyzed target //:test_bzlmod (125 packages loaded, 11031 targets configured).
INFO: Found 1 test target...
Target //:test_bzlmod up-to-date:
bazel-bin/test_bzlmod_bats.sh
INFO: Elapsed time: 210.224s, Critical Path: 151.69s
INFO: 32 processes: 10 internal, 16 darwin-sandbox, 6 local.
INFO: Build completed successfully, 32 total actions
//:test_bzlmod PASSED in 64.0s
Executed 1 out of 1 test: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
$ bazel test :test_nobzlmod
INFO: Analyzed target //:test_nobzlmod (0 packages loaded, 1 target configured).
INFO: Found 1 test target...
Target //:test_nobzlmod up-to-date:
bazel-bin/test_nobzlmod_bats.sh
INFO: Elapsed time: 69.553s, Critical Path: 66.46s
INFO: 6 processes: 4 internal, 2 local.
INFO: Build completed successfully, 6 total actions
//:test_nobzlmod PASSED in 66.2s
Executed 1 out of 1 test: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. |
This makes the external image repos also expose the digest file, similarly how
the
oci_image
creates a.digest
target. The actual name of the file can besomething else and I am just putting this out to initiate a discussion.
Let's say a user has
@alpine
image defined viaoci_pull
, they can access thedigest of the upstream image by accessing the
@alpine//:image.digest
file.We could similarly have the platforms of the image written to a file as well,
but I am not sure if that is useful.
Having the
image.digest
in a file could be useful for various automation thatis done using
write_source_file
rule where one would use agenrule
to getthe
digest
value from the@alpine//:image.digest
target, transform it andoutput it to a file that is later synced with
write_source_file
. Not needingto depend on extra CLIs that might not be available to the user of
rules_oci
as toolchains could be good here.