Skip to content

Commit

Permalink
chore(client): forbid snapshot mechanism for model run in the workdir…
Browse files Browse the repository at this point in the history
… mode (#2299)
  • Loading branch information
tianweidut authored Jun 1, 2023
1 parent bcdcc74 commit 1b12903
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/starwhale/core/model/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,14 @@ def _recover(model: str, force: bool) -> None:
"-fs",
"--forbid-snapshot",
is_flag=True,
help="[ONLY STANDALONE]Forbid to use model run snapshot dir, use model src dir directly",
help="[ONLY STANDALONE]Forbid to use model run snapshot dir, use model src dir directly. When the `--workdir` option is set, this option will be ignored.",
)
@optgroup.option( # type: ignore[no-untyped-call]
"--cleanup-snapshot/--no-cleanup-snapshot",
is_flag=True,
default=True,
show_default=True,
help="[ONLY STANDALONE]Cleanup snapshot dir after model run",
help="[ONLY STANDALONE]Cleanup snapshot dir after model run. When the `--workdir` option is set, this option will be ignored.",
)
@optgroup.option( # type: ignore[no-untyped-call]
"--resource-pool",
Expand Down Expand Up @@ -553,6 +553,11 @@ def _run(
docker_image=image,
)
else:
if workdir:
# when workdir is set, snapshot mechanism is forbidden.
forbid_snapshot = True
cleanup_snapshot = False

ModelTermView.run_in_host(
model_src_dir=model_src_dir,
model_config=model_config,
Expand Down

0 comments on commit 1b12903

Please sign in to comment.