Initial commit: MLflow dashboard project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
23
routers/runs.py
Normal file
23
routers/runs.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from fastapi import APIRouter, Query
|
||||
from typing import Optional
|
||||
from schemas import RunDetail, MLflowLink
|
||||
from services import mlflow_service
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/runs/{run_id}", response_model=RunDetail)
|
||||
def get_run(
|
||||
run_id: str,
|
||||
tracking_uri: Optional[str] = Query(None, description="MLflow Tracking URI"),
|
||||
):
|
||||
return mlflow_service.get_run_detail(tracking_uri, run_id)
|
||||
|
||||
|
||||
@router.get("/runs/{run_id}/mlflow-link", response_model=MLflowLink)
|
||||
def get_mlflow_link(
|
||||
run_id: str,
|
||||
tracking_uri: Optional[str] = Query(None, description="MLflow Tracking URI"),
|
||||
):
|
||||
url = mlflow_service.get_mlflow_link(tracking_uri, run_id)
|
||||
return {"url": url}
|
||||
Reference in New Issue
Block a user