From a35a2806db517f2a8db0a6ca0e9729690ba92cf1 Mon Sep 17 00:00:00 2001 From: tbenst Date: Mon, 6 Jan 2020 15:59:25 -0800 Subject: mlflow-server: init at 1.4.0 --- pkgs/servers/mlflow-server/default.nix | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/servers/mlflow-server/default.nix (limited to 'pkgs/servers/mlflow-server') diff --git a/pkgs/servers/mlflow-server/default.nix b/pkgs/servers/mlflow-server/default.nix new file mode 100644 index 0000000000000..eb99fffeb169e --- /dev/null +++ b/pkgs/servers/mlflow-server/default.nix @@ -0,0 +1,37 @@ +{lib, python3, writeText}: + +let + py = python3.pkgs; +in +py.toPythonApplication + (py.mlflow.overridePythonAttrs(old: rec { + pname = "mlflow-server"; + + propagatedBuildInputs = old.propagatedBuildInputs ++ [ + py.boto3 + py.mysqlclient + ]; + + postPatch = '' + 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," + ''; + + 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()) + ''; + + postInstall = '' + gpath=$out/bin/gunicornMlflow + cp ${gunicornScript} $gpath + chmod 555 $gpath + ''; +})) \ No newline at end of file -- cgit 1.4.1