Computational content¶
Jove: a JupyterHub¶
Following a tread which come about due to proposing projects for funding allocations from the digital future fund, the idea of establishing a jupyter server to allow students free and easy access to python computation. Feedback from students is that the online platforms currently used for python computations are limited by the availability of certain libraries, but mostly there is major frustration at the short timeouts for computation. Having our own instance of a jupyter server would alleviate both of these problems, as well as being a generally useful resource.
Benefits¶
The sales points for any proposal: * Equitable access to computing resources for students * Flexibility compared to online solutions (available libraries) * Better integration for content * Better look: the university isn't just using free online resources * Lessens requirements for lab computers
Instance details¶
Background¶
To host a Jupyter server, one must make an instance of Jupyterhub, which conveniently provides a guide to estimating memory/CPU/Disk, but from other sources, one roughly requires:
- 512MB RAM + 1GB of disk + . 5 CPU core per user
So for a class of 30, one would require roughly 16 GB RAM, 32 GB storage, and 16 cores, which is not even a particularly large machine. This could be done locally, or at the college or university level, but given how the university deals with computational infrastructure, that wouldn't happen. So the options are to host it locally, or as Simon suggested at a discipline meeting, one could use NeCTAR. Given the service is a research platform, I contacted the program coordinators to discuss the appropriateness of using the system for teaching resources, and they said no, but yes:
Nectar is intended for research computing rather than teaching, and the official criteria for granting a Nectar National Allocation reflect this.
However, each Nectar node can also offer cloud computing resources to local groups for other purposes, at their discretion.
And then from the local (TPAC) node:
We'd be happy to host you as a 'node local' project . The process for you is like any other project, just apply and fill out as much of the information as you can. Approvals can take a couple of weeks to be processed but I don't see it being a problem in your case.
Application¶
The free-form text fields for the application appear below:
The project is not research based, but teachings based. We wish for students to have equitable access to python computing resources, and currently this is done using online jupyter notebook services, but the nature of free services means there are limitations on the available libraries and critically, there are punitive timeouts, resulting in the regular loss of work. We would like to establish a "Jupyterhub" to allow students access to a local instance of python via a web interface.
The project would be to provide students in maths and physics access to computational resources. The explicit requires have been estimated by approximations found online, but they suggested minimum requirements are 512MB RAM, 1GB of storage, and 0.5 CPU cores per user, and we would estimate that the maximum number of students accessing the service would be 30, although would happily bump that up if possible. The project would require an instance of jupyterhub and management thereof, but then it need only speak to the outside world.
From an brief exchange with nectar team members Steve and Karl (second names unknown), it would seem that given that the project must be supported by the Tasmanian NeCTAR node, but multiple sources have informed me that these resources are underutilised and projects are largely welcomed.
Usage¶
The ideal usage of the Jove is to provide students with a link which provides direct access to the Jupyter Hub with the required code, for example, the distribution of a jupyter notebook. This functionality is available and is relatively streamlined to implement.
Packages¶
Admin privileges, user [[wp>Jupiter_(mythology)#Name_and_epithets|pater]]
- Scipy
- Numpy
- Matplotlib
- Plotly
- Pandas
- Datetime
- Pathlib
- wikitables
Distribution¶
This guide assumes that you have code to which you want to direct students in a directory suitable for distribution. You will also need to be familiar with [[wp>Git|git version control]], or at least have [[https://git-scm.com/downloads|an instance]] of the software on your machine. It the broadest brush strokes, navigate to the directory containing the files to distributed (''projects/my-project'') and then execute the following commands to establish the repository:
The repository will also need to be hosted somewhere, and [[https://github.com/|GitHub]] provides the simplest solution. [[https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/creating-a-new-repository|Create a repository on GitHub]], and get the [[https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories|URL associated with that repository]] and point your local git instance to this remote repository via
Note that [[https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/|GitHub's preferred naming convention]] for the principle branch is being used, rather than the previously preferred ''master'' branch.
With the files available on GitHub (or any other repository), it is necessary that a ''nbgitpuller'' link be created, which is best done using the [[https://jupyterhub.github.io/nbgitpuller/link|link generator site]]. The input fields required are:
- JupyterHub URL (https://jove2021.cloud.edu.au/)
- Git Repository URL and branch (from above)
- File to open (File from repository to open, likely a ''.ipynb'' file)
- Application to open (Classic Jupyter Notebook)
A link will then be generated (near the top of the page) which can be distributed to students. Delightfully, any time a link is selected, the repository on the JupyterHub will be updated, meaning that all distributed content will be kept up-to-date without students being aware. The flip side of this is any changes they make to anything in that directory will be overwritten, so it is important to advertise that any code they wish to keep should be saved in a different directory.
In summary, for creating links for Jove, one should use [[https://jupyterhub.github.io/nbgitpuller/link?hub=https://jove2021.cloud.edu.au|this link]] and add the desired repository. Note that if you are regularly creating links from the same repository to different files, it is possible to add autofill tags to the nbgitpuller link generation page link, specifying the 'repo' and 'branch'. Explicitly, a link of the form
https://jupyterhub.github.io/nbgitpuller/link?hub=https://jove2021.cloud.edu.au&repo=https://github.com/
would create a mostly populated nbgitpuller page.
Educator usage¶
jove2021.cloud.edu.au
GitHub username
Username: pater
Scipy Numpy Matplotlib Plotly Pandas Datetime Pathlib wikitables
http://physlabpi.phys.utas.edu.au/dokuwiki/teaching/jove#a_how_to_guide
How to install packages to the hub Distributing materials Sharing data
https://jupyterhub.github.io/nbgitpuller/install.html#install https://jupyterhub.github.io/nbgitpuller/ https://jupyterhub.github.io/nbgitpuller/link