Skip to content

Commit

Permalink
mlflow-server: 2.14.3 -> 2.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Oct 8, 2024
1 parent 8f7e9e2 commit 87fa3c4
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pkgs/servers/mlflow-server/default.nix
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{ python3, writeText}:
{ python3Packages, writers}:

let
py = python3.pkgs;
py = python3Packages;

gunicornScript = writers.writePython3 "gunicornMlflow" {} ''
import re
import sys
from gunicorn.app.wsgiapp import run
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', ''', sys.argv[0])
sys.exit(run())
'';
in
py.toPythonApplication
(py.mlflow.overridePythonAttrs(old: rec {
(py.mlflow.overridePythonAttrs(old: {

propagatedBuildInputs = old.propagatedBuildInputs ++ [
propagatedBuildInputs = old.dependencies ++ [
py.boto3
py.mysqlclient
];

postPatch = (old.postPatch or "") + ''
substituteInPlace mlflow/utils/process.py --replace \
"child = subprocess.Popen(cmd, env=cmd_env, cwd=cwd, universal_newlines=True," \
"cmd[0]='$out/bin/gunicornMlflow'; child = subprocess.Popen(cmd, env=cmd_env, cwd=cwd, universal_newlines=True,"
'';
cat mlflow/utils/process.py
gunicornScript = writeText "gunicornMlflow"
''
#!/usr/bin/env python
import re
import sys
from gunicorn.app.wsgiapp import run
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', ''', sys.argv[0])
sys.exit(run())
'';
substituteInPlace mlflow/utils/process.py --replace-fail \
"process = subprocess.Popen(" \
"cmd[0]='${gunicornScript}'; process = subprocess.Popen("
'';

postInstall = ''
gpath=$out/bin/gunicornMlflow
Expand Down

0 comments on commit 87fa3c4

Please sign in to comment.