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 GitHub Container Registry based on PostgreSQL #2621

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Aug 3, 2024

Partially fix #2337.

Test

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

  1. Tag and push the cr.backend.ai/stable/python image to your GitHub package for testing.
❯ docker tag cr.backend.ai/stable/python:3.9-ubuntu20.04 ghcr.io/<github_username>/python:3.9-ubuntu20.04
❯ docker push ghcr.io/<github_username>/python:3.9-ubuntu20.04
  1. After filling in the required fields in the fixtures/manager/example-container-registries-ghcr.json file, execute the following command.
❯ ./backend.ai mgr fixture populate ./fixtures/manager/example-container-registries-ghcr.json

Note

The entity_type should be either "users" or "orgs".

  1. Insert the following value into the container_registry column of the groups table.
{
	"registry": "ghcr.io",
	"project": "<github_username>"
}
  1. Add ghcr.io value to allowed_docker_registries column of domains table using below command
❯ ./backend.ai admin domain update default --allowed-docker-registries=ghcr.io

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 ghcr.io

2. Create a session from the pulled image

Run a session using the downloaded image.

❯ ./backend.ai session create ghcr.io/<github_username>/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

@github-actions github-actions bot added comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:M 30~100 LoC labels Aug 3, 2024
@jopemachine jopemachine changed the title feat: Support GitHub Container Registry based on psq feat: Support GitHub Container Registry based on PostgreSQL Aug 3, 2024
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 36de125 to 8c4d8c0 Compare August 3, 2024 02:11
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from ec64f48 to 1cd3649 Compare August 3, 2024 02:11
@jopemachine jopemachine added this to the 24.09 milestone Aug 3, 2024
@jopemachine jopemachine marked this pull request as ready for review August 3, 2024 03:11
@jopemachine jopemachine added the type:feature Add new features label Aug 3, 2024
@jopemachine jopemachine linked an issue Aug 3, 2024 that may be closed by this pull request
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 68c9931 to 429d3f8 Compare August 3, 2024 05:23
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 2cc4731 to ffc02b0 Compare August 3, 2024 05:23
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 429d3f8 to 8cfc934 Compare August 5, 2024 06:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from f983fcc to 3de822b Compare August 5, 2024 06:20
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 8cfc934 to c1e19f3 Compare August 5, 2024 09:03
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 3de822b to 80babfd Compare August 5, 2024 09:03
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from c1e19f3 to 1003434 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 80babfd to 6ad5518 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 1003434 to 0bbb489 Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 6ad5518 to d64bf7f Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 0bbb489 to cf21f01 Compare August 6, 2024 05:41
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from d64bf7f to f9848eb Compare August 6, 2024 05:41
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from f42a5db to 8eaba4c Compare September 18, 2024 06:58
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 11a5742 to 338075a Compare September 18, 2024 06:59
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 8eaba4c to 1e39787 Compare September 19, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 338075a to 61cc5d5 Compare September 19, 2024 07:20
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 1e39787 to 40922c3 Compare September 19, 2024 07:34
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 61cc5d5 to 8605540 Compare September 19, 2024 07:34
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 40922c3 to bc78e16 Compare September 19, 2024 07:57
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 8605540 to 0396238 Compare September 19, 2024 07:57
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from bc78e16 to e3f3c66 Compare September 30, 2024 12:21
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 0396238 to da53902 Compare September 30, 2024 12:21
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from e3f3c66 to 27d8b1b Compare September 30, 2024 12:26
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from da53902 to cef7cba Compare September 30, 2024 12:27
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 27d8b1b to 3794db3 Compare September 30, 2024 12:39
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from cef7cba to 14f29f8 Compare September 30, 2024 12:40
@jopemachine jopemachine force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 3794db3 to 13bbbc3 Compare September 30, 2024 14:36
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 14f29f8 to 461845b Compare September 30, 2024 14:36
@kyujin-cho kyujin-cho force-pushed the topic/09-06-feat_support_legacy_docker_image_manifest branch from 13bbbc3 to ab9a9f7 Compare September 30, 2024 15:05
Base automatically changed from topic/09-06-feat_support_legacy_docker_image_manifest to main September 30, 2024 15:11
@kyujin-cho kyujin-cho force-pushed the topic/08-03-feat_support_github_container_registry_based_on_psq branch from 461845b to beb4b76 Compare September 30, 2024 15:14
Copy link
Member

Merge activity

  • Sep 30, 11:15 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 39ad46a Sep 30, 2024
24 checks passed
@kyujin-cho kyujin-cho deleted the topic/08-03-feat_support_github_container_registry_based_on_psq branch September 30, 2024 15:21
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 require:db-migration Automatically set when alembic migrations are added or updated size:M 30~100 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