Running Bash in a Jupyter Notebook on TACC Vista
The easiest install of the set, and arguably the most useful for teaching. No kernelspec patching, no environment variables, no gotchas.
Install
unset PYTHONPATH
source $WORK/miniforge3/etc/profile.d/conda.sh
conda create -y -n kbash -c conda-forge python bash_kernel
conda activate kbash
python -m bash_kernel.install --user
--user writes straight to ~/.local/share/jupyter/kernels/bash/ with an absolute interpreter path, so it works from any node with no further edits. Restart the Jupyter session and Bash appears in the picker.
Why bother, when there is a terminal
For beginners, the terminal is the barrier, not the concepts. A notebook lets you teach Linux and Slurm the same way you teach Python: narrative markdown between cells, output preserved, the whole session saved and re-runnable.
Practical wins:
- Students can re-run a cell after it fails without retyping.
- Their work is a file you can collect and grade.
- Markdown cells carry the explanation, so the handout and the exercise are the same document.
- Nobody gets lost in
vim.
Reasonable material for it: module spider, module load, navigating $HOME / $WORK / $SCRATCH, checking quotas, squeue, sbatch, sacct, reading a job script, inspecting output files.
What it cannot do
Each cell runs in a persistent shell session, which covers most of what you want, but:
- No interactive programs. Anything that expects a TTY (
vim,nano,top,idev) will hang. Teach those in a real terminal. - Not a job. The kernel runs wherever TAP put it.
sbatchsubmits normally, but the notebook is not itself running under your allocation in the way anidevsession is. - Long-running commands block the cell with no output until they finish.
Verifying
hostname
module list
squeue -u $USER