Skip to content

Commit

Permalink
pip install check bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybart1337 committed Feb 21, 2024
1 parent 901ccd2 commit 7082c69
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions agent/worker/task_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,6 @@ 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 @@ -611,8 +609,12 @@ 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")

pip_install_exec_info = self._docker_api.api.exec_inspect(self._exec_id)

if pip_install_exec_info['ExitCode'] != 0:
raise RuntimeError("Pip install failed")

self.logger.info("Requirements are installed")

def main_step(self):
Expand Down

0 comments on commit 7082c69

Please sign in to comment.