jupyter-server/jupyter-scheduler

Ensure that notebook is ran only once

andrii-i opened this issue · 1 comments

Description

When notebook is executed by Scheduler, it must be executed only once, not 1 time for the job + 1 time for every output format

Notebook is executed exactly once for each job, in the preprocessor call:

To verify this:

  1. Create a notebook with the following code in the cell:
if 'execution_count' not in globals():
    execution_count = 0 
execution_count += 1 
print(f"This notebook has been executed {execution_count} times.")
  1. Schedule a notebook execution, check output files for number of executions
image