-
Notifications
You must be signed in to change notification settings - Fork 179
fix: use root_dir in save_to_oci_registry for correct OCI layer structure #2552
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -393,12 +393,9 @@ def save_to_oci_registry( # noqa: C901 ( complex args >8 ) | |
| if auth_file is not None: | ||
| params["authfile"] = auth_file.name | ||
| backend_def.pull(base_image, local_image_path, **params) | ||
| # Pass top-level entries (dir/*) instead of individual leaf files (dir/**/*). | ||
| # olot's tarball_from_file preserves subdirectory structure when given a | ||
| # directory, but flattens everything to basename when given individual files. | ||
| model_path = Path(model_files_path) | ||
| files = [model_path] if model_path.is_file() else sorted(model_path.iterdir()) | ||
| oci_layers_on_top(local_image_path, files, modelcard) | ||
| # Extract the absolute path from the files found in the path | ||
| files = [file[0] for file in _get_files_from_path(model_files_path)] # type: ignore[arg-type] | ||
| oci_layers_on_top(local_image_path, files, modelcard, root_dir=model_files_path) | ||
|
Comment on lines
+396
to
+398
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverts back to what we add originally here, before a mitigation: https://github.com/kubeflow/model-registry/pull/2498/changes#diff-cd394845b1d31bff2290364330b210311c758b6f0b10ce787adaf91f7d6a6010L396-R400 - oci_layers_on_top(local_image_path, files, modelcard)
+ oci_layers_on_top(local_image_path, files, modelcard, root_dir=model_files_path)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. love how simple it become |
||
| backend_def.push(local_image_path, oci_ref, **params) | ||
|
|
||
| # Return the OCI URI | ||
|
|
||
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.
Upgrade needed for
root_dirkwarg support inoci_layers_on_top