28 lines
786 B
Python
28 lines
786 B
Python
|
|
from fastapi import FastAPI
|
||
|
|
from fastapi.staticfiles import StaticFiles
|
||
|
|
from fastapi.responses import FileResponse
|
||
|
|
from routers import experiments, runs, serve, train
|
||
|
|
|
||
|
|
app = FastAPI(
|
||
|
|
title="MLflow Dashboard API",
|
||
|
|
description="MLflow Experiment/Run 조회 및 Train/Serve 관리",
|
||
|
|
version="0.1.0",
|
||
|
|
)
|
||
|
|
|
||
|
|
app.include_router(experiments.router, prefix="/api", tags=["Experiments"])
|
||
|
|
app.include_router(runs.router, prefix="/api", tags=["Runs"])
|
||
|
|
app.include_router(serve.router, prefix="/api", tags=["Serve"])
|
||
|
|
app.include_router(train.router, prefix="/api", tags=["Train"])
|
||
|
|
|
||
|
|
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||
|
|
|
||
|
|
|
||
|
|
@app.get("/")
|
||
|
|
def index():
|
||
|
|
return FileResponse("static/index.html")
|
||
|
|
|
||
|
|
|
||
|
|
@app.get("/health")
|
||
|
|
def health():
|
||
|
|
return {"status": "ok"}
|