Skip to content

Commit

Permalink
support custom pip in mlflow server
Browse files Browse the repository at this point in the history
  • Loading branch information
ttapjinda authored and seldondev committed Jun 20, 2020
1 parent 79ca088 commit 4c6cbf0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions servers/mlflowserver/mlflowserver/conda_env_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def inject_base_reqs(env_file_path):
if "dependencies" not in conda_env:
conda_env["dependencies"] = []

new_entry = {"pip": [f"-r {BASE_REQS_PATH}"]}
conda_env["dependencies"].append(new_entry)
dependency = next((dep for dep in conda_env["dependencies"] if "pip" in dep), None)
if dependency is not None:
dependency["pip"].append(f"-r {BASE_REQS_PATH}")
else:
new_entry = {"pip": [f"-r {BASE_REQS_PATH}"]}
conda_env["dependencies"].append(new_entry)

temp_dir = tempfile.mkdtemp()
new_env_path = os.path.join(temp_dir, "conda.yaml")
Expand Down

0 comments on commit 4c6cbf0

Please sign in to comment.