-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add manifest arch, os, and compressed layers size fields #1782
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of remarks:
- If we need to store the "architecture" and "os" fields on the Manifest model, we should try to fetch the values from a manifest list first. An OCI Index has the "architecture" and "os" fields required. There is no need to read the data from a config blob if a manifest is listed within an index (https://github.com/opencontainers/image-spec/blob/main/image-index.md#image-index-property-descriptions).
- Currently, there are three separate migrations. I would like to squash them. Every migration takes time to run some boilerplate which is transparent to us.
- Currently, there are three commits referencing the same issue. I would like to squash them. Such a separation is not necessary.
- If we decided to create another django-admin command, we should align with Katello to see if it makes sense for them to run a management command reading data from the storage.
CHANGES/1767.feature
Outdated
The Manifest model has been enhanced with a new: | ||
* `architecture` field, which specifies the CPU architecture for which the binaries in the | ||
image are designed to run. | ||
* `os` field, which specifies the operating system which the image is built to run on. | ||
* `compressed_layers_size` field, which specifies the sum of the sizes of all compressed layers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite wordy. We should stick to shorter changelog messages (see https://pulpproject.org/pulpcore/changes/ for reference). It is not necessary to describe every manifest field in detail.
pulp_container/app/management/commands/container-repair-manifest-metadatas.py
Outdated
Show resolved
Hide resolved
pulp_container/app/models.py
Outdated
@@ -103,6 +108,9 @@ class Manifest(Content): | |||
|
|||
annotations = models.JSONField(default=dict) | |||
labels = models.JSONField(default=dict) | |||
architecture = models.TextField(null=True) | |||
os = models.TextField(null=True) | |||
compressed_layers_size = models.TextField(null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to use IntegerField
here?
From the Katello side, we're okay with the command being the same as before or a new one. Choose whatever is most efficient from the Pulp side. |
Also I wanted to clarify to be super sure -- OCI Image Index manifests will always have a |
Thank you for bringing this! |
After re-reading the specs, I realized that So, please, ignore my last comment and yes, "OCI Image Index manifests will always have a null arch, OS, and size". |
Nice catch! I didn't notice it was under manifests, so that's perfect. |
c6cc26f
to
27cfe78
Compare
I did some investigation in each workflow, and here are my findings:
I couldn't find how to fetch these values from the manifest list in advance. I'm not sure if I overlooked something or misunderstood the code workflow. |
|
27cfe78
to
c7816f8
Compare
Thank you for the help and the suggestions/optimizations! |
c7816f8
to
8b53a1e
Compare
ef816f0
to
c152cf4
Compare
cc @sjha4 @qcjames53 we should keep an eye on this and integrate with it in Katello sooner rather than later to avoid excess reindexing of container manifests. |
c152cf4
to
8f390fa
Compare
@@ -103,6 +108,9 @@ class Manifest(Content): | |||
|
|||
annotations = models.JSONField(default=dict) | |||
labels = models.JSONField(default=dict) | |||
architecture = models.TextField(null=True) | |||
os = models.TextField(null=True) | |||
compressed_layers_size = models.IntegerField(null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about compressed_image_size
closes: #1767