When you open GeoLab and select an environment, you launch a pre-configured virtual Python environment that includes commonly used geophysics software. You can install additional software and packages in GeoLab, using one of several options:
Ephemeral Installation:¶
Environments in JupyterHub are temporary. Packages installed while using GeoLab are only valid during the current session and will not persist from one session to the next. Packages must be reinstalled every time a new GeoLab instance is launched. For ephemeral installs, add packages using line magic commands.
Because installations are temporary, we recommend adding these commands to the beginning of a notebook. This ensures the required packages are installed and available each time the notebook runs.
Use the %pip / %conda magic commands because they execute in the active Python notebook kernel. The ! magic command executes in the system shell and is best used for running CLI tools or file-system checks.
%pip install pkgnameFor more information about managing environments, go to Managing Environments for detailed instructions.
Build a Custom Image:¶
If your task or analysis requires the same software over multiple sessions or for multiple users, building a custom image with the required packages is best practice.
Building a custom image requires software such as Docker to build the images. GeoLab can use custom images available on public image repositories such as Docker Hub, GitHub Container Registry (ghcr), or AWS Elastic Container Registry (ECR).
For more information about building a custom image, go to Building Custom Images for detailed instructions on building and pushing images to an image repository.
Run an Image From a GitHub Code Repository With Binder¶
GeoLab can run environments from a GitHub repository using Binder. The process is similar to building a custom image, but instead of building and storing the image with Docker, you provide the URL of the GitHub repository to GeoLab and the image will be dynamically built and opened.
While this is the simplest method for building and running a custom image, GeoLab builds the image every time. The build process can take some time and is not ideal for multiple users. By contrast, an image in a repository is pulled directly into JupyterHub and started without waiting for it to be built.
For more information about using Binder, go to Binder for Images for detailed instructions on building a repository that works with Binder.
Bring a JupyterHub Image¶
Other organizations, such as NASA or NOAA, maintain their own JupyterHub compute environment images that run in GeoLab. Using an image from another organization uses the same process as a custom image. Select Other... in the Environment pull-down menu, enter the image URL, select the Resource Allocation, and select Start.