mlflow-server / app.py
MoritzLaurer's picture
update app.py
a9b4192
raw
history blame
578 Bytes
import os
import subprocess
if __name__ == "__main__":
# Ensure the /data directory exists
os.makedirs("/data/mlruns", exist_ok=True)
os.makedirs("/data", exist_ok=True)
# Optional: Set permissions (be cautious with permissions in production)
os.chmod("/data", 0o777)
os.chmod("/data/mlruns", 0o777)
# Start the MLflow server
subprocess.run([
"mlflow", "server",
"--backend-store-uri", "sqlite:////data/mlflow.db",
"--default-artifact-root", "/data/mlruns",
"--host", "0.0.0.0",
"--port", "7860"
])