Skip to content

Commit

Permalink
bug(client): fix builtin runtime run error (#2462)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianweidut authored Jul 6, 2023
1 parent 67f8fec commit f033f77
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions client/starwhale/core/runtime/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ def run(self) -> None:
clear_positions.append(i)
break

if not clear_positions:
raise RuntimeError(f"no runtime specified: {argv}")

for p in clear_positions[::-1]:
argv.pop(p)

Expand Down
4 changes: 0 additions & 4 deletions client/tests/core/test_runtime_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ def test_run_exceptions(
with patch.object(sys, "argv", []):
Process(uri).run()

with self.assertRaisesRegex(RuntimeError, "no runtime specified"):
with patch.object(sys, "argv", ["swcli", "model"]):
Process(uri).run()

with self.assertRaisesRegex(
NoSupportError, "run process with cloud instance uri"
):
Expand Down
5 changes: 2 additions & 3 deletions scripts/client_test/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_simple(self) -> None:
workdir = f"{self._work_dir}/scripts/example"
venv_runtime_uri = self.build_runtime(workdir)
conda_runtime_uri = self.build_runtime(workdir, "runtime_conda.yaml")
model_uri = self.build_model(workdir, "simple", "simple-test")
model_uri = self.build_model(workdir, "simple", runtime=str(venv_runtime_uri))
dataset_uri = self.build_dataset("simple", workdir, DatasetExpl("", ""))

if self.server_url:
Expand All @@ -309,7 +309,7 @@ def test_simple(self) -> None:
remote_job_ids = self.run_model_in_server(
dataset_uris=[dataset_uri],
model_uri=model_uri,
runtime_uris=[venv_runtime_uri]
runtime_uris=[conda_runtime_uri]
if "simple" not in BUILT_IN_EXAMPLES
else [None],
run_handler=run_handler,
Expand All @@ -319,7 +319,6 @@ def test_simple(self) -> None:
dataset_uris=[dataset_uri],
model_uri=model_uri,
run_handler=run_handler,
runtime_uris=[conda_runtime_uri],
)

futures = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e_test/start_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ client_test() {
unset https_proxy
bash scripts/client_test/cli_test.sh all
else
timeout 15m bash scripts/client_test/cli_test.sh simple || exit 1
timeout 20m bash scripts/client_test/cli_test.sh simple || exit 1
fi
popd
popd
Expand Down

0 comments on commit f033f77

Please sign in to comment.