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

Infra: Upload images to a public AWS ECR #242

Closed
2 tasks done
Haarolean opened this issue Mar 22, 2024 · 34 comments · Fixed by #347
Closed
2 tasks done

Infra: Upload images to a public AWS ECR #242

Haarolean opened this issue Mar 22, 2024 · 34 comments · Fixed by #347
Labels
scope/infra CI, CD, dev. env, etc. status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Milestone

Comments

@Haarolean
Copy link
Member

Haarolean commented Mar 22, 2024

We currently publish to github (and mirror to DockerHub), but I'll raise an issue and discuss the possibility of uploading the images to a public ECR as well.

Originally posted by @Haarolean in #23 (reply in thread)

TODO:

@kapybro kapybro bot added status/triage Issues pending maintainers triage scope/infra CI, CD, dev. env, etc. status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Mar 22, 2024
@Haarolean Haarolean changed the title Infra: Consider uploading images to a public AWS ECR Infra: Upload images to a public AWS ECR Apr 10, 2024
@Haarolean Haarolean added the status/needs-attention Collective discussion is required label Apr 10, 2024
@Haarolean Haarolean moved this to Backlog in Housekeeping Apr 27, 2024
@yermulnik
Copy link
Contributor

@Haarolean Have there been any updates on this recently? Thanks.

@Haarolean Haarolean added this to the 1.1 milestone Oct 7, 2024
@Haarolean Haarolean removed the status/needs-attention Collective discussion is required label Oct 7, 2024
@Haarolean Haarolean removed this from Housekeeping Oct 7, 2024
@Haarolean Haarolean moved this from Todo to PR Approved in Release 1.1 Oct 7, 2024
@Haarolean Haarolean added the type/enhancement En enhancement/improvement to an already existing feature label Oct 7, 2024
@Haarolean Haarolean moved this to PR Approved in Up for grabs Oct 7, 2024
@github-project-automation github-project-automation bot moved this from PR Approved to Done in Up for grabs Oct 7, 2024
@github-project-automation github-project-automation bot moved this from PR Approved to Done in Release 1.1 Oct 7, 2024
@yermulnik
Copy link
Contributor

@Haarolean Just to reconfirm: this is the correct AWS Public ECR repo — https://gallery.ecr.aws/s0v8j8q9/kafbat/kafka-ui, right?
image

Can the s0v8j8q9 id be dropped from the path and the description added to the repo for visibility? Thank you.

@Haarolean
Copy link
Member Author

@yermulnik yeah it's the right one. The id can't be dropped (unless you know something we don't :) ), the first deploy should be performed once #586 is merged and we'll update the description soon

@yermulnik
Copy link
Contributor

Thank you.
We can expect version and latest tags to be added as well, right? 😺

@yermulnik
Copy link
Contributor

The id can't be dropped (unless you know something we don't :) )

FWIW: https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/
image

ps: hope this helps as I haven't done this myself before 🤷🏻

@Haarolean
Copy link
Member Author

Thank you. We can expect version and latest tags to be added as well, right? 😺

latest will be pushed there once 1.1 is released, will that work for you?

@yermulnik
Copy link
Contributor

Thank you. We can expect version and latest tags to be added as well, right? 😺

latest will be pushed there once 1.1 is released, will that work for you?

Absolutely. Appreciate it 👍🏻

@yermulnik
Copy link
Contributor

@Haarolean Given the number of tasks for 1.1 milestone, are there any approx timelines for that release? 🤔 Past due by 8 months 😢

FWIW: aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry

Did I get it right, that you decided to not go with custom registry alias for a reason?

Also is the main tag re-added for every new commit'ish tag? (trying to figure out what we should rely upon unless releases are tagged correctly going forward).
Thanks.

@Haarolean
Copy link
Member Author

are there any approx timelines for that release

Yeah, once #72 is merged in.

Did I get it right, that you decided to not go with custom registry alias for a reason?

Nope. I believe we didn't get the alias approved or something. I'll take a look into that.

Also is the main tag re-added for every new commit'ish tag

Yeah, that's right. It always points to the latest commit in main.
Besides the main and release tags, every other commit in main has its own tag. You can use one of these.
image

