kai-tub / ip4rs-dependencies

Dependencies for the IP4RS course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IP4RS Dependencies

Dependencies for the IP4RS course.

The repository uses micromamba under the hood and provides some automations via a justfile (see just documentation for more information). Previously, a Docker Image was used as the single source of truth, but we are moving away from it as it provides little benefit over the direct installation via micromamba. micromamba should be prefered if possible and will be used as the baseline to evaluate the homeworks.

Windows users are recommended to install micromamba directly via the Windows Subsystem for Linux (WSL) due to missing support of Windows libraries for some dependencies.

Installation

Installing locally

  1. Install just
  2. Move to the dependency directory and run just install_env_<PLATFORM>
  3. Wait for the command to finish; might take up to 10min for downloading & unpacking
  4. Start jupyter lab (just jupyter) and select the ip4rs kernel

Running over Google Colab

If you need a GPU, you have to select the GPU instance before proceeding! Note that you may not get access to a GPU instance as it is a free service.

To reproduce our environment on Google Colab as closely as possible, we rely on condacolab to install our conda dependencies:

Add these cells to the top of the notebook:

!pip install -q condacolab
import condacolab
condacolab.install()

colab "crashes" and restarts; this is expected. Now we can install our dependencies as follows:

import condacolab
condacolab.check()

!curl https://raw.githubusercontent.com/kai-tub/ip4rs-dependencies/main/conda-linux-64.lock.yml >> lock.yml
!mamba env update -n base -f lock.yml

It will take ~7min to complete and after that you can start programming!

Common issues

A few notes about common issues that we have seen before:

  • Unhelpful error messages during installation about permission issues
    • Potentially full disk, ensure that at least 20GB of free storage is available
  • Cannot access juypter lab with given URL (404 not found)
    • Check that the correct port is used (especially when using docker with -p option)
    • If running WSL: Remote localhost in URL with 0.0.0.0 in browser
  • Google Colab not showing tqdm progress or any stderr
    • No solution exists as Google Colab doesn't show stderr and due to this issue the default tqdm output doesn't work either
  • Google Colab not showing tqdm.notebook output
    • In the default environment Google Colab works, but when installing the environment via the conda-hack, there are issues with the Javascript/Front-end rendering engine; use use tqdm.rich instead

Maintenance

Adding new dependencies

  • Add the new libraries to the environment.yml file and run just update_locks

Testing reproducible version

It may happen that a (transitive) dependency is pulled from conda-forge (or any other conda channel) during the semester. To fix it, simply update/regenerate the lock files! The base environment.yml file is not that restrictive and it should be easy to fix the issue by checking other available options during the resolve phase.

Either way, after installing different library version, all source notebooks have to be re-evaluated!

About

Dependencies for the IP4RS course

License:MIT License


Languages

Language:Just 41.3%Language:Nix 26.4%Language:Dockerfile 17.2%Language:Jupyter Notebook 15.1%