@fabricorg/databricks-testkit 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +11 -2
- package/dist/index.cjs +903 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +881 -76
- package/dist/index.js.map +1 -1
- package/package.json +13 -11
package/dist/index.cjs
CHANGED
|
@@ -600,15 +600,15 @@ function defineLiveSuite(spec) {
|
|
|
600
600
|
async function runLiveSuite(spec, runtime = {}) {
|
|
601
601
|
const env = spec.env ?? process.env;
|
|
602
602
|
if (env.DBX_TEST_LIVE !== "1") return void 0;
|
|
603
|
-
const
|
|
603
|
+
const required3 = [...spec.required ?? []];
|
|
604
604
|
const known = new Set(spec.checks.map((check) => check.id));
|
|
605
|
-
for (const id of
|
|
605
|
+
for (const id of required3) {
|
|
606
606
|
if (!known.has(id)) throw new Error(`Required live check '${id}' is not defined`);
|
|
607
607
|
}
|
|
608
608
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
609
609
|
const ownedWarehouse = runtime.warehouse === void 0;
|
|
610
610
|
const client = runtime.client ?? createClientFromEnv(env);
|
|
611
|
-
const
|
|
611
|
+
const warehouse2 = runtime.warehouse ?? (hasWarehouseConfig(env) ? await createWorkspaceContext({ env, client }) : unavailableWarehouseContext());
|
|
612
612
|
const results = [];
|
|
613
613
|
try {
|
|
614
614
|
for (const check of spec.checks) {
|
|
@@ -623,7 +623,7 @@ async function runLiveSuite(spec, runtime = {}) {
|
|
|
623
623
|
}
|
|
624
624
|
const before = performance.now();
|
|
625
625
|
try {
|
|
626
|
-
const details = await check.run({ env, warehouse, client });
|
|
626
|
+
const details = await check.run({ env, warehouse: warehouse2, client });
|
|
627
627
|
results.push({
|
|
628
628
|
id: check.id,
|
|
629
629
|
description: check.description,
|
|
@@ -642,9 +642,9 @@ async function runLiveSuite(spec, runtime = {}) {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
} finally {
|
|
645
|
-
if (ownedWarehouse) await
|
|
645
|
+
if (ownedWarehouse) await warehouse2.close();
|
|
646
646
|
}
|
|
647
|
-
const success =
|
|
647
|
+
const success = required3.every(
|
|
648
648
|
(id) => results.find((result) => result.id === id)?.status === "pass"
|
|
649
649
|
);
|
|
650
650
|
const evidence = {
|
|
@@ -653,7 +653,7 @@ async function runLiveSuite(spec, runtime = {}) {
|
|
|
653
653
|
startedAt,
|
|
654
654
|
finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
655
655
|
success,
|
|
656
|
-
required:
|
|
656
|
+
required: required3,
|
|
657
657
|
results,
|
|
658
658
|
...spec.targetPack ? { targetPack: spec.targetPack } : {}
|
|
659
659
|
};
|
|
@@ -756,8 +756,8 @@ function sqlRoundTripCheck() {
|
|
|
756
756
|
id: "sql",
|
|
757
757
|
description: "SQL Statement Execution round-trip",
|
|
758
758
|
configured: (env) => Boolean(env.DATABRICKS_WAREHOUSE_ID || env.DATABRICKS_HTTP_PATH),
|
|
759
|
-
async run({ warehouse }) {
|
|
760
|
-
const rows = await
|
|
759
|
+
async run({ warehouse: warehouse2 }) {
|
|
760
|
+
const rows = await warehouse2.query("SELECT 1 AS dbx_test_ok");
|
|
761
761
|
if (Number(rows[0]?.dbx_test_ok) !== 1)
|
|
762
762
|
throw new Error("SQL round-trip returned an unexpected value");
|
|
763
763
|
return { rows: rows.length };
|
|
@@ -801,9 +801,9 @@ function deltaContractCheck(tableEnv = "DBX_TEST_DELTA_TABLE", columns = []) {
|
|
|
801
801
|
id: "delta-contract",
|
|
802
802
|
description: "Delta table schema contract",
|
|
803
803
|
configured: (env) => Boolean(env[tableEnv]),
|
|
804
|
-
async run({ env, warehouse }) {
|
|
804
|
+
async run({ env, warehouse: warehouse2 }) {
|
|
805
805
|
const table = env[tableEnv];
|
|
806
|
-
const rows = await
|
|
806
|
+
const rows = await warehouse2.query(`DESCRIBE TABLE ${table}`);
|
|
807
807
|
assertDeltaContract(table, rows, columns);
|
|
808
808
|
return { table, columns: rows.length };
|
|
809
809
|
}
|
|
@@ -814,10 +814,10 @@ function unityCatalogAccessCheck() {
|
|
|
814
814
|
id: "uc-grants",
|
|
815
815
|
description: "Unity Catalog allow/deny access assertions",
|
|
816
816
|
configured: (env) => Boolean(env.DBX_TEST_UC_ALLOWED_TABLE && env.DBX_TEST_UC_DENIED_TABLE),
|
|
817
|
-
async run({ env, warehouse }) {
|
|
818
|
-
await
|
|
817
|
+
async run({ env, warehouse: warehouse2 }) {
|
|
818
|
+
await warehouse2.query(`SELECT * FROM ${env.DBX_TEST_UC_ALLOWED_TABLE} LIMIT 1`);
|
|
819
819
|
try {
|
|
820
|
-
await
|
|
820
|
+
await warehouse2.query(`SELECT * FROM ${env.DBX_TEST_UC_DENIED_TABLE} LIMIT 1`);
|
|
821
821
|
} catch (error) {
|
|
822
822
|
if (/permission.?denied|insufficient.?priv|403|unauthoriz/i.test(String(error))) {
|
|
823
823
|
return { allowed: env.DBX_TEST_UC_ALLOWED_TABLE, denied: env.DBX_TEST_UC_DENIED_TABLE };
|
|
@@ -1282,7 +1282,7 @@ function autoLoaderIngestionCheck(options = {}) {
|
|
|
1282
1282
|
configured: (env) => Boolean(
|
|
1283
1283
|
env.DBX_TEST_AUTOLOADER_PIPELINE_ID && env.DBX_TEST_AUTOLOADER_TABLE && env.DBX_TEST_AUTOLOADER_FIXTURE && env.DBX_TEST_VOLUME
|
|
1284
1284
|
),
|
|
1285
|
-
async run({ env, client, warehouse }) {
|
|
1285
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
1286
1286
|
const pipelineId = env.DBX_TEST_AUTOLOADER_PIPELINE_ID;
|
|
1287
1287
|
if (pipelineId === env.DBX_TEST_PIPELINE_ID) {
|
|
1288
1288
|
throw new Error("DBX_TEST_AUTOLOADER_PIPELINE_ID must not be the production pipeline");
|
|
@@ -1307,7 +1307,7 @@ function autoLoaderIngestionCheck(options = {}) {
|
|
|
1307
1307
|
pollIntervalMs: Number(env.DBX_TEST_POLL_INTERVAL_MS ?? 1e4)
|
|
1308
1308
|
});
|
|
1309
1309
|
const table = env.DBX_TEST_AUTOLOADER_TABLE;
|
|
1310
|
-
const rows = await
|
|
1310
|
+
const rows = await warehouse2.query(
|
|
1311
1311
|
`SELECT COUNT(*) AS n, SUM(CASE WHEN _rescued_data IS NOT NULL THEN 1 ELSE 0 END) AS rescued FROM ${table}`
|
|
1312
1312
|
);
|
|
1313
1313
|
const count = Number(rows[0]?.n ?? 0);
|
|
@@ -1330,7 +1330,7 @@ function performanceBudgetCheck() {
|
|
|
1330
1330
|
id: "performance",
|
|
1331
1331
|
description: "SQL Statement Execution p95 stays within the configured latency budget",
|
|
1332
1332
|
configured: (env) => Boolean(env.DBX_TEST_PERFORMANCE_P95_MS),
|
|
1333
|
-
async run({ env, warehouse }) {
|
|
1333
|
+
async run({ env, warehouse: warehouse2 }) {
|
|
1334
1334
|
const budgetMs = Number(env.DBX_TEST_PERFORMANCE_P95_MS);
|
|
1335
1335
|
const runs = Number(env.DBX_TEST_PERFORMANCE_RUNS ?? 7);
|
|
1336
1336
|
if (!Number.isFinite(budgetMs) || budgetMs <= 0) {
|
|
@@ -1339,11 +1339,11 @@ function performanceBudgetCheck() {
|
|
|
1339
1339
|
if (!Number.isInteger(runs) || runs < 3 || runs > 100) {
|
|
1340
1340
|
throw new Error("DBX_TEST_PERFORMANCE_RUNS must be an integer from 3 to 100");
|
|
1341
1341
|
}
|
|
1342
|
-
await
|
|
1342
|
+
await warehouse2.query("SELECT 1 AS warmup");
|
|
1343
1343
|
const durations = [];
|
|
1344
1344
|
for (let index = 0; index < runs; index += 1) {
|
|
1345
1345
|
const started = performance.now();
|
|
1346
|
-
await
|
|
1346
|
+
await warehouse2.query("SELECT 1 AS performance_probe");
|
|
1347
1347
|
durations.push(performance.now() - started);
|
|
1348
1348
|
}
|
|
1349
1349
|
durations.sort((left, right) => left - right);
|
|
@@ -1365,15 +1365,15 @@ function failureRecoveryCheck() {
|
|
|
1365
1365
|
id: "failure-recovery",
|
|
1366
1366
|
description: "A failed statement is isolated and a subsequent statement recovers",
|
|
1367
1367
|
configured: (env) => Boolean(env.DATABRICKS_WAREHOUSE_ID || env.DATABRICKS_HTTP_PATH),
|
|
1368
|
-
async run({ warehouse }) {
|
|
1368
|
+
async run({ warehouse: warehouse2 }) {
|
|
1369
1369
|
let failedAsExpected = false;
|
|
1370
1370
|
try {
|
|
1371
|
-
await
|
|
1371
|
+
await warehouse2.query("SELECT * FROM __fabric_experiments_expected_missing_table__");
|
|
1372
1372
|
} catch {
|
|
1373
1373
|
failedAsExpected = true;
|
|
1374
1374
|
}
|
|
1375
1375
|
if (!failedAsExpected) throw new Error("Injected failure unexpectedly succeeded");
|
|
1376
|
-
const rows = await
|
|
1376
|
+
const rows = await warehouse2.query("SELECT 1 AS recovered");
|
|
1377
1377
|
if (Number(rows[0]?.recovered) !== 1) {
|
|
1378
1378
|
throw new Error("Statement execution did not recover after the injected failure");
|
|
1379
1379
|
}
|
|
@@ -1411,20 +1411,20 @@ function backupRestoreCheck() {
|
|
|
1411
1411
|
id: "backup-restore",
|
|
1412
1412
|
description: "Delta DEEP CLONE backup restores a dropped scratch table",
|
|
1413
1413
|
configured: (env) => Boolean(env.DATABRICKS_WAREHOUSE_ID || env.DATABRICKS_HTTP_PATH),
|
|
1414
|
-
async run({ warehouse }) {
|
|
1415
|
-
const source =
|
|
1416
|
-
const backup =
|
|
1414
|
+
async run({ warehouse: warehouse2 }) {
|
|
1415
|
+
const source = warehouse2.qual(safeName("backup_source"));
|
|
1416
|
+
const backup = warehouse2.qual(safeName("backup_clone"));
|
|
1417
1417
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
await
|
|
1420
|
-
await
|
|
1421
|
-
await
|
|
1422
|
-
const rows = await
|
|
1418
|
+
await warehouse2.exec(`CREATE TABLE ${source} USING DELTA AS SELECT 7 AS value`);
|
|
1419
|
+
await warehouse2.exec(`CREATE TABLE ${backup} DEEP CLONE ${source}`);
|
|
1420
|
+
await warehouse2.exec(`DROP TABLE ${source}`);
|
|
1421
|
+
await warehouse2.exec(`CREATE TABLE ${source} DEEP CLONE ${backup}`);
|
|
1422
|
+
const rows = await warehouse2.query(`SELECT value FROM ${source}`);
|
|
1423
1423
|
if (Number(rows[0]?.value) !== 7) throw new Error("Restored Delta table lost its data");
|
|
1424
1424
|
return { restoredRows: rows.length, deepClone: true };
|
|
1425
1425
|
} finally {
|
|
1426
|
-
await
|
|
1427
|
-
await
|
|
1426
|
+
await warehouse2.exec(`DROP TABLE IF EXISTS ${source}`).catch(() => void 0);
|
|
1427
|
+
await warehouse2.exec(`DROP TABLE IF EXISTS ${backup}`).catch(() => void 0);
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
1430
|
};
|
|
@@ -1434,25 +1434,25 @@ function rollbackCheck() {
|
|
|
1434
1434
|
id: "rollback",
|
|
1435
1435
|
description: "Delta time-travel rollback restores a known-good table version",
|
|
1436
1436
|
configured: (env) => Boolean(env.DATABRICKS_WAREHOUSE_ID || env.DATABRICKS_HTTP_PATH),
|
|
1437
|
-
async run({ warehouse }) {
|
|
1438
|
-
const table =
|
|
1437
|
+
async run({ warehouse: warehouse2 }) {
|
|
1438
|
+
const table = warehouse2.qual(safeName("rollback_probe"));
|
|
1439
1439
|
try {
|
|
1440
|
-
await
|
|
1441
|
-
await
|
|
1442
|
-
const history = await
|
|
1440
|
+
await warehouse2.exec(`CREATE TABLE ${table} (value INT) USING DELTA`);
|
|
1441
|
+
await warehouse2.exec(`INSERT INTO ${table} VALUES (1)`);
|
|
1442
|
+
const history = await warehouse2.query(`DESCRIBE HISTORY ${table} LIMIT 1`);
|
|
1443
1443
|
const knownGoodVersion = Number(history[0]?.version);
|
|
1444
1444
|
if (!Number.isInteger(knownGoodVersion)) {
|
|
1445
1445
|
throw new Error("Delta history did not return a known-good version");
|
|
1446
1446
|
}
|
|
1447
|
-
await
|
|
1448
|
-
await
|
|
1449
|
-
const rows = await
|
|
1447
|
+
await warehouse2.exec(`INSERT INTO ${table} VALUES (999)`);
|
|
1448
|
+
await warehouse2.exec(`RESTORE TABLE ${table} TO VERSION AS OF ${knownGoodVersion}`);
|
|
1449
|
+
const rows = await warehouse2.query(`SELECT value FROM ${table} ORDER BY value`);
|
|
1450
1450
|
if (rows.length !== 1 || Number(rows[0]?.value) !== 1) {
|
|
1451
1451
|
throw new Error("Delta rollback did not restore the known-good contents");
|
|
1452
1452
|
}
|
|
1453
1453
|
return { knownGoodVersion, restoredRows: rows.length };
|
|
1454
1454
|
} finally {
|
|
1455
|
-
await
|
|
1455
|
+
await warehouse2.exec(`DROP TABLE IF EXISTS ${table}`).catch(() => void 0);
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
};
|
|
@@ -1462,13 +1462,13 @@ function serverlessComputeCheck() {
|
|
|
1462
1462
|
id: "azure-serverless",
|
|
1463
1463
|
description: "Azure Databricks serverless SQL warehouse is enabled and executes SQL",
|
|
1464
1464
|
configured: (env) => Boolean(env.DATABRICKS_WAREHOUSE_ID),
|
|
1465
|
-
async run({ env, client, warehouse }) {
|
|
1465
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
1466
1466
|
const id = env.DATABRICKS_WAREHOUSE_ID;
|
|
1467
1467
|
const details = await client.get(`/api/2.0/sql/warehouses/${encodeURIComponent(id)}`);
|
|
1468
1468
|
if (details.enable_serverless_compute !== true) {
|
|
1469
1469
|
throw new Error(`SQL warehouse ${id} is not configured for serverless compute`);
|
|
1470
1470
|
}
|
|
1471
|
-
const rows = await
|
|
1471
|
+
const rows = await warehouse2.query("SELECT current_catalog() AS catalog");
|
|
1472
1472
|
return { warehouseId: id, name: details.name, state: details.state, rows: rows.length };
|
|
1473
1473
|
}
|
|
1474
1474
|
};
|
|
@@ -1563,9 +1563,9 @@ function defineTargetPack(spec) {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
ids.add(check.id);
|
|
1565
1565
|
}
|
|
1566
|
-
for (const
|
|
1567
|
-
if (!ids.has(
|
|
1568
|
-
throw new Error(`Target pack '${spec.id}' requires unknown check '${
|
|
1566
|
+
for (const required3 of spec.requiredChecks ?? []) {
|
|
1567
|
+
if (!ids.has(required3)) {
|
|
1568
|
+
throw new Error(`Target pack '${spec.id}' requires unknown check '${required3}'`);
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
1571
|
return checks;
|
|
@@ -1589,25 +1589,25 @@ function createTargetPackRegistry(packs) {
|
|
|
1589
1589
|
return registry;
|
|
1590
1590
|
}
|
|
1591
1591
|
function doctorTargetPack(pack, env = process.env, requiredChecks = pack.requiredChecks ?? []) {
|
|
1592
|
-
const requirements = (pack.requirements ?? []).map((
|
|
1593
|
-
id:
|
|
1594
|
-
description:
|
|
1595
|
-
satisfied:
|
|
1596
|
-
required:
|
|
1597
|
-
variables: [...
|
|
1592
|
+
const requirements = (pack.requirements ?? []).map((requirement2) => ({
|
|
1593
|
+
id: requirement2.id,
|
|
1594
|
+
description: requirement2.description,
|
|
1595
|
+
satisfied: requirement2.anyOf.some((name) => Boolean(env[name]?.trim())),
|
|
1596
|
+
required: requirement2.required !== false,
|
|
1597
|
+
variables: [...requirement2.anyOf]
|
|
1598
1598
|
}));
|
|
1599
|
-
const
|
|
1599
|
+
const required3 = new Set(requiredChecks);
|
|
1600
1600
|
const checks = pack.checks().map((check) => ({
|
|
1601
1601
|
id: check.id,
|
|
1602
1602
|
description: check.description,
|
|
1603
1603
|
configured: check.configured ? check.configured(env) : true,
|
|
1604
|
-
required:
|
|
1604
|
+
required: required3.has(check.id)
|
|
1605
1605
|
}));
|
|
1606
1606
|
const known = new Set(checks.map((check) => check.id));
|
|
1607
|
-
const missingRequirements = requirements.filter((
|
|
1607
|
+
const missingRequirements = requirements.filter((requirement2) => requirement2.required && !requirement2.satisfied).map((requirement2) => requirement2.id);
|
|
1608
1608
|
const missingRequiredChecks = [
|
|
1609
1609
|
...checks.filter((check) => check.required && !check.configured).map((check) => check.id),
|
|
1610
|
-
...[...
|
|
1610
|
+
...[...required3].filter((id) => !known.has(id))
|
|
1611
1611
|
];
|
|
1612
1612
|
return {
|
|
1613
1613
|
pack: {
|
|
@@ -1958,20 +1958,20 @@ function jobsOrchestrationCheck() {
|
|
|
1958
1958
|
const configured = env.DBX_TEST_JOBS_ORCHESTRATION_JSON;
|
|
1959
1959
|
if (!configured) throw new Error("DBX_TEST_JOBS_ORCHESTRATION_JSON is required");
|
|
1960
1960
|
const spec = parseJobOrchestrationLiveSpec(configured);
|
|
1961
|
-
const
|
|
1962
|
-
const runId = await
|
|
1963
|
-
let run = await
|
|
1961
|
+
const adapter2 = new DatabricksJobsAdapter(client);
|
|
1962
|
+
const runId = await adapter2.submit(spec.request);
|
|
1963
|
+
let run = await adapter2.wait(runId, {
|
|
1964
1964
|
timeoutMs: Number(env.DBX_TEST_TIMEOUT_MS ?? 9e5),
|
|
1965
1965
|
pollIntervalMs: Number(env.DBX_TEST_POLL_INTERVAL_MS ?? 1e4)
|
|
1966
1966
|
});
|
|
1967
1967
|
let repairId;
|
|
1968
1968
|
if (spec.repairFailedTasks && run.resultState !== "SUCCESS") {
|
|
1969
1969
|
const failed = run.tasks.filter((task) => task.resultState === "FAILED").map((task) => task.taskKey);
|
|
1970
|
-
repairId = await
|
|
1970
|
+
repairId = await adapter2.repair(runId, {
|
|
1971
1971
|
rerunTasks: failed.length > 0 ? failed : void 0,
|
|
1972
1972
|
rerunDependentTasks: true
|
|
1973
1973
|
});
|
|
1974
|
-
run = await
|
|
1974
|
+
run = await adapter2.waitForRepair(runId, repairId, {
|
|
1975
1975
|
timeoutMs: Number(env.DBX_TEST_TIMEOUT_MS ?? 9e5),
|
|
1976
1976
|
pollIntervalMs: Number(env.DBX_TEST_POLL_INTERVAL_MS ?? 1e4)
|
|
1977
1977
|
});
|
|
@@ -1991,13 +1991,13 @@ function jobsOrchestrationCheck() {
|
|
|
1991
1991
|
}
|
|
1992
1992
|
let cancellation;
|
|
1993
1993
|
if (spec.cancellation) {
|
|
1994
|
-
const cancellationRunId = await
|
|
1995
|
-
await
|
|
1994
|
+
const cancellationRunId = await adapter2.submit(spec.cancellation.request);
|
|
1995
|
+
await adapter2.waitUntilActive(cancellationRunId, {
|
|
1996
1996
|
timeoutMs: Number(env.DBX_TEST_TIMEOUT_MS ?? 9e5),
|
|
1997
1997
|
pollIntervalMs: Number(env.DBX_TEST_POLL_INTERVAL_MS ?? 1e4)
|
|
1998
1998
|
});
|
|
1999
|
-
await
|
|
2000
|
-
const canceled = await
|
|
1999
|
+
await adapter2.cancel(cancellationRunId);
|
|
2000
|
+
const canceled = await adapter2.wait(cancellationRunId, {
|
|
2001
2001
|
timeoutMs: Number(env.DBX_TEST_TIMEOUT_MS ?? 9e5),
|
|
2002
2002
|
pollIntervalMs: Number(env.DBX_TEST_POLL_INTERVAL_MS ?? 1e4)
|
|
2003
2003
|
});
|
|
@@ -2152,9 +2152,9 @@ function jobsCertificationCheck() {
|
|
|
2152
2152
|
);
|
|
2153
2153
|
try {
|
|
2154
2154
|
await importNotebooks(client, paths);
|
|
2155
|
-
const
|
|
2156
|
-
const runId = await
|
|
2157
|
-
const initial = await
|
|
2155
|
+
const adapter2 = new DatabricksJobsAdapter(client);
|
|
2156
|
+
const runId = await adapter2.submit(certificationRequest(paths));
|
|
2157
|
+
const initial = await adapter2.wait(runId, waitOptions(env));
|
|
2158
2158
|
if (initial.resultState !== "FAILED") {
|
|
2159
2159
|
throw new Error(
|
|
2160
2160
|
`Certification run ${runId} expected FAILED before repair, got ${initial.resultState}`
|
|
@@ -2168,19 +2168,19 @@ function jobsCertificationCheck() {
|
|
|
2168
2168
|
assertTask(initial.tasks, "branch", "SUCCESS");
|
|
2169
2169
|
assertTask(initial.tasks, "foreach", "SUCCESS");
|
|
2170
2170
|
assertTask(initial.tasks, "repair", "FAILED");
|
|
2171
|
-
const repairId = await
|
|
2171
|
+
const repairId = await adapter2.repair(runId, {
|
|
2172
2172
|
rerunTasks: ["repair"],
|
|
2173
2173
|
rerunDependentTasks: true
|
|
2174
2174
|
});
|
|
2175
|
-
const repaired = await
|
|
2175
|
+
const repaired = await adapter2.waitForRepair(runId, repairId, waitOptions(env));
|
|
2176
2176
|
if (repaired.resultState !== "SUCCESS") {
|
|
2177
2177
|
throw new Error(`Certification repair ${repairId} ended in ${repaired.resultState}`);
|
|
2178
2178
|
}
|
|
2179
2179
|
assertTask(repaired.tasks, "repair", "SUCCESS");
|
|
2180
|
-
const cancellationRunId = await
|
|
2181
|
-
await
|
|
2182
|
-
await
|
|
2183
|
-
const canceled = await
|
|
2180
|
+
const cancellationRunId = await adapter2.submit(cancellationRequest(paths));
|
|
2181
|
+
await adapter2.waitUntilActive(cancellationRunId, waitOptions(env));
|
|
2182
|
+
await adapter2.cancel(cancellationRunId);
|
|
2183
|
+
const canceled = await adapter2.wait(cancellationRunId, waitOptions(env));
|
|
2184
2184
|
if (canceled.resultState !== "CANCELED") {
|
|
2185
2185
|
throw new Error(`Certification cancellation ended in ${canceled.resultState}`);
|
|
2186
2186
|
}
|
|
@@ -2348,9 +2348,815 @@ function createLakeflowJobsTargetPack() {
|
|
|
2348
2348
|
});
|
|
2349
2349
|
}
|
|
2350
2350
|
|
|
2351
|
+
// src/advanced-workload-checks.ts
|
|
2352
|
+
init_workspace_context();
|
|
2353
|
+
var DatabricksAdvancedWorkloadsAdapter = class {
|
|
2354
|
+
constructor(client) {
|
|
2355
|
+
this.client = client;
|
|
2356
|
+
}
|
|
2357
|
+
client;
|
|
2358
|
+
pipeline(id) {
|
|
2359
|
+
return this.client.get(`/api/2.0/pipelines/${segment(id)}`);
|
|
2360
|
+
}
|
|
2361
|
+
table(fullName) {
|
|
2362
|
+
return this.client.get(`/api/2.1/unity-catalog/tables/${segment(fullName)}`);
|
|
2363
|
+
}
|
|
2364
|
+
dashboard(id) {
|
|
2365
|
+
return this.client.get(`/api/2.0/lakeview/dashboards/${segment(id)}`);
|
|
2366
|
+
}
|
|
2367
|
+
genieSpace(id) {
|
|
2368
|
+
return this.client.get(`/api/2.0/genie/spaces/${segment(id)}`);
|
|
2369
|
+
}
|
|
2370
|
+
startGenieConversation(spaceId, question) {
|
|
2371
|
+
return this.client.post(`/api/2.0/genie/spaces/${segment(spaceId)}/start-conversation`, {
|
|
2372
|
+
content: question
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
experiment(id) {
|
|
2376
|
+
return this.client.get("/api/2.0/mlflow/experiments/get", { experiment_id: id });
|
|
2377
|
+
}
|
|
2378
|
+
registeredModel(fullName) {
|
|
2379
|
+
return this.client.get(`/api/2.1/unity-catalog/models/${segment(fullName)}`);
|
|
2380
|
+
}
|
|
2381
|
+
modelVersion(fullName, version) {
|
|
2382
|
+
return this.client.get(
|
|
2383
|
+
`/api/2.1/unity-catalog/models/${segment(fullName)}/versions/${segment(version)}`
|
|
2384
|
+
);
|
|
2385
|
+
}
|
|
2386
|
+
onlineTable(fullName) {
|
|
2387
|
+
return this.client.get(`/api/2.0/online-tables/${segment(fullName)}`);
|
|
2388
|
+
}
|
|
2389
|
+
servingEndpoint(name) {
|
|
2390
|
+
return this.client.get(`/api/2.0/serving-endpoints/${segment(name)}`);
|
|
2391
|
+
}
|
|
2392
|
+
invokeServingEndpoint(name, request) {
|
|
2393
|
+
return this.client.post(`/serving-endpoints/${segment(name)}/invocations`, request);
|
|
2394
|
+
}
|
|
2395
|
+
vectorSearchEndpoint(name) {
|
|
2396
|
+
return this.client.get(`/api/2.0/vector-search/endpoints/${segment(name)}`);
|
|
2397
|
+
}
|
|
2398
|
+
vectorSearchIndex(name) {
|
|
2399
|
+
return this.client.get(`/api/2.0/vector-search/indexes/${segment(name)}`);
|
|
2400
|
+
}
|
|
2401
|
+
queryVectorSearchIndex(name, request) {
|
|
2402
|
+
return this.client.post(`/api/2.0/vector-search/indexes/${segment(name)}/query`, request);
|
|
2403
|
+
}
|
|
2404
|
+
connection(name) {
|
|
2405
|
+
return this.client.get(`/api/2.1/unity-catalog/connections/${segment(name)}`);
|
|
2406
|
+
}
|
|
2407
|
+
share(name) {
|
|
2408
|
+
return this.client.get(`/api/2.1/unity-catalog/shares/${segment(name)}`);
|
|
2409
|
+
}
|
|
2410
|
+
cleanRoom(name) {
|
|
2411
|
+
return this.client.get(`/api/2.0/clean-rooms/${segment(name)}`);
|
|
2412
|
+
}
|
|
2413
|
+
ipAccessList(id) {
|
|
2414
|
+
return this.client.get(`/api/2.0/ip-access-lists/${segment(id)}`);
|
|
2415
|
+
}
|
|
2416
|
+
clusterPolicy(id) {
|
|
2417
|
+
return this.client.get("/api/2.0/policies/clusters/get", { policy_id: id });
|
|
2418
|
+
}
|
|
2419
|
+
warehouse(id) {
|
|
2420
|
+
return this.client.get(`/api/2.0/sql/warehouses/${segment(id)}`);
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
function segment(value) {
|
|
2424
|
+
return encodeURIComponent(value);
|
|
2425
|
+
}
|
|
2426
|
+
function adapter(client) {
|
|
2427
|
+
return new DatabricksAdvancedWorkloadsAdapter(client);
|
|
2428
|
+
}
|
|
2429
|
+
function required2(env, names) {
|
|
2430
|
+
return names.filter((name) => !env[name]?.trim());
|
|
2431
|
+
}
|
|
2432
|
+
function requireEnv(env, names) {
|
|
2433
|
+
const missing = required2(env, names);
|
|
2434
|
+
if (missing.length > 0) throw new Error(`Missing required configuration: ${missing.join(", ")}`);
|
|
2435
|
+
}
|
|
2436
|
+
function parseJson(value, name) {
|
|
2437
|
+
if (!value) return void 0;
|
|
2438
|
+
try {
|
|
2439
|
+
return JSON.parse(value);
|
|
2440
|
+
} catch {
|
|
2441
|
+
throw new Error(`${name} must contain valid JSON`);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
function assertNotFailed(label, state) {
|
|
2445
|
+
if (typeof state === "string" && /FAIL|ERROR|DELET/i.test(state)) {
|
|
2446
|
+
throw new Error(`${label} is ${state}`);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
function assertReady(label, state, accepted) {
|
|
2450
|
+
if (typeof state !== "string" || !accepted.includes(state.toUpperCase())) {
|
|
2451
|
+
throw new Error(`${label} is ${String(state ?? "UNKNOWN")}; expected ${accepted.join(" or ")}`);
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
async function booleanSql(label, sql, query) {
|
|
2455
|
+
if (!sql) return;
|
|
2456
|
+
const rows = await query(sql);
|
|
2457
|
+
const first = rows[0] ? Object.values(rows[0])[0] : void 0;
|
|
2458
|
+
if (!(first === true || first === 1 || first === "1" || first === "true")) {
|
|
2459
|
+
throw new Error(`${label} assertion did not return a truthy first column`);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
function advancedStreamingCdcCheck() {
|
|
2463
|
+
const names = [
|
|
2464
|
+
"DBX_TEST_STREAMING_PIPELINE_ID",
|
|
2465
|
+
"DBX_TEST_STREAMING_TABLE",
|
|
2466
|
+
"DBX_TEST_CDC_ASSERTION_SQL",
|
|
2467
|
+
"DBX_TEST_STREAMING_ASSERTION_SQL"
|
|
2468
|
+
];
|
|
2469
|
+
return {
|
|
2470
|
+
id: "streaming-cdc",
|
|
2471
|
+
description: "Streaming pipeline, streaming table and CDC assertions are healthy",
|
|
2472
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2473
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
2474
|
+
requireEnv(env, names);
|
|
2475
|
+
const api = adapter(client);
|
|
2476
|
+
const pipeline = await api.pipeline(env.DBX_TEST_STREAMING_PIPELINE_ID);
|
|
2477
|
+
assertNotFailed("Streaming pipeline", pipeline.state);
|
|
2478
|
+
const table = await api.table(env.DBX_TEST_STREAMING_TABLE);
|
|
2479
|
+
const tableType = String(table.table_type ?? table.data_source_format ?? "").toUpperCase();
|
|
2480
|
+
if (!["STREAMING_TABLE", "MATERIALIZED_VIEW", "DELTA"].includes(tableType)) {
|
|
2481
|
+
throw new Error(`Streaming target has unsupported table type ${tableType || "UNKNOWN"}`);
|
|
2482
|
+
}
|
|
2483
|
+
await booleanSql("CDC", env.DBX_TEST_CDC_ASSERTION_SQL, warehouse2.query);
|
|
2484
|
+
await booleanSql(
|
|
2485
|
+
"Streaming freshness",
|
|
2486
|
+
env.DBX_TEST_STREAMING_ASSERTION_SQL,
|
|
2487
|
+
warehouse2.query
|
|
2488
|
+
);
|
|
2489
|
+
return { pipelineId: pipeline.pipeline_id, table: env.DBX_TEST_STREAMING_TABLE, tableType };
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
}
|
|
2493
|
+
function lakeflowConnectCheck() {
|
|
2494
|
+
const names = ["DBX_TEST_CONNECT_PIPELINE_ID", "DBX_TEST_CONNECT_ASSERTION_SQL"];
|
|
2495
|
+
return {
|
|
2496
|
+
id: "lakeflow-connect",
|
|
2497
|
+
description: "Lakeflow Connect ingestion pipeline exists and is not failed",
|
|
2498
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2499
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
2500
|
+
requireEnv(env, names);
|
|
2501
|
+
const id = env.DBX_TEST_CONNECT_PIPELINE_ID;
|
|
2502
|
+
const pipeline = await adapter(client).pipeline(id);
|
|
2503
|
+
assertNotFailed("Lakeflow Connect pipeline", pipeline.state);
|
|
2504
|
+
const ingestion = pipeline.spec?.ingestion_definition;
|
|
2505
|
+
if (!ingestion || !Array.isArray(ingestion.objects) || ingestion.objects.length === 0) {
|
|
2506
|
+
throw new Error("Lakeflow Connect pipeline has no managed ingestion definition");
|
|
2507
|
+
}
|
|
2508
|
+
await booleanSql(
|
|
2509
|
+
"Lakeflow Connect replication",
|
|
2510
|
+
env.DBX_TEST_CONNECT_ASSERTION_SQL,
|
|
2511
|
+
warehouse2.query
|
|
2512
|
+
);
|
|
2513
|
+
return {
|
|
2514
|
+
pipelineId: pipeline.pipeline_id ?? id,
|
|
2515
|
+
state: pipeline.state ?? "IDLE",
|
|
2516
|
+
sourceType: ingestion.source_type ?? "MANAGED_INGESTION",
|
|
2517
|
+
objects: ingestion.objects.length
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
};
|
|
2521
|
+
}
|
|
2522
|
+
function aiBiDashboardCheck() {
|
|
2523
|
+
return {
|
|
2524
|
+
id: "aibi-dashboard",
|
|
2525
|
+
description: "Published AI/BI dashboard is accessible",
|
|
2526
|
+
configured: (env) => Boolean(env.DBX_TEST_DASHBOARD_ID),
|
|
2527
|
+
async run({ env, client }) {
|
|
2528
|
+
const dashboard = await adapter(client).dashboard(env.DBX_TEST_DASHBOARD_ID);
|
|
2529
|
+
assertNotFailed("AI/BI dashboard", dashboard.lifecycle_state);
|
|
2530
|
+
return {
|
|
2531
|
+
dashboardId: dashboard.dashboard_id ?? env.DBX_TEST_DASHBOARD_ID,
|
|
2532
|
+
name: dashboard.display_name
|
|
2533
|
+
};
|
|
2534
|
+
}
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2537
|
+
function genieCheck() {
|
|
2538
|
+
const names = ["DBX_TEST_GENIE_SPACE_ID", "DBX_TEST_GENIE_QUESTION"];
|
|
2539
|
+
return {
|
|
2540
|
+
id: "genie",
|
|
2541
|
+
description: "Genie space is accessible and can optionally start a grounded conversation",
|
|
2542
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2543
|
+
async run({ env, client }) {
|
|
2544
|
+
requireEnv(env, names);
|
|
2545
|
+
const api = adapter(client);
|
|
2546
|
+
const id = env.DBX_TEST_GENIE_SPACE_ID;
|
|
2547
|
+
const space = await api.genieSpace(id);
|
|
2548
|
+
let conversation;
|
|
2549
|
+
if (env.DBX_TEST_GENIE_QUESTION) {
|
|
2550
|
+
conversation = await api.startGenieConversation(id, env.DBX_TEST_GENIE_QUESTION);
|
|
2551
|
+
if (!conversation.conversation_id && !conversation.message_id) {
|
|
2552
|
+
throw new Error("Genie did not return a conversation or message identifier");
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
return {
|
|
2556
|
+
spaceId: space.space_id ?? id,
|
|
2557
|
+
title: space.title,
|
|
2558
|
+
conversationStarted: Boolean(conversation)
|
|
2559
|
+
};
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
function mlflowLifecycleCheck() {
|
|
2564
|
+
const names = [
|
|
2565
|
+
"DBX_TEST_MLFLOW_EXPERIMENT_ID",
|
|
2566
|
+
"DBX_TEST_REGISTERED_MODEL",
|
|
2567
|
+
"DBX_TEST_MODEL_VERSION"
|
|
2568
|
+
];
|
|
2569
|
+
return {
|
|
2570
|
+
id: "mlflow-lifecycle",
|
|
2571
|
+
description: "MLflow experiment and Unity Catalog model version are accessible",
|
|
2572
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2573
|
+
async run({ env, client }) {
|
|
2574
|
+
requireEnv(env, names);
|
|
2575
|
+
const api = adapter(client);
|
|
2576
|
+
const experiment = await api.experiment(env.DBX_TEST_MLFLOW_EXPERIMENT_ID);
|
|
2577
|
+
const model = await api.registeredModel(env.DBX_TEST_REGISTERED_MODEL);
|
|
2578
|
+
const version = await api.modelVersion(
|
|
2579
|
+
env.DBX_TEST_REGISTERED_MODEL,
|
|
2580
|
+
env.DBX_TEST_MODEL_VERSION
|
|
2581
|
+
);
|
|
2582
|
+
assertNotFailed("Model version", version.status);
|
|
2583
|
+
return {
|
|
2584
|
+
experimentId: experiment.experiment?.experiment_id ?? env.DBX_TEST_MLFLOW_EXPERIMENT_ID,
|
|
2585
|
+
model: model.full_name ?? model.name ?? env.DBX_TEST_REGISTERED_MODEL,
|
|
2586
|
+
version: version.version ?? env.DBX_TEST_MODEL_VERSION
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2591
|
+
function featureEngineeringServingCheck() {
|
|
2592
|
+
return {
|
|
2593
|
+
id: "feature-engineering",
|
|
2594
|
+
description: "Feature table and online materialization are healthy",
|
|
2595
|
+
configured: (env) => Boolean(
|
|
2596
|
+
env.DBX_TEST_FEATURE_TABLE && env.DBX_TEST_FEATURE_ASSERTION_SQL && (env.DBX_TEST_ONLINE_TABLE || env.DBX_TEST_FEATURE_SERVING_PIPELINE_ID)
|
|
2597
|
+
),
|
|
2598
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
2599
|
+
requireEnv(env, ["DBX_TEST_FEATURE_TABLE"]);
|
|
2600
|
+
if (!env.DBX_TEST_ONLINE_TABLE && !env.DBX_TEST_FEATURE_SERVING_PIPELINE_ID) {
|
|
2601
|
+
throw new Error(
|
|
2602
|
+
"Feature serving requires DBX_TEST_ONLINE_TABLE or DBX_TEST_FEATURE_SERVING_PIPELINE_ID"
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2605
|
+
const api = adapter(client);
|
|
2606
|
+
const source = await api.table(env.DBX_TEST_FEATURE_TABLE);
|
|
2607
|
+
let state;
|
|
2608
|
+
let servingResource;
|
|
2609
|
+
if (env.DBX_TEST_ONLINE_TABLE) {
|
|
2610
|
+
const online = await api.onlineTable(env.DBX_TEST_ONLINE_TABLE);
|
|
2611
|
+
const status = online.status;
|
|
2612
|
+
state = status?.state ?? status?.detailed_state ?? online.state;
|
|
2613
|
+
assertReady("Online table", state, ["ONLINE", "ACTIVE", "READY", "PROVISIONED"]);
|
|
2614
|
+
servingResource = env.DBX_TEST_ONLINE_TABLE;
|
|
2615
|
+
} else {
|
|
2616
|
+
const pipelineId = env.DBX_TEST_FEATURE_SERVING_PIPELINE_ID;
|
|
2617
|
+
const pipeline = await api.pipeline(pipelineId);
|
|
2618
|
+
state = pipeline.state ?? "IDLE";
|
|
2619
|
+
assertNotFailed("Synced Table pipeline", state);
|
|
2620
|
+
servingResource = pipeline.pipeline_id ?? pipelineId;
|
|
2621
|
+
}
|
|
2622
|
+
await booleanSql("Feature freshness", env.DBX_TEST_FEATURE_ASSERTION_SQL, warehouse2.query);
|
|
2623
|
+
return {
|
|
2624
|
+
featureTable: source.full_name ?? env.DBX_TEST_FEATURE_TABLE,
|
|
2625
|
+
servingResource,
|
|
2626
|
+
state
|
|
2627
|
+
};
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2631
|
+
function modelServingCheck() {
|
|
2632
|
+
const names = [
|
|
2633
|
+
"DBX_TEST_SERVING_ENDPOINT",
|
|
2634
|
+
"DBX_TEST_SERVING_REQUEST_JSON",
|
|
2635
|
+
"DBX_TEST_AI_GATEWAY_REQUIRED"
|
|
2636
|
+
];
|
|
2637
|
+
return {
|
|
2638
|
+
id: "model-serving",
|
|
2639
|
+
description: "Model Serving endpoint is ready and can optionally serve an inference request",
|
|
2640
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2641
|
+
async run({ env, client }) {
|
|
2642
|
+
requireEnv(env, names);
|
|
2643
|
+
if (env.DBX_TEST_AI_GATEWAY_REQUIRED !== "1") {
|
|
2644
|
+
throw new Error("DBX_TEST_AI_GATEWAY_REQUIRED must be 1 for the Model Serving target pack");
|
|
2645
|
+
}
|
|
2646
|
+
const api = adapter(client);
|
|
2647
|
+
const name = env.DBX_TEST_SERVING_ENDPOINT;
|
|
2648
|
+
const endpoint = await api.servingEndpoint(name);
|
|
2649
|
+
assertReady("Serving endpoint", endpoint.state?.ready, ["READY"]);
|
|
2650
|
+
if (env.DBX_TEST_AI_GATEWAY_REQUIRED === "1" && !endpoint.ai_gateway) {
|
|
2651
|
+
throw new Error(`Serving endpoint ${name} has no AI Gateway configuration`);
|
|
2652
|
+
}
|
|
2653
|
+
let response;
|
|
2654
|
+
if (env.DBX_TEST_SERVING_REQUEST_JSON) {
|
|
2655
|
+
response = await api.invokeServingEndpoint(
|
|
2656
|
+
name,
|
|
2657
|
+
parseJson(env.DBX_TEST_SERVING_REQUEST_JSON, "DBX_TEST_SERVING_REQUEST_JSON")
|
|
2658
|
+
);
|
|
2659
|
+
if (Object.keys(response).length === 0)
|
|
2660
|
+
throw new Error("Serving invocation returned an empty response");
|
|
2661
|
+
}
|
|
2662
|
+
return {
|
|
2663
|
+
endpoint: endpoint.name ?? name,
|
|
2664
|
+
ready: endpoint.state?.ready,
|
|
2665
|
+
aiGateway: Boolean(endpoint.ai_gateway),
|
|
2666
|
+
invoked: Boolean(response)
|
|
2667
|
+
};
|
|
2668
|
+
}
|
|
2669
|
+
};
|
|
2670
|
+
}
|
|
2671
|
+
function vectorSearchCheck() {
|
|
2672
|
+
const names = ["DBX_TEST_VECTOR_ENDPOINT", "DBX_TEST_VECTOR_INDEX"];
|
|
2673
|
+
return {
|
|
2674
|
+
id: "vector-search",
|
|
2675
|
+
description: "Vector Search endpoint and index are online",
|
|
2676
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2677
|
+
async run({ env, client }) {
|
|
2678
|
+
requireEnv(env, names);
|
|
2679
|
+
const api = adapter(client);
|
|
2680
|
+
const endpoint = await api.vectorSearchEndpoint(env.DBX_TEST_VECTOR_ENDPOINT);
|
|
2681
|
+
assertReady("Vector Search endpoint", endpoint.endpoint_status?.state, ["ONLINE", "READY"]);
|
|
2682
|
+
const index = await api.vectorSearchIndex(env.DBX_TEST_VECTOR_INDEX);
|
|
2683
|
+
if (index.status?.ready !== true)
|
|
2684
|
+
throw new Error(`Vector Search index is not ready: ${index.status?.message ?? "UNKNOWN"}`);
|
|
2685
|
+
return {
|
|
2686
|
+
endpoint: endpoint.name ?? env.DBX_TEST_VECTOR_ENDPOINT,
|
|
2687
|
+
index: index.name ?? env.DBX_TEST_VECTOR_INDEX,
|
|
2688
|
+
indexedRows: index.status.indexed_row_count
|
|
2689
|
+
};
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
}
|
|
2693
|
+
function ragAgentCheck() {
|
|
2694
|
+
const names = [
|
|
2695
|
+
"DBX_TEST_VECTOR_INDEX",
|
|
2696
|
+
"DBX_TEST_VECTOR_QUERY_JSON",
|
|
2697
|
+
"DBX_TEST_AGENT_ENDPOINT",
|
|
2698
|
+
"DBX_TEST_AGENT_REQUEST_JSON"
|
|
2699
|
+
];
|
|
2700
|
+
return {
|
|
2701
|
+
id: "rag-agent",
|
|
2702
|
+
description: "RAG retrieval and agent serving endpoint return non-empty responses",
|
|
2703
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2704
|
+
async run({ env, client }) {
|
|
2705
|
+
requireEnv(env, names);
|
|
2706
|
+
const api = adapter(client);
|
|
2707
|
+
let retrieval;
|
|
2708
|
+
if (env.DBX_TEST_VECTOR_QUERY_JSON) {
|
|
2709
|
+
retrieval = await api.queryVectorSearchIndex(
|
|
2710
|
+
env.DBX_TEST_VECTOR_INDEX,
|
|
2711
|
+
parseJson(env.DBX_TEST_VECTOR_QUERY_JSON, "DBX_TEST_VECTOR_QUERY_JSON")
|
|
2712
|
+
);
|
|
2713
|
+
if (!retrieval.result && !retrieval.data_array && !retrieval.manifest) {
|
|
2714
|
+
throw new Error("Vector query returned no result payload");
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
let agent;
|
|
2718
|
+
if (env.DBX_TEST_AGENT_ENDPOINT) {
|
|
2719
|
+
const endpoint = await api.servingEndpoint(env.DBX_TEST_AGENT_ENDPOINT);
|
|
2720
|
+
assertReady("Agent endpoint", endpoint.state?.ready, ["READY"]);
|
|
2721
|
+
if (env.DBX_TEST_AGENT_REQUEST_JSON) {
|
|
2722
|
+
agent = await api.invokeServingEndpoint(
|
|
2723
|
+
env.DBX_TEST_AGENT_ENDPOINT,
|
|
2724
|
+
parseJson(env.DBX_TEST_AGENT_REQUEST_JSON, "DBX_TEST_AGENT_REQUEST_JSON")
|
|
2725
|
+
);
|
|
2726
|
+
if (Object.keys(agent).length === 0)
|
|
2727
|
+
throw new Error("Agent invocation returned an empty response");
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
return {
|
|
2731
|
+
retrieval: Boolean(retrieval),
|
|
2732
|
+
agentEndpoint: env.DBX_TEST_AGENT_ENDPOINT,
|
|
2733
|
+
agentInvoked: Boolean(agent)
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
function federationSharingCleanRoomsCheck() {
|
|
2739
|
+
const names = [
|
|
2740
|
+
"DBX_TEST_CONNECTION",
|
|
2741
|
+
"DBX_TEST_SHARE",
|
|
2742
|
+
"DBX_TEST_CLEAN_ROOM",
|
|
2743
|
+
"DBX_TEST_FEDERATION_ASSERTION_SQL"
|
|
2744
|
+
];
|
|
2745
|
+
return {
|
|
2746
|
+
id: "federation-sharing-cleanrooms",
|
|
2747
|
+
description: "Lakehouse Federation connection, Delta Share and Clean Room are accessible",
|
|
2748
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2749
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
2750
|
+
requireEnv(env, names);
|
|
2751
|
+
const api = adapter(client);
|
|
2752
|
+
const connection = await api.connection(env.DBX_TEST_CONNECTION);
|
|
2753
|
+
const share = await api.share(env.DBX_TEST_SHARE);
|
|
2754
|
+
const room = await api.cleanRoom(env.DBX_TEST_CLEAN_ROOM);
|
|
2755
|
+
await booleanSql("Federated query", env.DBX_TEST_FEDERATION_ASSERTION_SQL, warehouse2.query);
|
|
2756
|
+
return {
|
|
2757
|
+
connection: connection.name ?? env.DBX_TEST_CONNECTION,
|
|
2758
|
+
share: share.name ?? env.DBX_TEST_SHARE,
|
|
2759
|
+
cleanRoom: room.name ?? env.DBX_TEST_CLEAN_ROOM
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
};
|
|
2763
|
+
}
|
|
2764
|
+
function securityPostureCostCheck() {
|
|
2765
|
+
const names = [
|
|
2766
|
+
"DBX_TEST_IP_ACCESS_LIST_ID",
|
|
2767
|
+
"DBX_TEST_CLUSTER_POLICY_ID",
|
|
2768
|
+
"DBX_TEST_COST_ASSERTION_SQL"
|
|
2769
|
+
];
|
|
2770
|
+
return {
|
|
2771
|
+
id: "security-cost",
|
|
2772
|
+
description: "Network access controls, compute policy and cost guardrail are enforced",
|
|
2773
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2774
|
+
async run({ env, client, warehouse: warehouse2 }) {
|
|
2775
|
+
requireEnv(env, names);
|
|
2776
|
+
const api = adapter(client);
|
|
2777
|
+
const access = await api.ipAccessList(env.DBX_TEST_IP_ACCESS_LIST_ID);
|
|
2778
|
+
if (access.enabled === false) throw new Error("Configured IP access list is disabled");
|
|
2779
|
+
const policy = await api.clusterPolicy(env.DBX_TEST_CLUSTER_POLICY_ID);
|
|
2780
|
+
if (!policy.policy_id && !policy.name)
|
|
2781
|
+
throw new Error("Cluster policy response has no identity");
|
|
2782
|
+
if (env.DBX_TEST_EXPECT_HOST_SUFFIX && !env.DATABRICKS_HOST?.endsWith(env.DBX_TEST_EXPECT_HOST_SUFFIX)) {
|
|
2783
|
+
throw new Error(`Workspace host does not end with ${env.DBX_TEST_EXPECT_HOST_SUFFIX}`);
|
|
2784
|
+
}
|
|
2785
|
+
await booleanSql("Cost guardrail", env.DBX_TEST_COST_ASSERTION_SQL, warehouse2.query);
|
|
2786
|
+
return {
|
|
2787
|
+
ipAccessList: access.list_id ?? env.DBX_TEST_IP_ACCESS_LIST_ID,
|
|
2788
|
+
policy: policy.policy_id ?? policy.name,
|
|
2789
|
+
costGuardrail: "pass"
|
|
2790
|
+
};
|
|
2791
|
+
}
|
|
2792
|
+
};
|
|
2793
|
+
}
|
|
2794
|
+
function regionalDrCheck(options = {}) {
|
|
2795
|
+
const names = [
|
|
2796
|
+
"DBX_TEST_DR_HOST",
|
|
2797
|
+
"DBX_TEST_DR_WAREHOUSE_ID",
|
|
2798
|
+
"DBX_TEST_DR_ASSERTION_SQL"
|
|
2799
|
+
];
|
|
2800
|
+
return {
|
|
2801
|
+
id: "regional-dr",
|
|
2802
|
+
description: "Secondary-region workspace authentication and SQL warehouse are reachable",
|
|
2803
|
+
configured: (env) => required2(env, names).length === 0,
|
|
2804
|
+
async run({ env }) {
|
|
2805
|
+
requireEnv(env, names);
|
|
2806
|
+
const drEnv = {
|
|
2807
|
+
...env,
|
|
2808
|
+
DATABRICKS_HOST: env.DBX_TEST_DR_HOST,
|
|
2809
|
+
DATABRICKS_WAREHOUSE_ID: env.DBX_TEST_DR_WAREHOUSE_ID,
|
|
2810
|
+
DATABRICKS_HTTP_PATH: void 0,
|
|
2811
|
+
DATABRICKS_BEARER: env.DBX_TEST_DR_BEARER,
|
|
2812
|
+
DATABRICKS_TOKEN: env.DBX_TEST_DR_TOKEN,
|
|
2813
|
+
DATABRICKS_CLIENT_ID: env.DBX_TEST_DR_CLIENT_ID ?? env.DATABRICKS_CLIENT_ID,
|
|
2814
|
+
DATABRICKS_CLIENT_SECRET: env.DBX_TEST_DR_CLIENT_SECRET ?? env.DATABRICKS_CLIENT_SECRET
|
|
2815
|
+
};
|
|
2816
|
+
const client = options.clientFactory?.(drEnv) ?? createClientFromEnv(drEnv);
|
|
2817
|
+
const secondary = await adapter(client).warehouse(env.DBX_TEST_DR_WAREHOUSE_ID);
|
|
2818
|
+
assertReady("DR SQL warehouse", secondary.state, ["RUNNING"]);
|
|
2819
|
+
const drWarehouse = await createWorkspaceContext({ env: drEnv, client });
|
|
2820
|
+
try {
|
|
2821
|
+
await booleanSql("Regional DR workload", env.DBX_TEST_DR_ASSERTION_SQL, drWarehouse.query);
|
|
2822
|
+
} finally {
|
|
2823
|
+
await drWarehouse.close();
|
|
2824
|
+
}
|
|
2825
|
+
return {
|
|
2826
|
+
secondaryWorkspace: "reachable",
|
|
2827
|
+
warehouseId: secondary.id ?? env.DBX_TEST_DR_WAREHOUSE_ID,
|
|
2828
|
+
state: secondary.state
|
|
2829
|
+
};
|
|
2830
|
+
}
|
|
2831
|
+
};
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// src/advanced-target-packs.ts
|
|
2835
|
+
var DOCS2 = "https://experiments.fabric.pro/docs/testing/target-packs/";
|
|
2836
|
+
var AZURE_USER_SCOPE = "Azure Databricks, West US, interactive user OAuth, public network path; existing certification fixtures";
|
|
2837
|
+
var workspace = {
|
|
2838
|
+
id: "workspace",
|
|
2839
|
+
description: "Databricks workspace host",
|
|
2840
|
+
anyOf: ["DATABRICKS_HOST"]
|
|
2841
|
+
};
|
|
2842
|
+
var auth = {
|
|
2843
|
+
id: "authentication",
|
|
2844
|
+
description: "Databricks OAuth, OIDC, bearer, or PAT authentication",
|
|
2845
|
+
anyOf: [
|
|
2846
|
+
"DATABRICKS_BEARER",
|
|
2847
|
+
"DATABRICKS_TOKEN",
|
|
2848
|
+
"DATABRICKS_CLIENT_ID",
|
|
2849
|
+
"DATABRICKS_OIDC_TOKEN",
|
|
2850
|
+
"DATABRICKS_OIDC_TOKEN_FILEPATH"
|
|
2851
|
+
],
|
|
2852
|
+
secret: true
|
|
2853
|
+
};
|
|
2854
|
+
var warehouse = {
|
|
2855
|
+
id: "warehouse",
|
|
2856
|
+
description: "SQL warehouse for data-plane assertions",
|
|
2857
|
+
anyOf: ["DATABRICKS_WAREHOUSE_ID", "DATABRICKS_HTTP_PATH"]
|
|
2858
|
+
};
|
|
2859
|
+
var requirement = (id, description, ...anyOf) => ({
|
|
2860
|
+
id,
|
|
2861
|
+
description,
|
|
2862
|
+
anyOf
|
|
2863
|
+
});
|
|
2864
|
+
function createAdvancedStreamingTargetPack() {
|
|
2865
|
+
return defineTargetPack({
|
|
2866
|
+
id: "streaming-cdc-connect",
|
|
2867
|
+
name: "Advanced streaming, CDC and Lakeflow Connect",
|
|
2868
|
+
description: "Streaming tables, pipeline health, CDC correctness, freshness and managed connector replication.",
|
|
2869
|
+
version: "1.0.0",
|
|
2870
|
+
maturity: "live-gated",
|
|
2871
|
+
capabilities: [
|
|
2872
|
+
"streaming.tables",
|
|
2873
|
+
"streaming.freshness",
|
|
2874
|
+
"cdc.correctness",
|
|
2875
|
+
"lakeflow-connect.replication"
|
|
2876
|
+
],
|
|
2877
|
+
checks: () => [restrictedPrincipalCheck(), advancedStreamingCdcCheck(), lakeflowConnectCheck()],
|
|
2878
|
+
requiredChecks: ["streaming-cdc", "lakeflow-connect"],
|
|
2879
|
+
requirements: [
|
|
2880
|
+
workspace,
|
|
2881
|
+
auth,
|
|
2882
|
+
warehouse,
|
|
2883
|
+
requirement("streaming-pipeline", "Streaming pipeline ID", "DBX_TEST_STREAMING_PIPELINE_ID"),
|
|
2884
|
+
requirement("streaming-table", "Streaming target table", "DBX_TEST_STREAMING_TABLE"),
|
|
2885
|
+
requirement(
|
|
2886
|
+
"connect-pipeline",
|
|
2887
|
+
"Lakeflow Connect ingestion pipeline",
|
|
2888
|
+
"DBX_TEST_CONNECT_PIPELINE_ID"
|
|
2889
|
+
),
|
|
2890
|
+
requirement(
|
|
2891
|
+
"streaming-assertion",
|
|
2892
|
+
"Streaming freshness SQL",
|
|
2893
|
+
"DBX_TEST_STREAMING_ASSERTION_SQL"
|
|
2894
|
+
),
|
|
2895
|
+
requirement("cdc-assertion", "CDC correctness SQL", "DBX_TEST_CDC_ASSERTION_SQL"),
|
|
2896
|
+
requirement(
|
|
2897
|
+
"connect-assertion",
|
|
2898
|
+
"Lakeflow Connect replication SQL",
|
|
2899
|
+
"DBX_TEST_CONNECT_ASSERTION_SQL"
|
|
2900
|
+
)
|
|
2901
|
+
],
|
|
2902
|
+
docsUrl: `${DOCS2}#advanced-streaming-cdc-and-lakeflow-connect`,
|
|
2903
|
+
certificationScopes: [
|
|
2904
|
+
`${AZURE_USER_SCOPE}; serverless Lakeflow pipeline AUTO CDC and query-based PostgreSQL foreign-catalog ingestion`
|
|
2905
|
+
]
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2908
|
+
function createAiBiGenieTargetPack() {
|
|
2909
|
+
return defineTargetPack({
|
|
2910
|
+
id: "aibi-genie",
|
|
2911
|
+
name: "AI/BI dashboards and Genie",
|
|
2912
|
+
description: "Dashboard accessibility and authenticated Genie space/conversation behavior.",
|
|
2913
|
+
version: "0.1.0",
|
|
2914
|
+
maturity: "live-gated",
|
|
2915
|
+
capabilities: ["aibi.dashboard", "genie.space", "genie.conversation"],
|
|
2916
|
+
checks: () => [restrictedPrincipalCheck(), aiBiDashboardCheck(), genieCheck()],
|
|
2917
|
+
requiredChecks: ["aibi-dashboard", "genie"],
|
|
2918
|
+
requirements: [
|
|
2919
|
+
workspace,
|
|
2920
|
+
auth,
|
|
2921
|
+
requirement("dashboard", "AI/BI dashboard ID", "DBX_TEST_DASHBOARD_ID"),
|
|
2922
|
+
requirement("genie-space", "Genie space ID", "DBX_TEST_GENIE_SPACE_ID"),
|
|
2923
|
+
requirement(
|
|
2924
|
+
"genie-question",
|
|
2925
|
+
"Grounded Genie certification question",
|
|
2926
|
+
"DBX_TEST_GENIE_QUESTION"
|
|
2927
|
+
)
|
|
2928
|
+
],
|
|
2929
|
+
docsUrl: `${DOCS2}#aibi-dashboards-and-genie`,
|
|
2930
|
+
certificationScopes: [
|
|
2931
|
+
`${AZURE_USER_SCOPE}; AI/BI dashboard metadata and Genie conversation start`
|
|
2932
|
+
]
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
function createMlflowLifecycleTargetPack() {
|
|
2936
|
+
return defineTargetPack({
|
|
2937
|
+
id: "mlflow-lifecycle",
|
|
2938
|
+
name: "MLflow and model lifecycle",
|
|
2939
|
+
description: "MLflow experiments plus Unity Catalog registered-model and model-version lifecycle evidence.",
|
|
2940
|
+
version: "0.1.0",
|
|
2941
|
+
maturity: "live-gated",
|
|
2942
|
+
capabilities: [
|
|
2943
|
+
"mlflow.experiments",
|
|
2944
|
+
"models.unity-catalog",
|
|
2945
|
+
"models.versions",
|
|
2946
|
+
"models.lifecycle"
|
|
2947
|
+
],
|
|
2948
|
+
checks: () => [restrictedPrincipalCheck(), mlflowLifecycleCheck()],
|
|
2949
|
+
requiredChecks: ["mlflow-lifecycle"],
|
|
2950
|
+
requirements: [
|
|
2951
|
+
workspace,
|
|
2952
|
+
auth,
|
|
2953
|
+
requirement("experiment", "MLflow experiment ID", "DBX_TEST_MLFLOW_EXPERIMENT_ID"),
|
|
2954
|
+
requirement(
|
|
2955
|
+
"registered-model",
|
|
2956
|
+
"Unity Catalog registered model",
|
|
2957
|
+
"DBX_TEST_REGISTERED_MODEL"
|
|
2958
|
+
),
|
|
2959
|
+
requirement("model-version", "Registered model version", "DBX_TEST_MODEL_VERSION")
|
|
2960
|
+
],
|
|
2961
|
+
docsUrl: `${DOCS2}#mlflow-and-model-lifecycle`,
|
|
2962
|
+
certificationScopes: [
|
|
2963
|
+
`${AZURE_USER_SCOPE}; MLflow experiment and Unity Catalog model version 20`
|
|
2964
|
+
]
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2967
|
+
function createFeatureEngineeringTargetPack() {
|
|
2968
|
+
return defineTargetPack({
|
|
2969
|
+
id: "feature-engineering-serving",
|
|
2970
|
+
name: "Feature engineering and serving",
|
|
2971
|
+
description: "Unity Catalog feature tables, online materialization state and freshness assertions.",
|
|
2972
|
+
version: "0.1.0",
|
|
2973
|
+
maturity: "live-gated",
|
|
2974
|
+
capabilities: [
|
|
2975
|
+
"features.tables",
|
|
2976
|
+
"features.online-tables",
|
|
2977
|
+
"features.freshness",
|
|
2978
|
+
"features.serving"
|
|
2979
|
+
],
|
|
2980
|
+
checks: () => [restrictedPrincipalCheck(), featureEngineeringServingCheck()],
|
|
2981
|
+
requiredChecks: ["feature-engineering"],
|
|
2982
|
+
requirements: [
|
|
2983
|
+
workspace,
|
|
2984
|
+
auth,
|
|
2985
|
+
warehouse,
|
|
2986
|
+
requirement("feature-table", "Unity Catalog feature table", "DBX_TEST_FEATURE_TABLE"),
|
|
2987
|
+
requirement(
|
|
2988
|
+
"online-materialization",
|
|
2989
|
+
"Databricks Online Table or Synced Table pipeline",
|
|
2990
|
+
"DBX_TEST_ONLINE_TABLE",
|
|
2991
|
+
"DBX_TEST_FEATURE_SERVING_PIPELINE_ID"
|
|
2992
|
+
),
|
|
2993
|
+
requirement(
|
|
2994
|
+
"feature-assertion",
|
|
2995
|
+
"Feature freshness/correctness SQL",
|
|
2996
|
+
"DBX_TEST_FEATURE_ASSERTION_SQL"
|
|
2997
|
+
)
|
|
2998
|
+
],
|
|
2999
|
+
docsUrl: `${DOCS2}#feature-engineering-and-serving`,
|
|
3000
|
+
certificationScopes: [
|
|
3001
|
+
`${AZURE_USER_SCOPE}; Delta feature table, PostgreSQL-backed Synced Table, and SQL freshness`
|
|
3002
|
+
]
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
function createModelServingTargetPack() {
|
|
3006
|
+
return defineTargetPack({
|
|
3007
|
+
id: "model-serving-gateway",
|
|
3008
|
+
name: "Model Serving and AI Gateway",
|
|
3009
|
+
description: "Serving readiness, inference behavior and optional AI Gateway policy presence.",
|
|
3010
|
+
version: "0.1.0",
|
|
3011
|
+
maturity: "live-gated",
|
|
3012
|
+
capabilities: [
|
|
3013
|
+
"model-serving.readiness",
|
|
3014
|
+
"model-serving.inference",
|
|
3015
|
+
"ai-gateway.configuration"
|
|
3016
|
+
],
|
|
3017
|
+
checks: () => [restrictedPrincipalCheck(), modelServingCheck()],
|
|
3018
|
+
requiredChecks: ["model-serving"],
|
|
3019
|
+
requirements: [
|
|
3020
|
+
workspace,
|
|
3021
|
+
auth,
|
|
3022
|
+
requirement("serving-endpoint", "Model Serving endpoint name", "DBX_TEST_SERVING_ENDPOINT"),
|
|
3023
|
+
requirement(
|
|
3024
|
+
"serving-request",
|
|
3025
|
+
"Safe inference request JSON",
|
|
3026
|
+
"DBX_TEST_SERVING_REQUEST_JSON"
|
|
3027
|
+
),
|
|
3028
|
+
requirement(
|
|
3029
|
+
"ai-gateway",
|
|
3030
|
+
"AI Gateway enforcement flag set to 1",
|
|
3031
|
+
"DBX_TEST_AI_GATEWAY_REQUIRED"
|
|
3032
|
+
)
|
|
3033
|
+
],
|
|
3034
|
+
docsUrl: `${DOCS2}#model-serving-and-ai-gateway`,
|
|
3035
|
+
certificationScopes: [
|
|
3036
|
+
`${AZURE_USER_SCOPE}; custom-model inference and AI Gateway inference-table configuration`
|
|
3037
|
+
]
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
3040
|
+
function createVectorRagAgentsTargetPack() {
|
|
3041
|
+
return defineTargetPack({
|
|
3042
|
+
id: "vector-rag-agents",
|
|
3043
|
+
name: "Vector Search, RAG and agents",
|
|
3044
|
+
description: "Vector endpoint/index readiness, retrieval behavior and agent endpoint inference.",
|
|
3045
|
+
version: "0.1.0",
|
|
3046
|
+
maturity: "live-gated",
|
|
3047
|
+
capabilities: [
|
|
3048
|
+
"vector-search.endpoint",
|
|
3049
|
+
"vector-search.index",
|
|
3050
|
+
"rag.retrieval",
|
|
3051
|
+
"agents.serving"
|
|
3052
|
+
],
|
|
3053
|
+
checks: () => [restrictedPrincipalCheck(), vectorSearchCheck(), ragAgentCheck()],
|
|
3054
|
+
requiredChecks: ["vector-search", "rag-agent"],
|
|
3055
|
+
requirements: [
|
|
3056
|
+
workspace,
|
|
3057
|
+
auth,
|
|
3058
|
+
requirement("vector-endpoint", "Vector Search endpoint", "DBX_TEST_VECTOR_ENDPOINT"),
|
|
3059
|
+
requirement("vector-index", "Vector Search index", "DBX_TEST_VECTOR_INDEX"),
|
|
3060
|
+
requirement("vector-query", "Vector retrieval request JSON", "DBX_TEST_VECTOR_QUERY_JSON"),
|
|
3061
|
+
requirement("agent-endpoint", "Agent serving endpoint", "DBX_TEST_AGENT_ENDPOINT"),
|
|
3062
|
+
requirement("agent-request", "Safe agent request JSON", "DBX_TEST_AGENT_REQUEST_JSON")
|
|
3063
|
+
],
|
|
3064
|
+
docsUrl: `${DOCS2}#vector-search-rag-and-agents`,
|
|
3065
|
+
certificationScopes: [
|
|
3066
|
+
`${AZURE_USER_SCOPE}; Delta Sync vector retrieval and custom PyFunc agent invocation`
|
|
3067
|
+
]
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3070
|
+
function createFederationSharingTargetPack() {
|
|
3071
|
+
return defineTargetPack({
|
|
3072
|
+
id: "federation-sharing-cleanrooms",
|
|
3073
|
+
name: "Federation, Delta Sharing and Clean Rooms",
|
|
3074
|
+
description: "Federated connection, data-plane query, Delta Share and Clean Room governance access.",
|
|
3075
|
+
version: "1.0.0",
|
|
3076
|
+
maturity: "live-gated",
|
|
3077
|
+
capabilities: [
|
|
3078
|
+
"federation.connections",
|
|
3079
|
+
"federation.query",
|
|
3080
|
+
"delta-sharing.shares",
|
|
3081
|
+
"clean-rooms.access"
|
|
3082
|
+
],
|
|
3083
|
+
checks: () => [restrictedPrincipalCheck(), federationSharingCleanRoomsCheck()],
|
|
3084
|
+
requiredChecks: ["federation-sharing-cleanrooms"],
|
|
3085
|
+
requirements: [
|
|
3086
|
+
workspace,
|
|
3087
|
+
auth,
|
|
3088
|
+
warehouse,
|
|
3089
|
+
requirement("connection", "Lakehouse Federation connection", "DBX_TEST_CONNECTION"),
|
|
3090
|
+
requirement("share", "Delta Sharing share", "DBX_TEST_SHARE"),
|
|
3091
|
+
requirement("clean-room", "Clean Room name", "DBX_TEST_CLEAN_ROOM"),
|
|
3092
|
+
requirement(
|
|
3093
|
+
"federation-assertion",
|
|
3094
|
+
"Federated data-plane SQL",
|
|
3095
|
+
"DBX_TEST_FEDERATION_ASSERTION_SQL"
|
|
3096
|
+
)
|
|
3097
|
+
],
|
|
3098
|
+
docsUrl: `${DOCS2}#federation-delta-sharing-and-clean-rooms`,
|
|
3099
|
+
certificationScopes: [
|
|
3100
|
+
`${AZURE_USER_SCOPE}; managed PostgreSQL federation, Delta Sharing table, and two-metastore Clean Room`
|
|
3101
|
+
]
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
function createSecurityCostDrTargetPack() {
|
|
3105
|
+
return defineTargetPack({
|
|
3106
|
+
id: "security-cost-dr",
|
|
3107
|
+
name: "Networking, security posture, cost and regional DR",
|
|
3108
|
+
description: "IP controls, compute policy, cost guardrail and authenticated secondary-region readiness.",
|
|
3109
|
+
version: "1.0.0",
|
|
3110
|
+
maturity: "live-gated",
|
|
3111
|
+
capabilities: [
|
|
3112
|
+
"network.ip-access",
|
|
3113
|
+
"security.compute-policy",
|
|
3114
|
+
"cost.system-tables",
|
|
3115
|
+
"dr.secondary-region"
|
|
3116
|
+
],
|
|
3117
|
+
checks: () => [restrictedPrincipalCheck(), securityPostureCostCheck(), regionalDrCheck()],
|
|
3118
|
+
requiredChecks: ["security-cost", "regional-dr"],
|
|
3119
|
+
requirements: [
|
|
3120
|
+
workspace,
|
|
3121
|
+
auth,
|
|
3122
|
+
warehouse,
|
|
3123
|
+
requirement(
|
|
3124
|
+
"ip-access-list",
|
|
3125
|
+
"Enabled workspace IP access list",
|
|
3126
|
+
"DBX_TEST_IP_ACCESS_LIST_ID"
|
|
3127
|
+
),
|
|
3128
|
+
requirement("cluster-policy", "Compute policy ID", "DBX_TEST_CLUSTER_POLICY_ID"),
|
|
3129
|
+
requirement("cost-assertion", "Boolean SQL cost guardrail", "DBX_TEST_COST_ASSERTION_SQL"),
|
|
3130
|
+
requirement("dr-workspace", "Secondary workspace host", "DBX_TEST_DR_HOST"),
|
|
3131
|
+
requirement("dr-warehouse", "Running secondary-region warehouse", "DBX_TEST_DR_WAREHOUSE_ID"),
|
|
3132
|
+
requirement("dr-assertion", "Secondary-region workload SQL", "DBX_TEST_DR_ASSERTION_SQL")
|
|
3133
|
+
],
|
|
3134
|
+
docsUrl: `${DOCS2}#networking-security-cost-and-regional-dr`,
|
|
3135
|
+
certificationScopes: [
|
|
3136
|
+
`${AZURE_USER_SCOPE}; TEST-NET block list, bounded compute policy, billing system-table guardrail, and West US 3 serverless DR warehouse`
|
|
3137
|
+
]
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
function createAdvancedTargetPacks() {
|
|
3141
|
+
return [
|
|
3142
|
+
createAdvancedStreamingTargetPack(),
|
|
3143
|
+
createAiBiGenieTargetPack(),
|
|
3144
|
+
createMlflowLifecycleTargetPack(),
|
|
3145
|
+
createFeatureEngineeringTargetPack(),
|
|
3146
|
+
createModelServingTargetPack(),
|
|
3147
|
+
createVectorRagAgentsTargetPack(),
|
|
3148
|
+
createFederationSharingTargetPack(),
|
|
3149
|
+
createSecurityCostDrTargetPack()
|
|
3150
|
+
];
|
|
3151
|
+
}
|
|
3152
|
+
|
|
2351
3153
|
// src/builtin-packs.ts
|
|
2352
3154
|
function createBuiltinTargetPacks() {
|
|
2353
|
-
return [
|
|
3155
|
+
return [
|
|
3156
|
+
...createFoundationTargetPacks(),
|
|
3157
|
+
createLakeflowJobsTargetPack(),
|
|
3158
|
+
...createAdvancedTargetPacks()
|
|
3159
|
+
];
|
|
2354
3160
|
}
|
|
2355
3161
|
var builtinTargetPacks = createBuiltinTargetPacks();
|
|
2356
3162
|
|
|
@@ -2362,7 +3168,10 @@ Object.defineProperty(exports, "waitForDatabricksStatement", {
|
|
|
2362
3168
|
enumerable: true,
|
|
2363
3169
|
get: function () { return databricks.waitForDatabricksStatement; }
|
|
2364
3170
|
});
|
|
3171
|
+
exports.DatabricksAdvancedWorkloadsAdapter = DatabricksAdvancedWorkloadsAdapter;
|
|
2365
3172
|
exports.DatabricksJobsAdapter = DatabricksJobsAdapter;
|
|
3173
|
+
exports.advancedStreamingCdcCheck = advancedStreamingCdcCheck;
|
|
3174
|
+
exports.aiBiDashboardCheck = aiBiDashboardCheck;
|
|
2366
3175
|
exports.appHealthCheck = appHealthCheck;
|
|
2367
3176
|
exports.assertDeltaContract = assertDeltaContract;
|
|
2368
3177
|
exports.autoLoaderIngestionCheck = autoLoaderIngestionCheck;
|
|
@@ -2370,21 +3179,30 @@ exports.backupRestoreCheck = backupRestoreCheck;
|
|
|
2370
3179
|
exports.builtinTargetPacks = builtinTargetPacks;
|
|
2371
3180
|
exports.classicComputeCheck = classicComputeCheck;
|
|
2372
3181
|
exports.compareToGolden = compareToGolden;
|
|
3182
|
+
exports.createAdvancedStreamingTargetPack = createAdvancedStreamingTargetPack;
|
|
3183
|
+
exports.createAdvancedTargetPacks = createAdvancedTargetPacks;
|
|
3184
|
+
exports.createAiBiGenieTargetPack = createAiBiGenieTargetPack;
|
|
2373
3185
|
exports.createAppsOperationalFoundationPack = createAppsOperationalFoundationPack;
|
|
2374
3186
|
exports.createBuiltinTargetPacks = createBuiltinTargetPacks;
|
|
2375
3187
|
exports.createClientFromEnv = createClientFromEnv;
|
|
2376
3188
|
exports.createDuckDbContext = createDuckDbContext;
|
|
2377
3189
|
exports.createEphemeralLakebaseBranch = createEphemeralLakebaseBranch;
|
|
2378
3190
|
exports.createExecutionContext = createExecutionContext;
|
|
3191
|
+
exports.createFeatureEngineeringTargetPack = createFeatureEngineeringTargetPack;
|
|
3192
|
+
exports.createFederationSharingTargetPack = createFederationSharingTargetPack;
|
|
2379
3193
|
exports.createFoundationTargetPacks = createFoundationTargetPacks;
|
|
2380
3194
|
exports.createJobsCodeFoundationPack = createJobsCodeFoundationPack;
|
|
2381
3195
|
exports.createLakebaseTestProvider = createLakebaseTestProvider;
|
|
2382
3196
|
exports.createLakeflowFoundationPack = createLakeflowFoundationPack;
|
|
2383
3197
|
exports.createLakeflowJobsTargetPack = createLakeflowJobsTargetPack;
|
|
3198
|
+
exports.createMlflowLifecycleTargetPack = createMlflowLifecycleTargetPack;
|
|
2384
3199
|
exports.createMockDatabricksClient = createMockDatabricksClient;
|
|
3200
|
+
exports.createModelServingTargetPack = createModelServingTargetPack;
|
|
3201
|
+
exports.createSecurityCostDrTargetPack = createSecurityCostDrTargetPack;
|
|
2385
3202
|
exports.createSqlDeltaFoundationPack = createSqlDeltaFoundationPack;
|
|
2386
3203
|
exports.createTargetPackRegistry = createTargetPackRegistry;
|
|
2387
3204
|
exports.createUnityStorageFoundationPack = createUnityStorageFoundationPack;
|
|
3205
|
+
exports.createVectorRagAgentsTargetPack = createVectorRagAgentsTargetPack;
|
|
2388
3206
|
exports.createWorkspaceContext = createWorkspaceContext;
|
|
2389
3207
|
exports.customLiveCheck = customLiveCheck;
|
|
2390
3208
|
exports.dbtBuildCheck = dbtBuildCheck;
|
|
@@ -2399,12 +3217,18 @@ exports.ensureVolumeDirectory = ensureVolumeDirectory;
|
|
|
2399
3217
|
exports.expectQueryToMatchGolden = expectQueryToMatchGolden;
|
|
2400
3218
|
exports.expectTable = expectTable;
|
|
2401
3219
|
exports.failureRecoveryCheck = failureRecoveryCheck;
|
|
3220
|
+
exports.featureEngineeringServingCheck = featureEngineeringServingCheck;
|
|
3221
|
+
exports.federationSharingCleanRoomsCheck = federationSharingCleanRoomsCheck;
|
|
2402
3222
|
exports.foundationTargetPacks = foundationTargetPacks;
|
|
3223
|
+
exports.genieCheck = genieCheck;
|
|
2403
3224
|
exports.jobRunCheck = jobRunCheck;
|
|
2404
3225
|
exports.jobsCertificationCheck = jobsCertificationCheck;
|
|
2405
3226
|
exports.jobsOrchestrationCheck = jobsOrchestrationCheck;
|
|
2406
3227
|
exports.lakebaseCredentialCheck = lakebaseCredentialCheck;
|
|
2407
3228
|
exports.lakebaseRoundTripCheck = lakebaseRoundTripCheck;
|
|
3229
|
+
exports.lakeflowConnectCheck = lakeflowConnectCheck;
|
|
3230
|
+
exports.mlflowLifecycleCheck = mlflowLifecycleCheck;
|
|
3231
|
+
exports.modelServingCheck = modelServingCheck;
|
|
2408
3232
|
exports.normalizeJobRun = normalizeJobRun;
|
|
2409
3233
|
exports.normalizeRow = normalizeRow;
|
|
2410
3234
|
exports.normalizeVolumeRoot = normalizeVolumeRoot;
|
|
@@ -2414,6 +3238,8 @@ exports.parseJobOrchestrationLiveSpec = parseJobOrchestrationLiveSpec;
|
|
|
2414
3238
|
exports.parseStatementRows = parseStatementRows;
|
|
2415
3239
|
exports.performanceBudgetCheck = performanceBudgetCheck;
|
|
2416
3240
|
exports.pipelineRefreshCheck = pipelineRefreshCheck;
|
|
3241
|
+
exports.ragAgentCheck = ragAgentCheck;
|
|
3242
|
+
exports.regionalDrCheck = regionalDrCheck;
|
|
2417
3243
|
exports.renderJUnit = renderJUnit;
|
|
2418
3244
|
exports.resolveFixtureRows = resolveFixtureRows;
|
|
2419
3245
|
exports.resolveLakebaseProject = resolveLakebaseProject;
|
|
@@ -2425,6 +3251,7 @@ exports.runLiveSuite = runLiveSuite;
|
|
|
2425
3251
|
exports.runTargetPack = runTargetPack;
|
|
2426
3252
|
exports.secretRotationCheck = secretRotationCheck;
|
|
2427
3253
|
exports.secretScopeCheck = secretScopeCheck;
|
|
3254
|
+
exports.securityPostureCostCheck = securityPostureCostCheck;
|
|
2428
3255
|
exports.serverlessComputeCheck = serverlessComputeCheck;
|
|
2429
3256
|
exports.sqlRoundTripCheck = sqlRoundTripCheck;
|
|
2430
3257
|
exports.toLakebaseBranchId = toLakebaseBranchId;
|
|
@@ -2432,6 +3259,7 @@ exports.toNamedParameters = toNamedParameters;
|
|
|
2432
3259
|
exports.unityCatalogAccessCheck = unityCatalogAccessCheck;
|
|
2433
3260
|
exports.uploadVolumeFile = uploadVolumeFile;
|
|
2434
3261
|
exports.validateJobGraph = validateJobGraph;
|
|
3262
|
+
exports.vectorSearchCheck = vectorSearchCheck;
|
|
2435
3263
|
exports.volumeIOCheck = volumeIOCheck;
|
|
2436
3264
|
exports.waitForPipelineUpdate = waitForPipelineUpdate;
|
|
2437
3265
|
//# sourceMappingURL=index.cjs.map
|