Move a research notebook from Google Colab to JupyterHub
Reproduce a Colab analysis on a private JupyterHub with the same inputs, an explicit Python environment and a clean rerun before moving the lab.
Last updated
In short
- Export the notebook and identify the files, packages and hardware supplied by its runtime.
- Run the same input snapshot from a clean kernel and compare the records the analysis produces.
- Move one research group at a time and keep its original analysis reproducible until sign-off.
On this page (4)
Migration plans · See also JupyterHub
Choose a result someone can verify
Pick a notebook that contributed to a finished piece of work. For example, a research analyst matched hospital records from two registers and handed the accepted matches to a colleague. Preserve both input snapshots, the notebook revision and the accepted match list. Ask that colleague to identify the results that would change a decision. A notebook that runs to the last cell can still join the wrong records.
Recover the environment around the notebook
Download the notebook in Jupyter format. Google stores Colab notebooks separately from the virtual machines on which they execute. A collaborator opening the file can receive its saved output, while installed libraries and files held only by the runtime require a separate transfer. Inspect output cells before placing a notebook in a shared repository. Google Colab FAQ
| Dependency in the old analysis | What to establish on JupyterHub |
|---|---|
| A mounted Drive folder | Identify its owner, exact input revision and permitted readers. Test the replacement storage path as an ordinary analyst. |
| A package installed interactively | Record the Python and package versions from a successful run. Recreate the environment from that record and restart the kernel. |
| A GPU or TPU runtime | List the cells that need an accelerator. Pilae’s published JupyterHub recipe provisions CPU resources. Agree on a separate runtime for those cells before moving the workload. |
| A credential available in the former session | Arrange access through the research group’s approved credential store and verify its scope against a read-only test dataset. |
Rehearse under the permissions researchers will have
Start with a group whose members may work within the same trust boundary. Pilae’s JupyterHub recipe places notebook servers on one host with a shared web origin. Two research teams working under incompatible data-sharing agreements need a separate deployment decision. Test read access to the approved inputs and ask a second account outside the group to check the boundary. JupyterHub security overview
Run all cells in order from a clean kernel. Write the candidate output to a new location. For the hospital-register example, compare the input record counts, the set of accepted identifier pairs, duplicates on each side and unresolved records. Two runs can produce the same number of matches while pairing different hospitals. Record differences and obtain a decision from the analyst who owns the match rules. If a model uses randomness, document its seed and the tolerance agreed for the result.
Switch the working copy and rehearse the way back
Have a second analyst run the approved revision using their own account. Restart their notebook server and reopen the outputs intended to persist. Agree where the authoritative notebook and results will live, then change the lab’s links and handover instructions together.
Keep the old notebook revision, the input snapshots and the last accepted result for the agreed retention period. If the new environment fails acceptance, withdraw the candidate output and direct readers to the last accepted result. Resume computation in the former environment only if its use is still authorised for that dataset. Record any work produced during the pilot before either copy is retired.
