-
Notifications
You must be signed in to change notification settings - Fork 67
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 save_to_oci_registry ptyhon client method #800
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
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 was added as a way to have the e2e tests include image download/upload. A registry is needed to perform the upload step, and so a local registry should be good enough to perform this test.
if backend == 'skopeo': | ||
from olot.backend.skopeo import is_skopeo, skopeo_pull, skopeo_push | ||
|
||
if not is_skopeo(): | ||
raise ValueError('skopeo is selected, but it is not present on the machine. Please validate the skopeo cli is installed and available in the PATH') | ||
|
||
skopeo_pull(base_image, local_image_path) | ||
oci_layers_on_top(local_image_path, model_files, modelcard) | ||
skopeo_push(dest_dir, oci_ref) | ||
|
||
elif backend == 'oras': | ||
from olot.backend.oras_cp import is_oras, oras_pull, oras_push | ||
if not is_oras(): | ||
raise ValueError('oras is selected, but it is not present on the machine. Please validate the oras cli is installed and available in the PATH') | ||
|
||
oras_pull(base_image, local_image_path) | ||
oci_layers_on_top(local_image_path, model_files, modelcard) | ||
oras_push(local_image_path, oci_ref) |
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 chose not to abstract this away into an interface/facade because the steps are very straightforward, and i think it would over-engineer what is effectively calling 3 separate functions.
If olot
supports more backends, this will probably need to be refactored to include an interface of some kind.
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, but as in #800 (comment)
I would consider passing to a monkeypatched method all params, so that at least we steer users to a provider mechanism of sort
@@ -27,9 +27,11 @@ nest-asyncio = "^1.6.0" | |||
eval-type-backport = "^0.2.0" | |||
|
|||
huggingface-hub = { version = ">=0.20.1,<0.29.0", optional = true } | |||
olot = { version = "^0.1.2", optional = 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.
This is following the same pattern by huggingface-hub
above. This particular dependency is optional because if you choose not to use this new "save" method, you would never need this dependency. The README was updated to reflect this
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.
+1
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
f606e01
to
b0dba7b
Compare
Signed-off-by: Eric Dobroveanu <[email protected]>
40dec90
to
2678e81
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.
some early comment, thank you @Crazyglue
@@ -27,9 +27,11 @@ nest-asyncio = "^1.6.0" | |||
eval-type-backport = "^0.2.0" | |||
|
|||
huggingface-hub = { version = ">=0.20.1,<0.29.0", optional = true } | |||
olot = { version = "^0.1.2", optional = 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.
+1
…ders Signed-off-by: Eric Dobroveanu <[email protected]>
4554ce2
to
51a7812
Compare
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
b8e68e6
to
9795f0b
Compare
9795f0b
to
7fb8bef
Compare
Signed-off-by: Eric Dobroveanu <[email protected]>
7fb8bef
to
47a7b88
Compare
Signed-off-by: Eric Dobroveanu <[email protected]>
Signed-off-by: Eric Dobroveanu <[email protected]>
3287526
to
37b60e4
Compare
Signed-off-by: Eric Dobroveanu <[email protected]>
37b60e4
to
0fcdde7
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.
/lgtm
reviewed at a high level, and I don't see any red flags
@tarilabs will have to approve to merge this initial version
@dhirajsb: changing LGTM is restricted to collaborators In response to this:
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/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dhirajsb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This PR aims to add a helper method to the python client to append a set of files to a given oci-compatible container image. In the future this method will be used as a part of the PR found here: #761 which aims to provide yet another helper method that will both upload and register a model to the MR.
With this PR and the one mentioned above, the use case for the client (after training) is to simply call 1 method to both push the newly trained model to a storage location AND register that newly trained model in the MR. Removing a number of manual steps that would have to be done separately as a part of a standard DS flow.
How Has This Been Tested?
Added an E2E test and validated that they run. The E2E test uses a local registry to upload test-images to.
The local environment will need to at a minimum install skopeo on the system (for MacOS and Brew, this means running
brew install skopeo
).Merge criteria:
DCO
check)If you have UI changes