-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Extended test for registry garbage collector #14509
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
Conversation
@dmage FYI |
b0518d4
to
b03fec2
Compare
test/extended/images/hardprune.go
Outdated
cleanUp.addImage(baseImg4, imageId, "") | ||
//baseImg4Spec := fmt.Sprintf("%s/%s/A:new", registryURL, oc.Namespace()) | ||
|
||
childImg1, imageId, err := BuildAndPushChildImage(oc, dClient, baseImg1Spec, "A", "latest", 1, outSink, true) |
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.
s/"A"/"C"/? In the next table childImg1 is mentioned in the image stream C.
test/extended/images/hardprune.go
Outdated
|
||
}) | ||
|
||
func expectDeletions(deletedPaths []string, namespace string, expect expectedDeletions) error { |
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.
How are you going to get these paths?
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'd like to read them from the standard output of dockerregistry -prune
command. Will something like this be available? Or will it be more like:
Deleted blob sha256:XXXX
Deleted layer link sha256:XXXX from repository NAMESPACE/REPO
?
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.
You can see it there: master...dmage:prune
test/extended/images/helper.go
Outdated
} | ||
|
||
return "", nil | ||
return "", "", nil |
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.
No result and no error? Looks like there is something wrong.
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.
Maybe it could be better structured. Nevertheless, the returned values are not wrong. This line is reached when a push failure is expected and the push really failed - so there's no usable output for the caller. Well, maybe imageID
is of some use unless removeAfterPush
is true
.
d84e614
to
f8563b6
Compare
test/extended/images/helper.go
Outdated
out, err := oc.SetNamespace(metav1.NamespaceDefault).AsAdmin(). | ||
Run("exec").Args("--stdin", podName, "--", "/bin/sh", "-s"). | ||
InputString(fmt.Sprintf(registryGCLauncherScript, dockerRegistryBinary)).Output() | ||
if exitError, ok := err.(*exutil.ExitError); ok && strings.Contains(exitError.StdErr, "unable to upgrade connection") { |
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.
@stevekuznetsov have you seen this before?
Jun 16 12:27:17.529: INFO: Running 'oc exec --config=/tmp/openshift/core/openshift.local.config/master/admin.kubeconfig --namespace=default --stdin docker-registry-1-z3hj1 -- /bin/sh -s'
Jun 16 12:27:17.771: INFO: Error running &{/data/src/github.com/openshift/origin/_output/local/bin/linux/amd64/oc [oc exec --config=/tmp/openshift/core/openshift.local.config/master/admin.kubeconfig --namespace=default --stdin docker-registry-1-z3hj1 -- /bin/sh -s] [] error: unable to upgrade connection: container not found ("registry")
error: unable to upgrade connection: container not found ("registry")
[] <nil> 0xc420d582d0 exit status 1 <nil> <nil> true [0xc420030000 0xc420030040 0xc420030040] [0xc420030000 0xc420030040] [0xc420030020 0xc420030038] [0xde31c0 0xde32c0] 0xc421682240 <nil>}:
error: unable to upgrade connection: container not found ("registry")
failed to execute into registry pod docker-registry-1-z3hj1: exit status 1
Jun 16 12:27:17.822: INFO: Running 'oc exec --config=/tmp/openshift/core/openshift.local.config/master/admin.kubeconfig --namespace=default --stdin docker-registry-1-z3hj1 -- /bin/sh -s'
Jun 16 12:27:18.065: INFO: Error running &{/data/src/github.com/openshift/origin/_output/local/bin/linux/amd64/oc [oc exec --config=/tmp/openshift/core/openshift.local.config/master/admin.kubeconfig --namespace=default --stdin docker-registry-1-z3hj1 -- /bin/sh -s] [] error: unable to upgrade connection: container not found ("registry")
error: unable to upgrade connection: container not found ("registry")
[] <nil> 0xc4212150b0 exit status 1 <nil> <nil> true [0xc4202b76d8 0xc4202b7780 0xc4202b7780] [0xc4202b76d8 0xc4202b7780] [0xc4202b76f8 0xc4202b7760] [0xde31c0 0xde32c0] 0xc42168ef00 <nil>}:
error: unable to upgrade connection: container not found ("registry")
Do I use the exec
wrong? The interesting part is that this fails roughly in one out of three runs - the first time this code is executed.
If this succeeds once, it will succeed next time as well.
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.
Looks like there isn't a container registry
in the docker-registry-1-z3hj1
pod? I haven't seen this before but it may mean the registry failed to start.
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.
@stevekuznetsov my bad. The command attempts to execute into an old pod just after a redeployment. I just need to make sure to choose the most recent one.
test/extended/images/hardprune.go
Outdated
// this shouldn't delete anything | ||
o.Expect(deleted.Len()).To(o.Equal(0)) | ||
|
||
/* TODO: use a persistent storage for the registry to preserve data across re-deployments |
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.
@stevekuznetsov Would it be possible to use persistent volume for the registry for the extended tests at least?
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.
What's the context here? PV for test smells bad -- are there cross-test dependencies?
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.
During a single test, I'd like to:
- upload some images
- redeploy the registry into a different configuration
- check whether the registry is usable with the images uploaded before
In this case the modified configuration is read-only, therefore I cannot upload any other images to test with.
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.
Sounds reasonable. You'll want to figure out how to get claimable PVs on the CI environment - what OpenShift Ansible options need to be set? Do we need to set up the filesystem in a special way? We've got logic to set up a VG for EmptyDir mounts already on XFS so we've got a place in origin-ci-tool
to add more set up in case we need to. OpenShift Ansible inventory changes would land in aos-cd-jobs
.
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 for the pointers I'll look into it.
2db7dd1
to
b0a12a4
Compare
72d2ac8
to
3ef2fc1
Compare
3ef2fc1
to
749bd88
Compare
4b475f4
to
7d916b7
Compare
Hopefully resolved possible flake caused by #13428. |
783a16e
to
6808038
Compare
@stevekuznetsov is something wrong with selinux policy:
? |
[test] |
8a50257
to
be2cc4d
Compare
Signed-off-by: Oleg Bulatov <[email protected]>
Signed-off-by: Michal Minář <[email protected]>
be2cc4d
to
b1c1518
Compare
Evaluated for origin testextended up to b1c1518 |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended/809/) (Base Commit: fc34104) (PR Branch Commit: b1c1518) (Extended Tests: core(registry|imageapi|ImagePrune|ImageQuota)) |
Flake #15015 re-[test] |
Flake #12072. re-[test] |
Evaluated for origin test up to b1c1518 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2937/) (Base Commit: 9c5e7da) (PR Branch Commit: b1c1518) |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: miminar Assign the PR to them by writing Associated issue: 14585 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: miminar Assign the PR to them by writing Associated issue: 14585 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: miminar Assign the PR to them by writing Associated issue: 14585 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@miminar PR needs rebase |
Closing in favor of #14585 which now embeds the extended test. |
Waiting for #14585
Resolves #15452