Skip to content

support alibabacloud oss for image registry#724

Merged
openshift-merge-robot merged 6 commits intoopenshift:masterfrom
menglingwei:feature/support-alibaba-oss
Dec 23, 2021
Merged

support alibabacloud oss for image registry#724
openshift-merge-robot merged 6 commits intoopenshift:masterfrom
menglingwei:feature/support-alibaba-oss

Conversation

@menglingwei
Copy link
Copy Markdown

Add Alibabacloud oss storage for image resigry operator.

  • update k8s.io/client-go to 0.22.1
  • update k8s.io/apiserver to 0.22.1
  • replace openshift/api with menglingwei/api , openshift/api has another PR imageresitry support Alibabacloud oss api#1009

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Oct 12, 2021

Hi @menglingwei. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 12, 2021
@menglingwei
Copy link
Copy Markdown
Author

replace PR #720 .

@dmage
Copy link
Copy Markdown
Contributor

dmage commented Oct 15, 2021

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 15, 2021
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2021
@kwoodson
Copy link
Copy Markdown

@menglingwei Can we rebase this to clean up the conflicts? Thanks!

@menglingwei
Copy link
Copy Markdown
Author

@menglingwei Can we rebase this to clean up the conflicts? Thanks!

Yes, i can clean up the conflicts.

This PR is a draf PR for openshift/api#1009. So, I think we can merge this PR first? Then I resubmit a new PR for cluster-image-registry-operator.

Copy link
Copy Markdown
Contributor

@ricardomaraschini ricardomaraschini left a comment

Choose a reason for hiding this comment

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

Looks good. I haven't found the part where this driver is actually used during the reconciliation. Is that something that is coming next?

