Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,57 @@ jobs:
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code

app:
# The UCX Databricks App: type-check and build the frontend, then build the wheel and check that it contains the
# app. Release builds must run `make build` the same way, see docs/ucx/docs/dev/contributing.mdx.
runs-on:
group: databrickslabs-protected-runner-group
labels: linux-ubuntu-latest
permissions:
# Authenticate with JFrog for package resolution.
id-token: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
version: "0.13.7"
checksum: "c5221ff41b7892bfc223543883600125f6a47fe845093e0f5bdff4f359196d83"

- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "26"

- name: Setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: "9.15.9"

# After the tools: it configures npm (and so pnpm) for JFrog, with ignore-scripts=true.
- name: Setup for JFrog
uses: ./.github/actions/jfrog-auth

- name: Type-check the frontend
working-directory: app-ui
run: |
pnpm install --frozen-lockfile
pnpm typecheck

- name: Build the wheel with the app
run: make build

- name: Check that the wheel contains the app
run: |
set -euo pipefail
wheel="$(ls dist/databricks_labs_ucx-*-py3-none-any.whl)"
for required in databricks/labs/ucx/app/static/index.html databricks/labs/ucx/app/bundle/requirements.txt \
databricks/labs/ucx/app/bundle/databricks.yml databricks/labs/ucx/app/bundle/app.yaml; do
if ! unzip -l "$wheel" "$required" > /dev/null; then
printf '::error::%s\n' "$wheel is missing $required"
exit 1
fi
done
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,7 @@ dev/cleanup.py
.databricks-login.json
*.out
foo

# UCX app frontend, built by `make app-ui`
src/databricks/labs/ucx/app/static/
src/databricks/labs/ucx/app/bundle/requirements.txt
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ coverage:
$(UV_TEST) --cov src tests/unit --cov-report=html --cov-fail-under=89
open htmlcov/index.html

build:
# The app frontend is a static export, built into the Python package so that it ships in the wheel.
APP_UI_STATIC := src/databricks/labs/ucx/app/static

app-ui:
cd app-ui && pnpm install --frozen-lockfile && NEXT_TELEMETRY_DISABLED=1 pnpm build
rm -rf $(APP_UI_STATIC)
cp -R app-ui/out $(APP_UI_STATIC)

# Hashed requirements of the app, from uv.lock: `deploy-app` installs exactly these in the app environment.
APP_REQUIREMENTS := src/databricks/labs/ucx/app/bundle/requirements.txt

app-requirements:
uv export --frozen --extra app --no-default-groups --no-emit-project --no-header --no-annotate \
--format requirements-txt --output-file $(APP_REQUIREMENTS)

build: app-ui app-requirements
uv build --require-hashes --build-constraints=.build-constraints.txt

lock-dependencies: UV_FROZEN := 0
Expand Down Expand Up @@ -74,4 +89,4 @@ docs-serve: docs-build
yarn --cwd docs/ucx serve

.DEFAULT: all
.PHONY: all clean dev lint fmt test integration coverage build lock-dependencies known cmds solacc docs-install docs-serve-dev docs-build docs-serve
.PHONY: all clean dev lint fmt test integration coverage app-ui app-requirements build lock-dependencies known cmds solacc docs-install docs-serve-dev docs-build docs-serve
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ UCX is a toolkit for enabling Unity Catalog (UC) in your Databricks workspace. U

