MCPcopy Index your code
hub / github.com/deepnote/deepnote / runDeepnoteProject

Function runDeepnoteProject

packages/cli/src/commands/run.ts:865–950  ·  view source on GitHub ↗
(path: string | undefined, options: RunOptions)

Source from the content-addressed store, hash-verified

863}
864
865async 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

Callers 1

createRunActionFunction · 0.85

Calls 15

runProjectMethod · 0.95
stopMethod · 0.95
debugFunction · 0.90
outputToonFunction · 0.90
outputJsonFunction · 0.90
setupProjectFunction · 0.85
applyInputOverridesFunction · 0.85
createRunExecutionStateFunction · 0.85
startExecutionEngineFunction · 0.85
startMetricsMonitoringFunction · 0.85

Tested by

no test coverage detected