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

feat: Support AWS ECR Public Container Registry #2549

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Jul 24, 2024

Partially fix #2337.

Test

ecr-public

Manually tested it using the following methods.

In this PR, the cr.backend.ai/stable/python:3.9-ubuntu20.04 image is used as a placeholder for testing.

Prerequisite

Create and configure the relevant users and policies appropriately through AWS IAM for testing this PR.

Then, generate the "access key" and store the access_key and secret_access_key in etcd.


  1. Tag and push the cr.backend.ai/stable/python image to your AWS ECR package for testing.
❯ docker tag cr.backend.ai/stable/python:3.9-ubuntu20.04 public.ecr.aws/<registry_alias>/python:3.9-ubuntu20.04
❯ docker push public.ecr.aws/<registry_alias>/python:3.9-ubuntu20.04
  1. Enter the following command for putting the necessary key-values in etcd.

You can get the login password through aws ecr-public get-login-password command.

❯ ./backend.ai mgr etcd put config/docker/registry/public.ecr.aws "https://public.ecr.aws"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/access_key "<access_key>"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/secret_access_key "<secret_access_key>"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/region "us-east-1"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/type "ecr-public"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/username "AWS"; \
./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/password "<login-password>";
  1. Insert the following value into the container_registry column of the groups table.
{
	"registry": "public.ecr.aws",
	"project": "<registry_alias>"
}
  1. Add public.ecr.aws value to allowed_docker_registries column of domains table using below command
❯ ./backend.ai admin domain update default --allowed-docker-registries=public.ecr.aws

Test scenarios

Verify that the container registry added in this PR is functioning based on several scenarios.

If there are additional scenarios that need testing, please leave a comment.

1. Image Rescan

Image rescanning should work through the following command.

❯ ./backend.ai mgr image rescan public.ecr.aws

2. Create a session from the pulled image

Run a session using the downloaded image.

❯ ./backend.ai session create public.ecr.aws/<registry_alias>/python:3.9-ubuntu20.04

3. Commit the changes and push it to the container registry.

For committing a session, it is necessary to assume that the Registry alias is included in config/docker/registry/public.ecr.aws/project in etcd.

Enter the key value using the following command.

❯ ./backend.ai mgr etcd put config/docker/registry/public.ecr.aws/project "<registry_alias>"

Commit the changes using the convert-to-image command and push them to the container registry.

❯ ./backend.ai session convert-to-image <session_id> test_imgname

∙ Request to commit Session(name or id: ce592e27-b90a-4859-92b1-360fdd6d8464)
100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00,  2.02it/s]
✓ Session export process completed.

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue

📚 Documentation preview 📚: https://sorna--2549.org.readthedocs.build/en/2549/


📚 Documentation preview 📚: https://sorna-ko--2549.org.readthedocs.build/ko/2549/

Copy link
Member Author

jopemachine commented Jul 24, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @jopemachine and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added comp:manager Related to Manager component comp:agent Related to Agent component comp:common Related to Common component size:M 30~100 LoC size:L 100~500 LoC and removed size:M 30~100 LoC labels Jul 24, 2024
@jopemachine jopemachine added this to the 24.03 milestone Jul 24, 2024
@jopemachine jopemachine linked an issue Jul 24, 2024 that may be closed by this pull request
@github-actions github-actions bot added type:feature Add new features size:M 30~100 LoC area:docs Documentations size:L 100~500 LoC and removed size:L 100~500 LoC size:M 30~100 LoC labels Jul 24, 2024
@jopemachine jopemachine changed the title feat: Support AWS ECR Container Registry feat: Support AWS ECR Public Container Registry Jul 25, 2024
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from 5942be0 to e25bf17 Compare July 25, 2024 08:21
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 91d5c8a to 406db99 Compare July 25, 2024 08:22
@jopemachine jopemachine marked this pull request as ready for review July 25, 2024 08:26
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from e25bf17 to a5dadb1 Compare July 26, 2024 03:08
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 406db99 to ef3a2dc Compare July 26, 2024 03:08
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 3dd31fc to 1096da4 Compare July 30, 2024 02:06
@kyujin-cho kyujin-cho force-pushed the topic/06-28-support_gitlab_container_registry branch from 1194d1b to 8994110 Compare August 1, 2024 01:39
@kyujin-cho kyujin-cho force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 1096da4 to 0f9e791 Compare August 1, 2024 01:39
@kyujin-cho kyujin-cho force-pushed the topic/06-28-support_gitlab_container_registry branch from 8994110 to 79604b6 Compare August 1, 2024 03:07
@kyujin-cho kyujin-cho force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 0f9e791 to 34b7bfa Compare August 1, 2024 03:07
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from 79604b6 to 0fc60a8 Compare August 1, 2024 04:55
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 34b7bfa to 8877acc Compare August 1, 2024 04:55
@kyujin-cho kyujin-cho force-pushed the topic/06-28-support_gitlab_container_registry branch from 0fc60a8 to f254106 Compare August 1, 2024 05:34
@kyujin-cho kyujin-cho force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 8877acc to 3ee8326 Compare August 1, 2024 05:34
@kyujin-cho kyujin-cho force-pushed the topic/06-28-support_gitlab_container_registry branch from f254106 to 5b5e659 Compare August 1, 2024 05:41
@kyujin-cho kyujin-cho force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 3ee8326 to 7bd101f Compare August 1, 2024 05:41
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from 5b5e659 to 643e57e Compare August 1, 2024 06:43
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from 7bd101f to c2da0ba Compare August 1, 2024 06:43
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from 643e57e to e88690a Compare August 5, 2024 00:49
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch 2 times, most recently from 754cde8 to dfbd5d0 Compare August 5, 2024 00:52
@jopemachine jopemachine force-pushed the topic/06-28-support_gitlab_container_registry branch from bfcbdba to 9ec3ff9 Compare August 5, 2024 00:57
@jopemachine jopemachine force-pushed the topic/07-24-feat_support_aws_ecr_container_registry branch from dfbd5d0 to e95013c Compare August 5, 2024 00:58
@jopemachine
Copy link
Member Author

Closed as #1917 stack was merged.

@jopemachine jopemachine closed this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:docs Documentations comp:agent Related to Agent component comp:common Related to Common component comp:manager Related to Manager component size:L 100~500 LoC type:feature Add new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for GitLab, GitHub and AWS ECR container registry
2 participants