researchcloud-items

Installation scripts for SURF ResearchCloud catalog components

View the Project on GitHub UtrechtUniversity/researchcloud-items

Playbook Custom Packages

back to index

Summary

This component serves three purposes:

  1. Download projects (see below for what counts as a ‘project’)
  2. Automatically detect their dependencies
  3. Install the dependencies into separate environments
  4. Create Jupyter kernels for these environments

This means a user can create a workspace, provide a list of URLs/project identifiers, and a workspace will be created that contains their projects, including Notebooks, with pre-created environments in which the dependencies are already installed. This allows easy reproducibility, and prevents users from having to re-install projects and dependencies every time they re-create a workspace.

Catalog items can set the custom_packages_projects parameter to ‘Interactive’ to let users provide URLs/project identifiers in the last step of workspace creation.

Please note that the created environments will be read-only (unless users have sudo rights).

Supported projects

A project can be either a git repo, or a Dataverse or Zenodo project. We can specify either direct URLs, or DOIs (or Dataverse or Zenodo identifiers) pointing at one of the former.

Users can specify a specific version (e.g. git tag, brach or commit) of a project by adding @myversion after a project identifier. For instance: https://github.com/binder-examples/conda.git@nbgitpuller.

See here for supported languages/dependency types.

Requirements

Description

This component:

  1. Install repo2kernel and its dependencies. It will be added to PATH so users can also use repo2kernel after the workspace is created.
    • this includes miniconda, julia, uv
  2. Fetches the determined projects
  3. Creates environments for them in the location specified by the custom_packages_env_dir parameter
  4. Creates Jupyter kernels for these environments that are installed ‘globally’ (i.e. all Jupyter users can find the kernels)

This component uses the repo2kernel utility. This is broadly compatible with Jupyter’s Binder, so that any projects that can be launched with Binder can most likely also be resolved by repo2kernel.

Downloading projects

Downloaded projects will by default will stored in the directory specified by the custom_packages_code_dir parameter. Each project will be stored in its own folder, which will receive a name that is based on the provided project identifier. For instance, if a DOI was provided, the directory name will be the DOI (with certain disallowed characters removed). If a URL to a git repo was provided, e.g. https://github.com/UtrechtUniversity/repo2kernel.git the name of the project’s directory will be repo2kernel.

Users can specify a specific version (e.g. git tag, brach or commit) of a project by adding @myversion after a project identifier. For instance: https://github.com/binder-examples/conda.git@nbgitpuller will fetch the nbgitpuller.

Using this component without Jupyter

The installed environments can also be used without Jupyter by setting the custom_packages_create_kernels parameter to false. Naturally, projects will be downloaded as normal, and the created dependency environments can be used manually:

Error handling

It is possible that repo2kernel fails to create the required dependency environments, or to install a kernel for it. In that case, the component will not fail, so the workspace is still created. Debug output for repo2kernel is saved in each downloaded project’s folder, by default in /local-share/<project_name>/repo2kernel.log.

Parameters

History

2025 Written by Dawa Ometto (Utrecht University)

back to index