Search code examples
jupyter-notebookjupyterjupyter-labjupyterhub

Is there a way to set up a job scheduler to run a Jupyter Notebook with the input code hidden through JupyterLab Real-Time Collaboration?


I am setting up a JupyterHub server and I would like to be able to do the following three things:

  1. Enable JupyterLab Real-Time collaboration: https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/
  2. Set up some type of job scheduler in JupyterLab (such as https://pypi.org/project/jupyterlab-scheduler/ or https://jupyter-scheduler.readthedocs.io/en/latest/users/index.html#installation) to run my Jupyter Notebook nightly and output as HTML
  3. Have the input code hidden from the resulting HTML file generated by the scheduler.

I am able to get either JupyterLab Real-Time collaboration (#1) and Jupyter Scheduler (#2) working together without the input code being hidden (#3), or I can get JupyterLab Real-Time collaboration (#1) working with the input code being hidden by the generated HTML (#3) but this seems to break the job scheduler.

Is there any way to get all three of these features working at the same time? Is there some other package or extension I can use to do this?


Solution

  • Had to use a bit of a work-around but got everything set up in the end using the following workflow:

    1. Updated jupyter and all related packages/extensions
    2. Enabled JupyterLab Real-time Collaboration
    3. Downloaded the jupyter-scheduler extension
    4. Created the python script "generate_report.ipynb" to convert my Jupyter Notebook to HTML with the "--no-input" flag using the command: jupyter nbconvert --to html --no-input report_results.ipynb
    5. Used the jupyter-scheduler extension to set up a job to run the "generate_report.ipynb" script which executes the nbconvert command and produces the desired output.