@yermulnik
Copy link
Contributor

🥳 Yay, can see v1.1.0 (and latest) at https://gallery.ecr.aws/s0v8j8q9/kafbat/kafka-ui now. Thank a lot.

Any updates on custom registry alias in place of random id? Thanks.

@Haarolean
Copy link
Member Author

@yermulnik dunno, they're quite stubborn:
image
Will try to investigate

@yermulnik
Copy link
Contributor

That's odd 😕 Any chance you can create an AWS support request to see why that's rejected?

@yermulnik
Copy link
Contributor

I also reached out to AWS Support on this case and here's what they provided:

Please allow me to mention the internal team has mentioned that the request was getting rejected because the email of the account holder does not match with the alias kafka requested as Kafka is a separate platform https://kafka.apache.org/ .

So as next step I would request you to please have a check on the email from which the request is being raised.

Maybe it is worth of requesting kafbat as an alias for this Public ECR or otherwise an alias that matches AWS account holder email (I'm supposing it's somehow related either to kafbat or to kafka-ua names 🤞🏻)? 🤔

@Haarolean
Copy link
Member Author

I also reached out to AWS Support on this case and here's what they provided:

Please allow me to mention the internal team has mentioned that the request was getting rejected because the email of the account holder does not match with the alias kafka requested as Kafka is a separate platform https://kafka.apache.org/ .
So as next step I would request you to please have a check on the email from which the request is being raised.

Maybe it is worth of requesting kafbat as an alias for this Public ECR or otherwise an alias that matches AWS account holder email (I'm supposing it's somehow related either to kafbat or to kafka-ua names 🤞🏻)? 🤔

thanks for doing this! Indeed we had a same thought today, applied as kafbat-ui instead, let's see.

@yermulnik
Copy link
Contributor

applied as kafbat-ui instead, let's see.

If you'll be pushing images to this registry for non-kafka-ui products developed by kafbat team, then the -ui suffix may look odd I guess.

@Haarolean
Copy link
Member Author

applied as kafbat-ui instead, let's see.

If you'll be pushing images to this registry for non-kafka-ui products developed by kafbat team, then the -ui suffix may look odd I guess.

sorry you're right, we've applied kafbat instead, it's rather a typo in my message

@yermulnik
Copy link
Contributor

JFYI:

Please allow me to mention that internal team has confirmed you can request for "kafbat" through console and it will be processed normally.

@Haarolean
Copy link
Member Author

@yermulnik thank you!
it's done now: https://gallery.ecr.aws/kafbat/kafbat/kafka-ui
the name is kinda weird tho (kafbat/kafbat/kafka-ui)
image

@yermulnik
Copy link
Contributor

Marvelous. Thanks! 👍🏻

@yermulnik
Copy link
Contributor

yermulnik commented Jan 17, 2025

the name is kinda weird tho (kafbat/kafbat/kafka-ui)

You probably need to drop now redundant s0v8j8q9/ from vars.ECR_REGISTRY value for docker tag 🤔

ps: I'm assuming that vars.ECR_REGISTRY is set to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com/s0v8j8q9 at the moment and hence (given the kafbat ECR alias is set now) it can be reduced to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com so that ${{ env.REGISTRY }}/${{ env.REPOSITORY }} resolves to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com/kafbat/kafka-ui 🤞🏻

@yermulnik
Copy link
Contributor

Please let me know if that helps.

@yermulnik
Copy link
Contributor

You also probably can simplify code in docker publish workflow by replacing define env vars step with the below code:

      - name: define env vars
        run: |
          if [ ${{ matrix.registry }} == 'ecr' ]; then
            echo "REGISTRY=${{ vars.ECR_REGISTRY }}" >> $GITHUB_ENV
            echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
          else
            echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
            echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
          fi

@Haarolean
Copy link
Member Author

the name is kinda weird tho (kafbat/kafbat/kafka-ui)

You probably need to drop now redundant s0v8j8q9/ from vars.ECR_REGISTRY value for docker tag 🤔

