Commit 87fa3c4e authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

mlflow-server: 2.14.3 -> 2.16.2

parent 8f7e9e23
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
{ 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 = ''