Skip to content

Commit

Permalink
add ca cert support for pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybart1337 committed Feb 22, 2024
1 parent 1cfcc74 commit e13e8c5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion agent/worker/task_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ def _exec_command(self, command, add_envs=None, container_id=None):
"PYTHONUNBUFFERED": "1",
constants._HTTP_PROXY: constants.HTTP_PROXY(),
constants._HTTPS_PROXY: constants.HTTPS_PROXY(),
constants._NO_PROXY: constants.NO_PROXY(),
"HOST_TASK_DIR": self.dir_task_host,
"TASK_ID": self.info["task_id"],
"SERVER_ADDRESS": self.info["server_address"],
Expand Down Expand Up @@ -602,8 +603,14 @@ def install_pip_requirements(self, container_id=None):
"Installing app requirements...", 1, ext_logger=self.logger
)
progress_dummy.iter_done_report()

install_cmd_str = "pip3 install"

if constants.SLY_EXTRA_CA_CERTS() and os.path.exists(constants.SLY_EXTRA_CA_CERTS()):
install_cmd_str += f" --cert {constants.SLY_EXTRA_CA_CERTS_FILEPATH()}"

# --root-user-action=ignore
command = "pip3 install --disable-pip-version-check -r " + os.path.join(
command = f"{install_cmd_str} --disable-pip-version-check -r " + os.path.join(
self.dir_task_src_container, self._requirements_path_relative
)
self.logger.info(f"PIP command: {command}")
Expand Down

0 comments on commit e13e8c5

Please sign in to comment.