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 Private Container Registry based on PostgreSQL #2624

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Aug 3, 2024

Partially fix #2337.

Test

ecr

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 <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<project>/python:3.9-ubuntu20.04
❯ docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<project>/python:3.9-ubuntu20.04
  1. After filling in the required fields in the fixtures/manager/example-container-registries-aws-ecr.json file, execute the following command.
❯ ./backend.ai mgr fixture populate ./fixtures/manager/example-container-registries-aws-ecr.json
  1. Insert the following value into the container_registry column of the groups table.
{
	"registry": "<aws_account_id>.dkr.ecr.<region>.amazonaws.com",
	"project": "<project>"
}

Note

Empty project values are not allowed.

  1. Add <aws_account_id>.dkr.ecr.<region>.amazonaws.com value to allowed_docker_registries column of domains table using below command
❯ ./backend.ai admin domain update default --allowed-docker-registries=<aws_account_id>.dkr.ecr.<region>.amazonaws.com

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 <aws_account_id>.dkr.ecr.<region>.amazonaws.com

2. Create a session from the pulled image

Run a session using the downloaded image.

❯ ./backend.ai session create <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<project>/python:3.9-ubuntu20.04

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

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--2624.org.readthedocs.build/en/2624/


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

@github-actions github-actions bot added area:docs Documentations comp:manager Related to Manager component labels Aug 3, 2024
@github-actions github-actions bot added the size:S 10~30 LoC label Aug 3, 2024
@jopemachine jopemachine marked this pull request as ready for review August 3, 2024 04:05
@jopemachine jopemachine added this to the 24.09 milestone Aug 3, 2024
@jopemachine jopemachine linked an issue Aug 3, 2024 that may be closed by this pull request
@jopemachine jopemachine added the type:feature Add new features label Aug 3, 2024
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 08d6763 to 1dc6851 Compare August 3, 2024 05:23
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from e1ed86b to d077f8a Compare August 3, 2024 05:23
@jopemachine jopemachine removed the area:docs Documentations label Aug 3, 2024
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 17bafa0 to 4f65884 Compare August 3, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from d077f8a to c51e229 Compare August 3, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 4f65884 to db9c829 Compare August 5, 2024 06:21
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from c51e229 to 0364b8b Compare August 5, 2024 06:21
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from db9c829 to c8494b0 Compare August 5, 2024 09:03
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 0364b8b to 3032175 Compare August 5, 2024 09:04
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from c8494b0 to 02c5a90 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 3032175 to a7bbc69 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 02c5a90 to e0ae7c0 Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from a7bbc69 to b760be8 Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from e0ae7c0 to c7c0945 Compare August 6, 2024 05:42
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from b760be8 to ac34a6d Compare August 6, 2024 05:42
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 51152a2 to 3ebcdef Compare September 18, 2024 06:48
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from bc35ab6 to 59f390b Compare September 18, 2024 06:49
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 3ebcdef to 4cc2b2e Compare September 18, 2024 06:59
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 59f390b to e72edef Compare September 18, 2024 06:59
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 4cc2b2e to 0d8ad9a Compare September 19, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from e72edef to e91213b Compare September 19, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 0d8ad9a to d8fecb0 Compare September 19, 2024 07:34
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from e91213b to 4b65e36 Compare September 19, 2024 07:34
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from d8fecb0 to a3ddc76 Compare September 19, 2024 07:57
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 4b65e36 to f05d2c7 Compare September 19, 2024 07:57
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from a3ddc76 to c1aac4a Compare September 30, 2024 12:21
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from f05d2c7 to 5444b1b Compare September 30, 2024 12:21
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from c1aac4a to d66a76b Compare September 30, 2024 12:27
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 5444b1b to f213a88 Compare September 30, 2024 12:27
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from d66a76b to ac2e47c Compare September 30, 2024 12:40
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from f213a88 to 34b09df Compare September 30, 2024 12:40
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from ac2e47c to 8556cdd Compare September 30, 2024 14:36
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 34b09df to de4858e Compare September 30, 2024 14:37
@kyujin-cho kyujin-cho force-pushed the topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ branch from 8556cdd to 730184d Compare September 30, 2024 15:31
Base automatically changed from topic/08-03-feat_support_aws_ecr_public_container_registry_based_on_postgresql_ to main September 30, 2024 15:40
@kyujin-cho kyujin-cho force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from de4858e to 0d9807a Compare September 30, 2024 15:43
Copy link
Member

Merge activity

  • Sep 30, 11:44 AM EDT: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.

@kyujin-cho kyujin-cho added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit 4b30de5 Sep 30, 2024
21 checks passed
@kyujin-cho kyujin-cho deleted the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch September 30, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component size:S 10~30 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