Skip to content

Commit

Permalink
raise if pip isntall failed (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiPetukhov authored Feb 20, 2024
1 parent 30b6ab3 commit 901ccd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/worker/task_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ def _exec_command(self, command, add_envs=None, container_id=None):
},
)
self._logs_output = self._docker_api.api.exec_start(self._exec_id, stream=True)
exec_info = self._docker_api.api.exec_inspect(self._exec_id)
self._exit_code = exec_info["ExitCode"]

def exec_command(self, add_envs=None, command=None):
add_envs = sly.take_with_default(add_envs, {})
Expand Down Expand Up @@ -609,6 +611,8 @@ def install_pip_requirements(self, container_id=None):
self.logger.info(f"PIP command: {command}")
self._exec_command(command, add_envs=self.main_step_envs(), container_id=container_id)
self.process_logs()
if self._exit_code != 0:
raise RuntimeError("Pip install failed")
self.logger.info("Requirements are installed")

def main_step(self):
Expand Down

0 comments on commit 901ccd2

Please sign in to comment.