Please refer to the [UCX documentation](https://databrickslabs.github.io/ucx/) for detailed information on how to use UCX.

To run the assessment, review the table mapping and migrate tables from a web UI, deploy the
[UCX App](https://databrickslabs.github.io/ucx/docs/reference/app) with `databricks labs ucx deploy-app`.


# Developer documentation

Expand Down
5 changes: 5 additions & 0 deletions app-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
.next/
out/
next-env.d.ts
*.tsbuildinfo
93 changes: 93 additions & 0 deletions app-ui/app/assessment/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
"use client";

import { ExternalLink, Play } from "lucide-react";
import { useState } from "react";
import useSWR from "swr";

import { useRuns } from "@/components/runs";
import { PageTitle } from "@/components/shell";
import { Alert } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Card, CardTitle } from "@/components/ui/card";
import { Checkbox } from "@/components/ui/checkbox";
import { api, fetcher } from "@/lib/api";
import type { Dashboard } from "@/lib/types";

export default function AssessmentPage() {
const { track } = useRuns();
const [forceRefresh, setForceRefresh] = useState(false);
const [starting, setStarting] = useState(false);
const [runError, setRunError] = useState<string | null>(null);
const { data: dashboard, error: dashboardError } = useSWR<Dashboard>("/api/assessment/dashboard", fetcher);

async function runAssessment() {
setStarting(true);
setRunError(null);
try {
const run = await api.runAssessment(forceRefresh);
track({ run_id: run.run_id, run_url: run.run_url, name: run.workflow });
} catch (e) {
setRunError((e as Error).message);
} finally {
setStarting(false);
}
}

return (
<section>
<PageTitle
title="Assessment"
subtitle="Crawls the workspace and the Hive metastore and reports what is compatible with Unity Catalog."
/>
<Card className="mb-4">
<CardTitle>Run assessment</CardTitle>
<div className="mb-3 flex flex-wrap items-center gap-2.5">
<label className="flex items-center gap-2">
<Checkbox checked={forceRefresh} onCheckedChange={(checked) => setForceRefresh(checked === true)} />
Force refresh <span className="text-muted">(re-crawl everything, ignore cached results)</span>
</label>
<span className="flex-1" />
<Button variant="primary" onClick={runAssessment} disabled={starting}>
<Play className="size-3.5" /> {starting ? "Starting…" : "Run assessment"}
</Button>
</div>
{runError ? (
<Alert tone="error">{runError}</Alert>
) : (
<Alert>
The run starts in the background. Progress shows in the <b>Active runs</b> window.
</Alert>
)}
</Card>
<Card>
<CardTitle
aside={
dashboard && (
<Button size="sm" asChild>
<a href={dashboard.url} target="_blank" rel="noreferrer">
Open in new tab <ExternalLink className="size-3" />
</a>
</Button>
)
}
>
Assessment dashboard
</CardTitle>
{dashboardError && <Alert tone="error">{dashboardError.message}</Alert>}
{dashboard && (
<>
<iframe
title="UCX assessment dashboard"
src={dashboard.embed_url}
className="h-[640px] w-full rounded-lg border border-border bg-zinc-50"
/>
<Alert tone="warn" className="mt-3">
If the dashboard doesn&apos;t load here, dashboard embedding may be off for this workspace, or the
app&apos;s domain isn&apos;t allow-listed. Use <b>Open in new tab</b> instead.
</Alert>
</>
)}
</Card>
</section>
);
}
31 changes: 31 additions & 0 deletions app-ui/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@import "tailwindcss";

/* Palette of the approved mockup. */
@theme {
--color-bg: #f7f7f8;
--color-panel: #ffffff;
--color-border: #e4e4e7;
--color-fg: #18181b;
--color-muted: #71717a;
--color-sidebar: #111114;
--color-accent: #e8452c;
--color-accent-soft: #fdecea;
--color-info: #2563eb;
--color-info-soft: #eaf1fe;
--color-ok: #15803d;
--color-ok-soft: #e8f6ec;
--color-warn: #b45309;
--color-warn-soft: #fdf3e2;
--color-bad: #b91c1c;
--color-bad-soft: #fdeaea;
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--font-mono: ui-monospace, Menlo, monospace;
}

body {
background: var(--color-bg);
color: var(--color-fg);
font-family: var(--font-sans);
font-size: 14px;
line-height: 1.45;
}
21 changes: 21 additions & 0 deletions app-ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Metadata } from "next";
import type { ReactNode } from "react";

import { Shell } from "@/components/shell";

import "./globals.css";

export const metadata: Metadata = {
title: "UCX",
description: "Unity Catalog migration with UCX",
};

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body>
<Shell>{children}</Shell>
</body>
</html>
);
}
Loading
Loading