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
Tests: new tool to build a no-history image #5486
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: edsantiago The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ephemeral COPR build failed. @containers/packit-build please check. |
tests/make-nohistory-image
Outdated
|
||
# First layer is a copy of this script | ||
# FIXME: find some way to add a label or annotation or something to indicate that | ||
cp $0 $workdir/file01 |
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 should probably be "$workdir/file1", since seq isn't zero-padding the values it produces.
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.
It is now :-)
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 don't understand what you mean here.
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.
Oh..... duh, my bad. I changed seq
to seq --format %02g
... but apparently I need to actually commit that change.
This depends on skopeo, which we're not using in the tests themselves, so that would be a new dependency if we ran this at test-time. |
Oh, good point; I should make that clear in the header comments. This is NOT going to be run in CI or tests or anything ever. It will only be run by a human, on demand, as needed. Like, today. Then, in the future, when something else is needed such as pastel-colored layers with sprinkles. The idea is to craft the image one time, like, right now (today), push it to quay, and then Since the crafted image is stored on quay, that's what I meant by label/annotation: something that can give a human being some sort of clue when running |
f5f31d3
to
e3e662a
Compare
tests/make-nohistory-image
Outdated
|
||
# Build an image config and image manifest in parallel | ||
# FIXME: find some way to create images for other arches? | ||
echo '{"architecture": "amd64", "os": "linux", "rootfs": {"type": "layers", "diff_ids": [' > config.json |
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.
To add labels, add "labels": {"key1": "value1" [, "key2": "value2" [...]]},
between "linux",
and "rootfs":
.
tests/make-nohistory-image
Outdated
# Build an image config and image manifest in parallel | ||
# FIXME: find some way to create images for other arches? | ||
echo '{"architecture": "amd64", "os": "linux", "rootfs": {"type": "layers", "diff_ids": [' > config.json | ||
echo '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "layers": [' > manifest.json |
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.
To add annotations, add "annotations": {"key1": "value1" [, "key2": "value2" [...]]},
between "application/vnd.oci.image.manifest.v1+json",
and "layers":
.
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.
Thanks I've been trying for the past few days to convert this script into something that'll make a manifest list with all the necessary arches, but it's really hurting my brain. I'll get back to it next week.
e3e662a
to
d30786a
Compare
Well, this grew WAY out of control. Not sure it's worth pursuing any more. Will revisit it tomorrow. (The good news is, |
Script crafts a custom image with multiple layers but no history; used in tests/bud.bats:bud-implicit-no-history test. Signed-off-by: Ed Santiago <santiago@redhat.com>
d30786a
to
f4e825e
Compare
I'm kind of lukewarm on this. |
I completely understand. My thinking on this is that the test script is super complicated and unmaintainable. If that test ever fails, it is likely to happen in the build-image steps and not in the make-sure-buildah-deals-with-it steps. And if that happens, the poor maintainer will spend many hours trying to figure out the build logic, then what broke, then how to fix it. My thinking is also that there could be great value in extending this script some day such that it crafts an image with other "quirks" used for testing. (IOW, in response to your second paragraph, I think it's very important to test prebuilt known-quirky images than to spend developer time maintaining the how-do-we-build-this logic). I'm not strong on it though. The image is now on quay, and it includes a copy of the script that built it, so it'll all be there if/when we need it. |
Script crafts a custom image with multiple layers but
no history; used in tests/bud.bats:bud-implicit-no-history test.
Signed-off-by: Ed Santiago santiago@redhat.com