Skip to content

Commit 44a95c7

Browse files
committed
start mlflow server
1 parent d775966 commit 44a95c7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

jupyter_scheduler/scheduler.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import random
44
import shutil
5+
import subprocess
56
from typing import Dict, Optional, Type, Union
67

78
import fsspec
@@ -342,6 +343,22 @@ class Scheduler(BaseScheduler):
342343

343344
task_runner = Instance(allow_none=True, klass="jupyter_scheduler.task_runner.BaseTaskRunner")
344345

346+
def start_mlflow_server(self):
347+
subprocess.Popen(
348+
[
349+
"mlflow",
350+
"server",
351+
"--backend-store-uri",
352+
"./mlruns",
353+
"--default-artifact-root",
354+
"./mlartifacts",
355+
"--host",
356+
"0.0.0.0",
357+
"--port",
358+
"5000",
359+
]
360+
)
361+
345362
def __init__(
346363
self,
347364
root_dir: str,
@@ -357,6 +374,8 @@ def __init__(
357374
if self.task_runner_class:
358375
self.task_runner = self.task_runner_class(scheduler=self, config=config)
359376

377+
self.start_mlflow_server()
378+
360379
@property
361380
def db_session(self):
362381
if not self._db_session:

0 commit comments

Comments
 (0)