-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py(core): extend CLI to Push command
- Loading branch information
Showing
8 changed files
with
270 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Model Example", | ||
"description": "Lorem ipsum", | ||
"author": "John Doe", | ||
"accuracy": 0.987, | ||
"license": "Apache-2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from omlmd.helpers import Helper | ||
from omlmd.model_metadata import deserialize_mdfile | ||
import tempfile | ||
import json | ||
|
||
def test_call_push_using_md_from_file(mocker): | ||
helper = Helper() | ||
mocker.patch.object(helper, "push", return_value=None) | ||
|
||
md = { | ||
"name": "mnist", | ||
"description": "Lorem ipsum", | ||
"author": "John Doe", | ||
"accuracy": .987 | ||
} | ||
with tempfile.NamedTemporaryFile(delete=True, mode="w") as f: | ||
f.write(json.dumps(md)) | ||
f.flush() | ||
md = deserialize_mdfile(f.name) | ||
|
||
helper.push("localhost:8080/mmortari/ml-iris:v1", "some-file", **md) | ||
helper.push.assert_called_once_with( | ||
"localhost:8080/mmortari/ml-iris:v1", | ||
"some-file", | ||
name="mnist", | ||
description="Lorem ipsum", | ||
author="John Doe", | ||
accuracy=0.987 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters