Skip to content

Commit

Permalink
Add stages to mlcube submit command
Browse files Browse the repository at this point in the history
  • Loading branch information
aristizabal95 committed Oct 25, 2024
1 parent 2a73d0d commit bf94b55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cli/medperf/commands/mlcube/mlcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ def submit(
help="Identifier to download the image file. See the description above",
),
image_hash: str = typer.Option("", "--image-hash", help="hash of image file"),
stages_file: str = typer.Option(
"",
"--stages-file",
"-s",
help="Identifier to download the stages file. See the description above"
),
stages_hash: str = typer.Option("", "--stages-hash", help="Hash of the stages file"),
operational: bool = typer.Option(
False,
"--operational",
Expand All @@ -99,6 +106,7 @@ def submit(
- parameters_file\n
- additional_file\n
- image_file\n
- stages_file\n
are expected to be given in the following format: <source_prefix:resource_identifier>
where `source_prefix` instructs the client how to download the resource, and `resource_identifier`
is the identifier used to download the asset. The following are supported:\n
Expand All @@ -117,6 +125,8 @@ def submit(
"image_tarball_hash": image_hash,
"additional_files_tarball_url": additional_file,
"additional_files_tarball_hash": additional_hash,
"stages_url": stages_file,
"stages_hash": stages_hash,
"state": "OPERATION" if operational else "DEVELOPMENT",
}
SubmitCube.run(mlcube_info)
Expand Down
5 changes: 5 additions & 0 deletions cli/medperf/entities/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ def download_config_files(self):
except InvalidEntityError as e:
raise InvalidEntityError(f"MLCube {self.name} parameters file: {e}")

try:
self.download_stages()
except InvalidEntityError as e:
raise InvalidEntityError(f"MLCube {self.name} stages file: {e}")

def download_run_files(self):
try:
self.download_additional()
Expand Down

0 comments on commit bf94b55

Please sign in to comment.