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: Replace image rescan command's --local flag with the local type ContainerRegistry record #2665

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Aug 7, 2024

Partially fix #411, ref: #1097

This PR removes the existing image rescan code that uses the --local flag and instead uses a Local type container registry record to reuse existing code paths.

Test

Manually tested according to the following procedure.

  1. Create a Dockerfile with the following content.
    (Copy-pasted from feat: Support scanning the local Docker daemon's image list #1097 (comment))
FROM python:3.11

# Install ipython kernelspec
RUN python3.11 -m pip install ipython ipykernel
RUN python3.11 -m ipykernel install --display-name "Python 3.11 on Backend.AI" && \
    cat /usr/local/share/jupyter/kernels/python3/kernel.json

LABEL ai.backend.kernelspec=1 \
      ai.backend.features="uid-match batch query" \
      ai.backend.base-distro="ubuntu18.04" \
      ai.backend.runtime-type="python" \
      ai.backend.runtime-path="/usr/local/bin/python3"
  1. Build using docker build
docker build -t stable/bai-python:3.11 -f Dockerfile .

Note: We don't need to prepend index.docker.io/library to the image name through this patch.

  1. Create a fixture for generating a row in a "local" type container registry.
./backend.ai mgr fixture populate ./fixtures/manager/example-container-registries-local.json
  1. Rescan the image

Perform an image rescan.
Verify that the built bai-python image has been scanned correctly.

./backend.ai mgr image rescan local
  1. Create a session through the scanned image
./backend.ai session create local/stable/bai-python:3.11

Checklist: (if applicable)

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

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


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

@github-actions github-actions bot added the size:L 100~500 LoC label Aug 7, 2024
@jopemachine jopemachine changed the title feat: Replace rescan command's --local flag with Local container registry record feat: Replace rescan command's --local flag with the local container registry record Aug 7, 2024
@jopemachine jopemachine added this to the 24.09 milestone Aug 7, 2024
@jopemachine jopemachine marked this pull request as ready for review August 7, 2024 05:44
@jopemachine jopemachine requested a review from achimnol August 7, 2024 05:44
@jopemachine jopemachine changed the title feat: Replace rescan command's --local flag with the local container registry record feat: Replace rescan command's --local flag with the local type container registry record Aug 7, 2024
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 30576a2 to 31e78a2 Compare August 8, 2024 06:19
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 2989bf6 to e1ce676 Compare August 8, 2024 06:19
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from 31e78a2 to aecba67 Compare August 8, 2024 06:23
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from e1ce676 to da7e43b Compare August 8, 2024 06:24
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from aecba67 to b5ed78b Compare August 8, 2024 06:41
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from da7e43b to 9f13201 Compare August 8, 2024 06:41
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from b5ed78b to f01835b Compare August 8, 2024 06:56
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from dbfb22a to 0ffc1c6 Compare August 8, 2024 06:56
@jopemachine jopemachine force-pushed the topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ branch from f01835b to c3eba55 Compare August 8, 2024 06:59
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 0ffc1c6 to 37488ec Compare August 8, 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-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from f386298 to a2a9213 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 e72edef to e91213b Compare September 19, 2024 07:20
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from a2a9213 to a45cdb8 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 e91213b to 4b65e36 Compare September 19, 2024 07:34
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from a45cdb8 to 21477bd 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 4b65e36 to f05d2c7 Compare September 19, 2024 07:57
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 21477bd to d2ec79e 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 f05d2c7 to 5444b1b Compare September 30, 2024 12:21
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from d2ec79e to 5620f3b Compare September 30, 2024 12:22
@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-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 5620f3b to 2fee789 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 f213a88 to 34b09df Compare September 30, 2024 12:40
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 2fee789 to fa6f23a Compare September 30, 2024 12:40
@jopemachine jopemachine changed the title feat: Replace rescan command's --local flag with the local type ContainerRegistry record feat: Replace image rescan command's --local flag with the local type ContainerRegistry record Sep 30, 2024
@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
@jopemachine jopemachine force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from fa6f23a to 379316c Compare September 30, 2024 14:37
@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
Base automatically changed from topic/08-03-feat_support_aws_ecr_private_container_registry_based_on_postgresql_ to main September 30, 2024 15:51
@kyujin-cho kyujin-cho force-pushed the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch from 379316c to ab67717 Compare September 30, 2024 15:57
Copy link
Member

Merge activity

  • Sep 30, 11:57 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 daed56c Sep 30, 2024
21 checks passed
@kyujin-cho kyujin-cho deleted the topic/08-07-feat_replace_rescan_command_s_--local_flag_with_local_container_registry_record branch September 30, 2024 16:04
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:cli Related to CLI component comp:manager Related to Manager component size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocalDockerDaemon container registry type for ease of development/single-node setup
2 participants