Scheduling a notebook

Notebook scheduling is not supported if you run your notebook in an IBM Analytics Engine service.

To schedule a notebook job:

  1. Click the jobs icon from the notebook’s menu bar and select Create a job.
  2. Define the job details by entering a name and a description (optional).
  3. On the Configure page, select:

    • A notebook version. The most recently saved version of the notebook is used by default. If no version of the notebook exists, you must create a version by clicking the versions icon from the notebook action bar.
    • A runtime. By default, the job uses the same environment definition that was selected for the notebook.
    • Environment variables. Add environment variables that are passed to the notebook when the job is started and affect the execution of the notebook.

      Each variable declaration must be made for a single variable in the following format VAR_NAME=foo and appear on its own line.

      For example, to determine which data source to access if the same notebook is used in different jobs, you can set the variable DATA_SOURCE to DATA_SOURCE=jdbc:db2// in the notebook job that trains a model and to DATA_SOURCE=jdbc:db2// in the job where the model runs on real data. In another example, the variables BATCH_SIZE, NUM_CLASSES and EPOCHS that are required for a Keras model can be passed to the same notebook with different values in separate jobs.

  4. On the Schedule page, you can select to schedule the job. Ensure that you define meaningful date and time ranges. You can’t change the time zone; the schedule uses the time zone setting on your browser. You can select to exclude days in schedules running by minutes, hours and days. Excluding days is not available for schedules that run by the week, where you must select a specific day in the week, and by the month, where again you must select a day in the month.

    Note that if you exclude certain week days, the job might not run as you would expect. The reason might be due to a discrepancy between the timezone of the user who creates the schedule, and the timezone of the compute node where the job runs.

  5. Review the job settings. Then create the job and run it immediately, or create the job and run it later. All notebook code cells are run and all output cells are updated.

    The notebook job is listed under Jobs in your project.

You can view the other jobs associated with your notebook and the job details:

  • From an opened notebook by clicking the jobs icon from the notebook’s menu bar and selecting Save and view jobs. If more than one job exists for a notebook, select which job details to view.
  • From the Jobs tab of your project by clicking the jobs associated with your notebook.