-
Notifications
You must be signed in to change notification settings - Fork 21
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 SBOM generator for ModelCar OCI images #252
base: main
Are you sure you want to change the base?
Conversation
25bfa1c
to
a2755ac
Compare
/ok-to-test |
@@ -0,0 +1,234 @@ | |||
import argparse |
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.
modelcars aren't yet a well known thing. I can imagine someone coming across this script later outside the context of your usage with olot
and saying "what!?".
Can you provide a brief docstring at the top of the script explaining what modelcars are and a link to more upstream information about them?
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.
Also, please - a short paragraph explaining why the two arguments (model image and base image) are sufficient to faithfully create an SBOM of the modelcar.
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.
Thanks for the review, I've added a docstring with the description
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.
I am a little wary of using links in the dosctrings. Links can die and I don't think it's necessary to link whole blog posts since those could be looked up by anyone interested enough anyway.
I imagine that a short paragraph describing it would work better instead of expecting someone to go through the links
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.
@tnevrlka's opinion trumps mine here!
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.
I have refactored the contents of the docstring to remove the links from it and to provide a succinct explanation of what a ModelCar is and what is the purpose of the script. The contents now match those of the help function output
a2755ac
to
171b0e9
Compare
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.
I have a similar concern as Ralph.
I believe it would be great to write a description and motivation behind the change into the commit message(s) and PR description.
I would also prefer to avoid references to Red Hat's internal Jira.
At this moment, I don't understand why this change is being proposed and would appreciate clarification. Thank you!
--model-image Model OCI artifact reference resolved to digest (e.g., quay.io/foo/model_image@sha256:abcdef1234567890... | ||
--sbom-type SBOM report format [CycloneDX, SPDX] - Optional, default: CycloneDX | ||
-o, --output-file Output file path | ||
""" |
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.
nitpick: you don't need to write such a long docstring. Instead, using the argparse API to set program description and arguments description, then, -h
will print the whole description.
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.
Thanks for the suggestion, it makes sense. I've accordingly updated the docstring to match the output of the help function, and refactored the former contents using the Argparse API as suggested.
} | ||
] | ||
}, | ||
{ |
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.
To represent that "aipcc/modelcar-image" descends from both "aipcc/base-image" and "aipcc/model-image", I wonder if the structure ought to be like:
"components": {
{
"type": "container",
"name": "aipcc-modelcar-image",
...
"components": [
{
"type": "container",
"name": "aipcc/base-image",
...
},
{
"type": "container",
"name": "aipcc/model-image",
...
}
]
}
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.
I've updated the structure to accommodate the suggestion, please could you review it again?
/ok-to-test |
- close AIPCC-574
Thanks for the review. I have updated the docstring following the review comments, to expand on the nature of the script and its context. I have also updated title and description of the PR to remove any external references to internal JIRA projects, and to provide details about what this script is meant to used for and why is it required. I hope this changes help clarifying the PR's motivation. |
171b0e9
to
fb17c3c
Compare
/ok-to-test |
"components": [ | ||
{ | ||
|
||
"type": "container", |
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.
Minor: indentation looks off
This adds a helper script to generate SBOM reports for ModelCar image.
A ModelCar is a containerized approach to deploying machine learning models. It involves packaging
model artifacts within a container image, enabling efficient and standardized deployment in
Kubernetes environments, used as Sidecar containers (secondary containers that run alongside the
main application container within the same Pod)
This is a helper script that is used in the ModelCar task introduced with konflux-ci/build-definitions#2038, to produce the necessary SBOM report.