harupy / mlflow

Open source platform for the machine learning lifecycle
https://mlflow.org
Apache License 2.0
0 stars 1 forks source link

[BUG] #43

Open harupy opened 2 years ago

harupy commented 2 years ago

Willingness to contribute

Yes. I can contribute a fix for this bug independently.

System information

Describe the problem

a

Steps to reproduce the bug

b

Code to generate data required to reproduce the bug

No response

Is the console panel showing errors relevant to the bug?

No response

Does the network panel contain failed requests relevant to the bug?

# Request URL
http://localhost:5000/ajax-api/2.0/preview/mlflow/xxx/yyy

# Status Code
400

# Payload
{"a": 0}

# Response
{"b": 1}
harupy commented 2 years ago

FROM python:3.5.2

RUN pip install -U pip==18.1 RUN pip --version RUN pip install mlflow==0.6.0 protobuf==3.17.3 RUN python -c "import mlflow"

harupy commented 2 years ago

RUN apt update -y RUN apt install -y software-properties-common curl RUN add-apt-repository ppa:deadsnakes/ppa RUN apt install -y python3.7 python3.7-distutils RUN python3.7 --version RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py RUN python3.7 get-pip.py RUN pip

harupy commented 2 years ago
image
harupy commented 2 years ago
image
harupy commented 2 years ago
diff --git a/setup.py b/setup.py
index 8d73781b0..2679c8296 100644
--- a/setup.py
+++ b/setup.py
@@ -21,6 +21,27 @@ def package_files(directory):
     return paths

+from pathlib import Path
+import subprocess
+from wheel import bdist_wheel
+
+
+class bdist_wheel(bdist_wheel.bdist_wheel):
+    def run(self):
+        if "MLFLOW_BUILD_UI" in os.environ:
+            cmd = """
+set -ex
+
+yarn install
+yarn build
+"""
+            subprocess.run(
+                ["bash", "-c", cmd],
+                cwd=Path(__file__).parent.joinpath("mlflow", "server", "js"),
+            )
+        super().run()
+
+
 # Prints out a set of paths (relative to the mlflow/ directory) of files in mlflow/server/js/build
 # to include in the wheel, e.g. "../mlflow/server/js/build/index.html"
 js_files = package_files("mlflow/server/js/build")
@@ -162,6 +183,7 @@ setup(
         mlflow=mlflow.cli:cli
     """,
     cmdclass={
+        "bdist_wheel": bdist_wheel,
         "dependencies": ListDependencies,
         "min_python_version": MinPythonVersion,
     },