Comment thread pkg/storage/oss/oss.go Outdated
Comment thread pkg/storage/oss/oss.go Outdated
Comment thread pkg/storage/oss/oss.go Outdated
Comment thread pkg/storage/oss/oss.go Outdated
Comment thread pkg/storage/oss/oss.go
Comment thread pkg/storage/oss/oss.go Outdated
Comment thread pkg/storage/oss/oss.go
Comment thread pkg/storage/oss/oss.go
generatedName := false
// Retry up to 5000 times if we get a naming conflict
const numRetries = 5000
for i := 0; i < numRetries; i++ {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I imagine you have copied this from other drivers. Can we simply try it once (instead of 500 times) and return an error in case of a failure? The reconcile cycle will happen again later on and then we retry this. wdyt?

Comment thread pkg/storage/oss/oss_test.go Outdated
Comment thread pkg/storage/oss/oss_test.go Outdated
@menglingwei
Copy link
Copy Markdown
Author

@ricardomaraschini You review api PR first , is that ok? When api PR is merged. i will update go.mod dependences.

@dmage
Copy link
Copy Markdown
Contributor

dmage commented Oct 29, 2021

@menglingwei we don't merge API changes until we have PRs (that have a temporary replace directive) verified by QE that use new API. We have experience of delivering untested API and we don't want to repeat it as we need to maintain backward compatibility and therefore even incorrect API cannot be removed once it is released.

@menglingwei
Copy link
Copy Markdown
Author

@menglingwei we don't merge API changes until we have PRs (that have a temporary replace directive) verified by QE that use new API. We have experience of delivering untested API and we don't want to repeat it as we need to maintain backward compatibility and therefore even incorrect API cannot be removed once it is released.

I understand. so i need to fix this drat PR, and make the test run success. and then you will merge the API PR?

@kwoodson
Copy link
Copy Markdown

@menglingwei Thanks for the efforts here. Please fix the conflicts with a rebase as well as the tests. Then we can perform the necessary tests.

@menglingwei
Copy link
Copy Markdown
Author

rebase

I got it. i will fix the conflict ASAP

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 1, 2021
@menglingwei
Copy link
Copy Markdown
Author

ci/prow/e2e-ovirt job failed. but i don't know how to make this job run success.any suggestions ?

@menglingwei
Copy link
Copy Markdown
Author

@menglingwei Thanks for the efforts here. Please fix the conflicts with a rebase as well as the tests. Then we can perform the necessary tests.

@kwoodson I fixed the conflicts with rebase master. but I found some jobs also run failed.

@dmage
Copy link
Copy Markdown
Contributor

dmage commented Nov 2, 2021

https://github.com/openshift/cluster-image-registry-operator/pull/724/commits

PRs shouldn't contain merge commits. Please rebase using git rebase.

@kwoodson
Copy link
Copy Markdown

kwoodson commented Nov 2, 2021

@ricardomaraschini Could you comment on the state of this PR? Have you had an opportunity to test? I can assist or if you could point me to the test suite for the image registry and I can perform this.

@dmage
Copy link
Copy Markdown
Contributor

dmage commented Nov 2, 2021

@kwoodson tests should be part of this PR, it's a new feature and it should have new tests.

Manual tests:

  1. if you change spec.storage in configs.imageregistry.operator.openshift.io/cluster to

    storage:
        oss: {}
    

    on Alibaba cluster, the operator should automatically create an OSS bucket and configure the registry to use it. It should be possible to push/pull images into/from the registry after that.

  2. if you change spec.storage and provide all configuration parameters by yourself, the operator should use them.

  3. there should be a way to configure the operator to use OSS on other platforms (i.e. there should be a way to override secrets that are used by the operator).

@dmage
Copy link
Copy Markdown
Contributor

dmage commented Nov 2, 2021

  1. on a freshly installed cluster that uses Alibaba platform, the operator should automatically configure the registry to use OSS.

@menglingwei menglingwei force-pushed the feature/support-alibaba-oss branch from 9a6e6a4 to e857b31 Compare November 3, 2021 01:44
@openshift-ci openshift-ci Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 3, 2021
@menglingwei menglingwei marked this pull request as draft November 4, 2021 11:26
@menglingwei
Copy link
Copy Markdown
Author

@dmage @kwoodson @xiuwang I updated the oss policy.

The correct tagging action are :

                "oss:PutBucketTagging",
                "oss:GetBucketTagging",
                "oss:DeleteBucketTagging",

@mtulio
Copy link
Copy Markdown

mtulio commented Dec 22, 2021

@menglingwei, @kwoodson just create a new cluster successfully. Now we can see that those new policies were created. Thanks.

$ aliyun ram GetPolicy \
    --PolicyName test-rglgq-openshift-image-registry-installer-cloud-credentials-policy-policy \
    --PolicyType Custom \
    | jq  -r '.DefaultPolicyVersion.PolicyDocument' \
    | jq '.Statement[].Action' |grep -E '(Tagging|ListBuckets)'
  "oss:PutBucketTagging",
  "oss:GetBucketTagging",
  "oss:DeleteBucketTagging",
  "oss:ListBuckets",

$ BUCKET_NAME=$(oc get configs.imageregistry.operator.openshift.io/cluster -n openshift-image-registry -o jsonpath='{.spec.storage}' |jq -r .oss.bucket)

$ echo $BUCKET_NAME 
test-rglgq-image-registry-us-east-1-jknktcahorkmcvlwvnnfgykxrh

$ ./ossutil64 ls oss://${BUCKET_NAME}
Object Number is: 0

1.219796(s) elapsed

$ oc get pods -l docker-registry=default -n openshift-image-registry
NAME                              READY   STATUS    RESTARTS   AGE
image-registry-77b9bb4bbd-6thxc   1/1     Running   0          38m
image-registry-77b9bb4bbd-c7z8b   1/1     Running   0          38m

@xiuwang could you please validate it?

@ricardomaraschini @dmage please see the feedback from the final review from QE.

/lgtm

@mtulio
Copy link
Copy Markdown

mtulio commented Dec 22, 2021

/retest-required

2 similar comments
@kwoodson
Copy link
Copy Markdown

/retest-required

@menglingwei
Copy link
Copy Markdown
Author

/retest-required

@menglingwei
Copy link
Copy Markdown
Author

/retest

1 similar comment
@menglingwei
Copy link
Copy Markdown
Author

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 23, 2021

@menglingwei: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@xiuwang
Copy link
Copy Markdown

xiuwang commented Dec 23, 2021

Validate the image registry works well with OSS stoage, the error never shown,

oss: service returned error: StatusCode=403, ErrorCode=AccessDenied, ErrorMessage="The bucket you access does not belong to you"

$oc get pods -l docker-registry=default -n openshift-image-registry
NAME READY STATUS RESTARTS AGE
image-registry-5ff9448d65-62rz2 1/1 Running 0 8m44s
image-registry-5ff9448d65-rfndv 1/1 Running 0 8m44s

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2021
@ricardomaraschini
Copy link
Copy Markdown
Contributor

@xiuwang can you please qe-approved this ?

@ricardomaraschini
Copy link
Copy Markdown
Contributor

/lgtm cancel

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2021
@ricardomaraschini
Copy link
Copy Markdown
Contributor

@sferich888 could you please re add px-approved here? This PR went through some changes and ended up loosing all its flags.

@ricardomaraschini
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 23, 2021
@ricardomaraschini
Copy link
Copy Markdown
Contributor

/lgtm cancel

I was not aware that once I add lgtm the PR is automatically approved. We need to wait for the others' approved flag first.

@openshift-ci openshift-ci Bot removed lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 23, 2021
@xiuwang
Copy link
Copy Markdown

xiuwang commented Dec 23, 2021

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Dec 23, 2021
@mtulio
Copy link
Copy Markdown

mtulio commented Dec 23, 2021

@sferich888 could you please re add px-approved here? This PR went through some changes and ended up loosing all its flags.

@ricardomaraschini there is already a px-approved label.

@ricardomaraschini
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2021
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jianli-wei, kwoodson, menglingwei, mtulio, ricardomaraschini, xiuwang

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 23, 2021
@openshift-merge-robot openshift-merge-robot merged commit 11278d4 into openshift:master Dec 23, 2021
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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.