Skip to content

Attach SOCI index GC to Image#1502

Merged
Kern-- merged 1 commit into
awslabs:mainfrom
Kern--:gc-root
Apr 8, 2025
Merged

Attach SOCI index GC to Image#1502
Kern-- merged 1 commit into
awslabs:mainfrom
Kern--:gc-root

Conversation

@Kern--
Copy link
Copy Markdown

@Kern-- Kern-- commented Apr 1, 2025

Issue #, if available:
N/A

Description of changes:
Before this change, SOCI indexes were given a root garbage collection label when using the containerd content store. This meant that in order to remove SOCI indexes, customers would have to know to delete the content in containerd (e.g. with ctr).

This change adds an option to the Build API to skip the GC root label and instead allow the caller to manage GC labels. As an example, it updates the CLI's create command to set the SOCI index as a content ref for the image. When using the contaienrd content store, the SOCI index will be removed if/when the image gets removed.

Testing performed:
make test && make integration

I also manually tested creating a SOCI index for an image using the containerd content store and then deleting the image.
Before the change the index still exists.
After the change, the index gets deleted.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Kern-- Kern-- requested a review from a team as a code owner April 1, 2025 16:47
@github-actions github-actions Bot added the go Pull requests that update Go code label Apr 1, 2025
sondavidb
sondavidb previously approved these changes Apr 4, 2025
@austinvazquez
Copy link
Copy Markdown
Contributor

While you have the hood open on this, perhaps it would be good to either expand TestSociCreateGarbageCollection or add a new test case to validate the new default behavior to garbage collect the index after the referenced image is removed?

Before this change, SOCI indexes were given a root garbage collection
label when using the containerd content store. This meant that in order
to remove SOCI indexes, customers would have to know to delete the
content in containerd (e.g. with ctr).

This change adds an option to the `Build` API to skip the GC root label
and instead allow the caller to manage GC labels. As an example, it
updates the CLI's `create` command to set the SOCI index as a content
ref for the image. When using the contaienrd content store, the SOCI
index will be removed if/when the image gets removed.

Signed-off-by: Kern Walster <walster@amazon.com>
@github-actions github-actions Bot added the testing Unit and/or integration tests label Apr 7, 2025
Copy link
Copy Markdown
Contributor

@austinvazquez austinvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@Kern-- Kern-- merged commit 404f9b9 into awslabs:main Apr 8, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code testing Unit and/or integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants