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

Fixes #37407 - reindex container manifests to populate label information #10988

Merged
merged 1 commit into from
May 16, 2024

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented May 7, 2024

What are the changes introduced in this pull request?

Considerations taken when implementing this change?

What are the testing steps for this pull request?

On a box with older pulp create a few docker repos with labels and annotations.
Upgrade your pulp.
Run the pulpcore container-handle-image-data migration
Run bundle exec rails katello:import_docker_manifest_labels and verify that katello manifests pull in all the new field info.

@ianballou
Copy link
Member

ianballou commented May 14, 2024

I did a performance test with 120 repositories and 26295 manifests:

[vagrant@centos8-stream-katello-4-12 ~]$ time sudo foreman-rake katello:import_docker_manifest_labels

real	23m44.868s
user	10m2.752s
sys	0m20.095s

For reference, the Pulp command took 7 minutes. It seems going over the API is a bit of an overhead for us.

Do you think there would be any benefit from only indexing manifests with media types application/vnd.docker.distribution.manifest.v2+json and application/vnd.oci.image.manifest.v1+json ?

In my environment, only 16776 of my 26295 were among the two manifest types above.


Edit: the 16776 were the only ones indexed into Katello, so it seems all of those media types were fair game.
The only media type we index that wouldn't have labels or annotations is application/vnd.docker.distribution.manifest.v1+json.

@ianballou
Copy link
Member

There also might be many manifests without labels or annotations -- I wonder if we could filter those out in Pulp somehow.

@ianballou
Copy link
Member

Looks like in Pulp we cannot filter by labels or annotations, so I think the only improvement we could do API-wise would be to ignore application/vnd.docker.distribution.manifest.v1+json manifests. But even in my case, that wouldn't have gained us any more performance.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Looking good now, just one small comment

Comment on lines 74 to 75
desc "Re-import all docker manifests to populate labels and annotations."
task :import_docker_manifest_labels => ["dynflow:client", "check_ping"] do
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about saying container manifest instead of docker manifest ? While our code still refers to docker, I think the public facing stuff could all say container.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@sjha4 sjha4 merged commit 62ad4c5 into Katello:master May 16, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants