Skip to content
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: add basic zstd:chunked system test #24413

Merged

Conversation

giuseppe
Copy link
Member

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 29, 2024
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Thank you! I'm OOTO tomorrow all day so this is a very cursory first pass with some suggestions

@@ -398,6 +398,84 @@ EOF
assert "$output" =~ "--retry-delay .*pull failures \(default \"5s\"\)"
}

@test "push and pull zstd chunked image" {
iid=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z)
Copy link
Member

Choose a reason for hiding this comment

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

Could you rename this please? To me, iid refers to a sha.

And, there's a new helper in town, safename. The preferred way to do that now would be

    .../img-$(safename)

Comment on lines 438 to 439
iid2=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z)
iid3=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z)
Copy link
Member

Choose a reason for hiding this comment

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

when using safename multiple times, I've found it best to differentiate in the prefix:

    .../img2-$(safename)
    .../img3-$(safename)

$iid3

run_podman diff $iid3 $iid2
sorted_output=$(echo $output | sort)
Copy link
Member

Choose a reason for hiding this comment

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

I didn't expect this to work, and it doesn't, and for many reasons. First and most important, echo is weird in ways that one has no choice but to shrug and accept:

    echo  $multilinestring    <<<---- collapses to just one line!
    echo "$multilinestring"   <<<---- with quotes, it preserves newlines

so anyhow, the sort there is a NOP. I'm not sure what it is you're trying to check, and it's late in my day, so I'm sorry not to be able to offer a suggestion for how to solve this.

$iid3

run_podman diff $iid3 $iid2
sorted_output=$(echo $output | sort)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above re: echo and newlines and sort

test/system/150-login.bats Outdated Show resolved Hide resolved
Comment on lines 406 to 407
--cert-dir ${PODMAN_LOGIN_WORKDIR}/trusted-registry-cert-dir \
--creds ${PODMAN_LOGIN_USER}:${PODMAN_LOGIN_PASS} \
Copy link
Member

Choose a reason for hiding this comment

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

These two lines are a great candidate for refactoring into $pushpullargs or somesuch

@giuseppe giuseppe force-pushed the add-test-zstd-chunked branch 5 times, most recently from f69b757 to c69fda7 Compare October 30, 2024 10:15
@giuseppe giuseppe changed the title WIP: add basic zstd:chunked system test tests: add basic zstd:chunked system test Oct 30, 2024
@giuseppe giuseppe marked this pull request as ready for review October 30, 2024 16:36
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 30, 2024
@giuseppe
Copy link
Member Author

@edsantiago thanks for the review.

I changed the original tests, the test is just a starting point

@giuseppe giuseppe force-pushed the add-test-zstd-chunked branch 2 times, most recently from d9b1465 to b660ac5 Compare October 31, 2024 12:46
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Minor suggestions inline, and one major request: please move this out of 150-login.bats. None of this has anything to do with credential testing. Maybe a new zstd-chunked file? Or a more generic compression? I think we're going to need to add more tests to handle more subtle cases.

Many, many thanks for this. It would never have occurred to me that podman diff would be useful in some way. Your in-depth expertise is exactly what we need to write tests and develop confidence in this new feature.

run_podman push $image dir:$push_dir

run_podman inspect $image
for layer in $(jq '.[].RootFS.Layers.[] | gsub("^sha256:"; "")' <<< $output | tr -d \"); do
Copy link
Member

Choose a reason for hiding this comment

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

jq -r will emit output without doublequotes

# the checksum for the layer is already validated, but for the sake
# of the test let's check it again
run -0 sha256sum < $layer_file
assert "$output" = "$layer -" "digest mismatch for layer $layer"
Copy link
Member

Choose a reason for hiding this comment

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

suggestion for error message: include $image in the string.

test/system/150-login.bats Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the add-test-zstd-chunked branch from b660ac5 to e53f0f8 Compare October 31, 2024 14:55
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Test LGTM with one big question. I'll defer to others on the vendoring.

Comment on lines +118 to +120
# replace the image with a "podman load" from what was stored
run_podman rmi $image
run_podman load < $PODMAN_TMPDIR/image.tar
Copy link
Member

Choose a reason for hiding this comment

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

wait, doesn't this completely change what is being tested?

@giuseppe giuseppe marked this pull request as draft November 4, 2024 12:23
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2024
@giuseppe giuseppe force-pushed the add-test-zstd-chunked branch 2 times, most recently from 62de9bf to df71e86 Compare November 4, 2024 12:33
@giuseppe giuseppe marked this pull request as ready for review November 4, 2024 13:12
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2024
@giuseppe
Copy link
Member Author

giuseppe commented Nov 4, 2024

@edsantiago I've added a new test to make sure the image content doesn't change after a push/pull

@mheon
Copy link
Member

mheon commented Nov 4, 2024

LGTM

@rhatdan
Copy link
Member

rhatdan commented Nov 4, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
@edsantiago
Copy link
Member

Tests LGTM. @Luap99 heads-up this will probably conflict with #24447
Thanks @giuseppe

@edsantiago
Copy link
Member

int remote rawhide root has timed out three times. I'm not liking this.

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2024
@Luap99
Copy link
Member

Luap99 commented Nov 4, 2024

int remote rawhide root has timed out three times. I'm not liking this.

also got a timeout in #24447 but didn't think to much of it as I did not try to rerun it yet as I knew it was broken anyway
https://cirrus-ci.com/task/6327338403627008

@edsantiago
Copy link
Member

edsantiago commented Nov 4, 2024

Thank you! That's good news. In the other log, it looks like all healthcheck commands time out. But since the entire test run times out, there's no (sane) way to see what other tests time out. In your log, I see a wide variety of tests timing out. And the cumulative effect of many random tests hanging for 90s is a test failure.

Something is definitely broken with remote root. (remote rootless is passing just fine)(EDIT: int tests do not run remote rootless. My mistake). So far, no way to reproduce locally.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the add-test-zstd-chunked branch from df71e86 to 30a82ca Compare November 8, 2024 11:39
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
@giuseppe
Copy link
Member Author

giuseppe commented Nov 8, 2024

rebased

@giuseppe
Copy link
Member Author

giuseppe commented Nov 8, 2024

tests are green now

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2024
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
Copy link
Contributor

openshift-ci bot commented Nov 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, giuseppe, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Luap99,edsantiago,giuseppe]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit ee5b8de into containers:main Nov 8, 2024
52 of 53 checks passed
@test "push and pull zstd chunked image" {
image1=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/img1-$(safename)

globalargs="--pull-option enable_partial_pulls=true"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@giuseppe I can’t see any consumer of this option (set twice in this PR). I know about enable_partial_images .

Is this a typo, or am I missing something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Filed #24686 to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants