-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WIP] store: extract artifact layers automatically #9150
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sohankunkerkar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
301df78
to
8d4f6fc
Compare
8d4f6fc
to
9b2aa2c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9150 +/- ##
==========================================
- Coverage 47.00% 46.83% -0.17%
==========================================
Files 161 161
Lines 23634 23732 +98
==========================================
+ Hits 11108 11115 +7
- Misses 11426 11515 +89
- Partials 1100 1102 +2 🚀 New features to boost your workflow:
|
Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
9b2aa2c
to
7c7c360
Compare
@@ -75,7 +75,7 @@ ARTIFACT_IMAGE="$ARTIFACT_REPO:singlefile" | |||
crictl inspecti "${imageId:0:12}" | |||
|
|||
# shortname | |||
crictl inspecti crio/artifact:singlefile | |||
crictl inspecti sohankunkerkar/artifact:singlefile |
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.
$ oras manifest fetch quay.io/sohankunkerkar/artifact:singlefile --pretty
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactType": "application/vnd.oci.empty.v1+json",
"config": {
"mediaType": "application/vnd.oci.empty.v1+json",
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size": 2,
"data": "e30="
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar",
"digest": "sha256:a77e1fdc58b9e6eb5f240aec21015ea9ebaaed5c5fa0f3efa169fd9d64a7bf29",
"size": 10240,
"annotations": {
"org.opencontainers.image.title": "artifact.txt"
}
}
],
"annotations": {
"org.opencontainers.image.created": "2025-04-24T02:37:33Z"
}
}
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.
For multiple-files:
oras manifest fetch quay.io/sohankunkerkar/artifact:multiplefiles --pretty
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactType": "application/vnd.oci.empty.v1+json",
"config": {
"mediaType": "application/vnd.oci.empty.v1+json",
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size": 2,
"data": "e30="
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar",
"digest": "sha256:a77e1fdc58b9e6eb5f240aec21015ea9ebaaed5c5fa0f3efa169fd9d64a7bf29",
"size": 10240,
"annotations": {
"org.opencontainers.image.title": "artifact.txt"
}
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar",
"digest": "sha256:b1f4119972d3636a5f27f91149d45c5e3021b10642c72f83fac30c4e69bd674f",
"size": 10240,
"annotations": {
"org.opencontainers.image.title": "artifact.sh"
}
}
],
"annotations": {
"org.opencontainers.image.created": "2025-04-24T03:47:13Z"
}
}
@@ -479,35 +483,113 @@ func (s *Store) BlobMountPaths(ctx context.Context, artifact *Artifact, sys *typ | |||
return nil, fmt.Errorf("failed to get an image reference: %w", err) | |||
} | |||
|
|||
extractDir := filepath.Join(s.rootPath, "extracted", artifact.Digest().Encoded()) |
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.
unsure about this. is this a convention? is there a convention? seems odd to hardcode the path but I'm unsure about the alternative
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.
Yeah, I tried changing that logic. Let me know how it feels.3c63062
Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
cae7201
to
3c72ebb
Compare
3c72ebb
to
5e31981
Compare
5e31981
to
073e951
Compare
Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
073e951
to
3c63062
Compare
} | ||
defer blob.Close() | ||
|
||
content, err := s.processLayerContent(l.MediaType, blob) |
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 wonder which is better extracting when pulling or when mounting.
Images are extracted when it's pulled, aren't they? I think it'd be better to align with images.
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Once we build the consensus on the approach, I will push this to the
crio
quay repo if feasible.What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #9132
Special notes for your reviewer:
Does this PR introduce a user-facing change?