Deploy and manage open-source MLflow server on Databricks Apps with Unity Catalog integration for experiment tracking and model registry
Expert assistant for deploying and managing the open-source MLflow server on Databricks Apps, providing fully integrated MLflow experience with Databricks tracking backend and Unity Catalog model registry.
Helps you deploy, configure, and troubleshoot MLflow OSS on Databricks Apps, including:
**Tech Stack:**
**Storage:**
When user asks about the project, explain:
**Key Files:**
**How It Works:**
1. Deployment downloads MLflow UI assets from PyPI
2. Syncs all files to Databricks workspace
3. Startup copies UI assets to MLflow's expected location
4. MLflow server starts with Databricks backend configuration
5. Authenticates using Databricks service principal (automatic)
When user wants to set up the project:
```bash
./setup.sh
source .env.local && export DATABRICKS_HOST && export DATABRICKS_TOKEN
databricks current-user me
```
**For official MLflow release (PyPI):**
Guide user to update `pyproject.toml`:
```toml
dependencies = [
"mlflow>=3.0.0", # Latest MLflow 3.x from PyPI
"databricks-sdk>=0.33.0",
"gunicorn>=22.0.0",
]
```
**For custom MLflow branch (GitHub):**
Guide user to update `pyproject.toml`:
```toml
dependencies = [
"mlflow @ git+https://github.com/USERNAME/mlflow.git@BRANCH_NAME",
"databricks-sdk>=0.33.0",
"gunicorn>=22.0.0",
]
```
**After version change:**
```bash
uv run python scripts/generate_semver_requirements.py
nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &
tail -f /tmp/mlflow-deploy.log
```
**CRITICAL: ALWAYS use nohup for deployment** (takes 5-10+ minutes):
```bash
nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &
tail -f /tmp/mlflow-deploy.log
databricks apps list
source .env.local && export DATABRICKS_HOST && export DATABRICKS_TOKEN
databricks apps get mlflow-oss
```
**Never run `./deploy.sh` directly** - it will timeout or disconnect, leaving deployment in unknown state.
**Why deployment is slow:**
**Use `dba_logz.py` script for real-time log streaming:**
```bash
uv run python dba_logz.py https://YOUR-APP-URL --duration 30
uv run python dba_logz.py https://YOUR-APP-URL --search "ERROR\|Exception" --duration 60
uv run python dba_logz.py https://YOUR-APP-URL --search "Application startup\|Uvicorn running" --duration 60
uv run python dba_logz.py https://YOUR-APP-URL --duration 999999
```
**Note:** Browser logs available at `https://YOUR-APP-URL/logz` (requires OAuth).
```bash
uv run python dba_client.py https://YOUR-APP-URL/health
uv run python dba_client.py https://YOUR-APP-URL/api/2.0/mlflow/experiments/search POST '{}'
uv run python dba_client.py https://YOUR-APP-URL/
```
**UI Not Loading:**
1. Check `start_mlflow.sh` logs for UI asset copy errors
2. Verify MLflow version in `pyproject.toml` matches UI assets
3. Check application logs at `https://YOUR-APP-URL/logz`
**Experiments Not Showing:**
1. Verify `--backend-store-uri databricks` in `start_mlflow.sh`
2. Check service principal permissions in Databricks
3. Ensure `DATABRICKS_HOST` and `DATABRICKS_TOKEN` are set
**Model Registry Issues:**
1. Verify `--registry-store-uri databricks-uc` in `start_mlflow.sh`
2. Check Unity Catalog permissions for service principal
3. Ensure Unity Catalog is enabled in workspace
**Deployment Timing Out:**
1. Confirm you used `nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &`
2. Check log file: `tail -f /tmp/mlflow-deploy.log`
3. Wait 5-10 minutes for UI asset build to complete
1. **ALWAYS use `uv run python`** - Never run `python` directly
```bash
# ✅ CORRECT
uv run python script.py
# ❌ WRONG
python script.py
```
2. **ALWAYS deploy with nohup** - Never run `./deploy.sh` directly
```bash
# ✅ CORRECT
nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &
# ❌ WRONG
./deploy.sh
```
3. **Export environment variables for Databricks CLI:**
```bash
source .env.local && export DATABRICKS_HOST && export DATABRICKS_TOKEN
databricks apps list
```
4. **Don't edit `app.yaml`** - It's auto-generated by deployment script
5. **Don't commit UI assets** - They're downloaded automatically during deployment
**Automatically set by Databricks Apps:**
**In `.env.local` (for local CLI):**
**Scenario 1: Initial deployment**
```bash
./setup.sh
nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &
tail -f /tmp/mlflow-deploy.log
```
**Scenario 2: Switch to custom MLflow branch**
```bash
uv run python scripts/generate_semver_requirements.py
nohup ./deploy.sh > /tmp/mlflow-deploy.log 2>&1 &
tail -f /tmp/mlflow-deploy.log
```
**Scenario 3: Debug deployment issues**
```bash
uv run python dba_logz.py https://YOUR-APP-URL --search "ERROR" --duration 120
uv run python dba_client.py https://YOUR-APP-URL/health
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/deploy-mlflow-on-databricks-apps/raw