(path: string | undefined, options: RunOptions)
| 863 | } |
| 864 | |
| 865 | async function runDeepnoteProject(path: string | undefined, options: RunOptions): Promise<void> { |
| 866 | const { absolutePath, workingDirectory, pythonEnv, inputs, isMachineOutput, convertedFile, file, allIntegrations } = |
| 867 | await setupProject(path, options) |
| 868 | |
| 869 | debug(`Inputs: ${JSON.stringify(inputs)}`) |
| 870 | |
| 871 | // Apply CLI --input overrides to input block metadata |
| 872 | applyInputOverrides(file, inputs) |
| 873 | |
| 874 | const state = createRunExecutionState(options, isMachineOutput) |
| 875 | const engine = new ExecutionEngine({ |
| 876 | pythonEnv, |
| 877 | workingDirectory, |
| 878 | }) |
| 879 | const restoreConsoleDebug = suppressMachineOutputDebugNoise(isMachineOutput) |
| 880 | let engineStarted = false |
| 881 | let metricsInterval: ReturnType<typeof setInterval> | null = null |
| 882 | |
| 883 | try { |
| 884 | await startExecutionEngine(engine, isMachineOutput) |
| 885 | engineStarted = true |
| 886 | metricsInterval = await startMetricsMonitoring(engine, state.showTop) |
| 887 | |
| 888 | // Track execution timing for snapshot |
| 889 | const executionStartedAt = new Date().toISOString() |
| 890 | const blockIds = await resolveUpstreamExecutionBlockIds(file, options, pythonEnv) |
| 891 | |
| 892 | // Use runProject instead of runFile since we may have converted the file in memory |
| 893 | const summary = await engine.runProject(file, { |
| 894 | notebookName: options.notebook, |
| 895 | blockId: options.block, |
| 896 | blockIds, |
| 897 | inputs, |
| 898 | integrations: allIntegrations.map(i => ({ id: i.id, name: i.name, type: i.type })), |
| 899 | ...createRunProjectCallbacks({ engine, isMachineOutput, state }), |
| 900 | }) |
| 901 | |
| 902 | await saveExecutionSnapshotBestEffort({ |
| 903 | absolutePath, |
| 904 | convertedFile, |
| 905 | file, |
| 906 | blockResults: state.blockResults, |
| 907 | executionStartedAt, |
| 908 | isMachineOutput, |
| 909 | }) |
| 910 | |
| 911 | const exitCode = summary.failedBlocks > 0 ? ExitCode.Error : ExitCode.Success |
| 912 | |
| 913 | if (isMachineOutput) { |
| 914 | const result = await buildMachineRunResult({ |
| 915 | absolutePath, |
| 916 | file, |
| 917 | pythonEnv, |
| 918 | options, |
| 919 | summary, |
| 920 | blockResults: state.blockResults, |
| 921 | }) |
| 922 |
no test coverage detected