ps: I'm assuming that vars.ECR_REGISTRY is set to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com/s0v8j8q9 at the moment and hence (given the kafbat ECR alias is set now) it can be reduced to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com so that ${{ env.REGISTRY }}/${{ env.REPOSITORY }} resolves to <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com/kafbat/kafka-ui 🤞🏻

it was set to public.ecr.aws/s0v8j8q9. I just tried replacing it with public.ecr.aws with no luck:

unexpected status from POST request to https://public.ecr.aws/v2/kafbat/kafka-ui/blobs/uploads/: 404 Not Found
Error: Process completed with exit code 1.

@yermulnik
Copy link
Contributor

yermulnik commented Jan 17, 2025

it was set to public.ecr.aws/s0v8j8q9. I just tried replacing it with public.ecr.aws with no luck:

unexpected status from POST request to https://public.ecr.aws/v2/kafbat/kafka-ui/blobs/uploads/: 404 Not Found
Error: Process completed with exit code 1.

Ah, I see. Please try to set vars.ECR_REGISTRY back to public.ecr.aws/s0v8j8q9 and instead replace

          elif [ ${{ matrix.registry }} == 'ecr' ]; then
            echo "REGISTRY=${{ vars.ECR_REGISTRY }}" >> $GITHUB_ENV
            echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV

with

          elif [ ${{ matrix.registry }} == 'ecr' ]; then
            echo "REGISTRY=${{ vars.ECR_REGISTRY }}" >> $GITHUB_ENV
            echo "REPOSITORY=$(basename ${{ github.repository }})" >> $GITHUB_ENV

The gist of the change: REPOSITORY=${{ github.repository }} -> REPOSITORY=$(basename ${{ github.repository }})

@Haarolean Haarolean reopened this Jan 21, 2025
@Haarolean
Copy link
Member Author

@yermulnik wanna raise a PR for that?

@yermulnik
Copy link
Contributor

wanna raise a PR for that?

Do you mean I should raise or you just want to allow me to contribute via PR?
If you think I'd better raise PR, I can do that. Otherwise I don't think it's worth of a fuss if you already made those changes and they worked as expected.

@Haarolean
Copy link
Member Author

That's merely a contribution suggestion :) I haven't tried anything since your last comment yet

yermulnik added a commit to yermulnik/kafka-ui that referenced this issue Jan 21, 2025
Ref: kafbat#242

Improve publishig to Public AWS ECR by trimming repo owner from repo name
so that Public ERC repo url has no duplcates.
Before: `public.ecr.aws/kafbat/kafbat/kafka-ui`
After: `public.ecr.aws/kafbat/kafka-ui`
@yermulnik
Copy link
Contributor

No problem. Let try this out: #794 (though it's still you to test the changes I guess 🤷🏻)

@yermulnik
Copy link
Contributor

@Haarolean Any chance for #794 to get rolling? =)

@Haarolean
Copy link
Member Author

@yermulnik
https://github.com/kafbat/kafka-ui/actions/runs/13051969523/job/36414297377

unexpected status from POST request to https://public.ecr.aws/v2/s0v8j8q9/kafka-ui/blobs/uploads/: 404 Not Found
Error: Process completed with exit code 1.

huh

@yermulnik
Copy link
Contributor

Hmm, ah, I guess I figured it... I'm trying to come up with a correct path blindly as I obviously have no access to target infra of yours.

So I suppose that there's a kafbat/kafka-ui repo in your public ECR, but no kafka-ui repo. Please try and create kafka-ui repo:
Image

@Haarolean
Copy link
Member Author

@yermulnik indeed! This was the culprit.
https://gallery.ecr.aws/kafbat/kafka-ui
thanks for your help ❤️
P.S. I'll try to redeploy the release images to ecr, if I don't manage to do that, we'll keep the old (https://gallery.ecr.aws/kafbat/kafbat/kafka-ui) repo until the next release

@Haarolean
Copy link
Member Author

pushed both past releases to https://gallery.ecr.aws/kafbat/kafka-ui

@yermulnik
Copy link
Contributor

Yay 🥳 Thanks a bunch! Great collaboration experience ❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/infra CI, CD, dev. env, etc. status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants