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

SOCI artifacts lifecycle policy #2

Open
henryhoang1982 opened this issue Apr 14, 2024 · 7 comments
Open

SOCI artifacts lifecycle policy #2

henryhoang1982 opened this issue Apr 14, 2024 · 7 comments

Comments

@henryhoang1982
Copy link

SOCI artifacts are created along with base image like below picture, I have ECR Lifecyle rules applied on our base image with filtering via TagPrefixes and I want to add same tags to these SOCI artifacts so that they will go with same lifecycle as their base image. Is there anyway to support tagging when calling soci-wrapper CLI?
image

@tmokmss
Copy link
Owner

tmokmss commented Apr 15, 2024

Hi @henryhoang1982, thanks for the feature request. I'll look into how we can achieve this.

One clarifying question: is specifying a tag prefix enough for you? i.e. your image tag looks like [tag-prefix-you-prefer]-[someHash].

@henryhoang1982
Copy link
Author

henryhoang1982 commented Apr 15, 2024

Hi @tmokmss , it should be fine or you can tag the Soci Index like Image Index, the one with sha256-<baseImageDIgest>. It's even better that you can add the same tags as base Image since SOCI stuffs would exist along the base image.

@henryhoang1982
Copy link
Author

Hi @henryhoang1982, thanks for the feature request. I'll look into how we can achieve this.

One clarifying question: is specifying a tag prefix enough for you? i.e. your image tag looks like [tag-prefix-you-prefer]-[someHash].

Hi @tmokmss , is there any luck for this new feature?

@tmokmss
Copy link
Owner

tmokmss commented Apr 18, 2024

Hi @henryhoang1982, I submitted an inquiry about this feature here: awslabs/soci-snapshotter#1183

We push an index to ECR in the below code, so maybe we can add tags here. I'm still not quite familiar with the oras package though.

func (registry *Registry) Push(ctx context.Context, sociStore *store.SociStore, indexDesc ocispec.Descriptor, repositoryName string) error {
log.Info(ctx, "Pushing artifact")
repo, err := registry.registry.Repository(ctx, repositoryName)
if err != nil {
return err
}
err = oras.CopyGraph(ctx, sociStore, repo, indexDesc, oras.DefaultCopyGraphOptions)

@henryhoang1982
Copy link
Author

@tmokmss do you think it should be here?
utils/registry/registry.go

@tmokmss
Copy link
Owner

tmokmss commented Apr 18, 2024

I'm afraid not. Isn't it a source image, not an index?

@henryhoang1982
Copy link
Author

sorry about the wrong link, I intended to share this link not the previous one
https://github.com/tmokmss/soci-wrapper/blob/main/main.go#L90

But I leave it to you to decide which should be changed since I am not familiar with the helper libraries too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants