Skip to content

Commit

Permalink
Merge pull request #78 from oceanhackweek/Virtual-branch
Browse files Browse the repository at this point in the history
Add Callum Rollo's dependencies
  • Loading branch information
abkfenris authored Aug 13, 2024
2 parents df34d4d + 1e2d1a7 commit 341190e
Show file tree
Hide file tree
Showing 5 changed files with 5,512 additions and 2,381 deletions.
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
py-build: py-base/conda-linux-64.lock
py-build:
docker compose stop py
docker compose build py

py-base/conda-linux-64.lock: py-base/environment.yml
conda-lock --kind explicit --platform linux-64 -f py-base/environment.yml
mv conda-linux-64.lock py-base/conda-linux-64.lock

py-lock:
conda-lock --kind explicit --platform linux-64 -f py-base/environment.yml
mv conda-linux-64.lock py-base/conda-linux-64.lock

py-lab:
docker compose up py

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ By packaging everything up with Docker we help ensure that code written during t

There are a handful of helpful `make` commands for building and testing images.

- `py-lock` - Generate a new Python lockfile.
- `py-build` - Build Python Docker container (should regenerate lockfile if `environment.yml` was changed).
- `py-lab` - Launch JupyterLab for Python image. Watch the terminal output for a `127.0.0.1:8080/...` link with the access token.
- `r-lock` - Generate a new R lockfile.
Expand All @@ -26,6 +25,25 @@ There are a handful of helpful `make` commands for building and testing images.

## Testing user-generated environments

Our environments are now using pixi to build and manage Conda environments, and pixi-kernel to allow for user installed environments.

The base (default) environment is built up of multiple features, each one corresponding to a specific tutorial. It's fine to overlap dependencies between tutorials, as that makes sure we don't remove them inadvertantly.

To add dependencies for a tutorial, `pixi add -f year-presenter deps...`, for example: `pixi add -f 24-Callum numpy cartopy pandas gsw matplotlib seaborn cmocean cmcrameri tqdm seaborn argopy ipyleaflet searvey shapely cftime ioos_qc cf_xarray`.

Then for a new tutorial, the feature needs to be added to the `features` list for the environment in `pixi.toml`.

```toml
[environments]
default = {features = ["24-Callum"]}
```

Then run `pixi install` and pixi will figure out all the transitive dependencies for multiple deployment environments (Mac and Linux, Windows can be added easily) and try to lock the most common environment for all of them.

If packages are being added to an existing feature that is already part of the default feature, then `pixi install` should not need to be run as the lock file will be updated during `pixi add`.

### Old

Both images use [`nb_conda_kernels` ](https://github.com/Anaconda-Platform/nb_conda_kernels) which allows our users to create their own Conda environments.

This makes it so that we don't have to package everything into the images to start with.
Expand Down
2 changes: 0 additions & 2 deletions py-base/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 341190e

Please sign in to comment.