Skip to content

Commit 341190e

Browse files
authored
Merge pull request #78 from oceanhackweek/Virtual-branch
Add Callum Rollo's dependencies
2 parents df34d4d + 1e2d1a7 commit 341190e

File tree

5 files changed

+5512
-2381
lines changed

5 files changed

+5512
-2381
lines changed

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
py-build: py-base/conda-linux-64.lock
1+
py-build:
22
docker compose stop py
33
docker compose build py
44

5-
py-base/conda-linux-64.lock: py-base/environment.yml
6-
conda-lock --kind explicit --platform linux-64 -f py-base/environment.yml
7-
mv conda-linux-64.lock py-base/conda-linux-64.lock
8-
9-
py-lock:
10-
conda-lock --kind explicit --platform linux-64 -f py-base/environment.yml
11-
mv conda-linux-64.lock py-base/conda-linux-64.lock
12-
135
py-lab:
146
docker compose up py
157

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ By packaging everything up with Docker we help ensure that code written during t
1717

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

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

2726
## Testing user-generated environments
2827

28+
Our environments are now using pixi to build and manage Conda environments, and pixi-kernel to allow for user installed environments.
29+
30+
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.
31+
32+
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`.
33+
34+
Then for a new tutorial, the feature needs to be added to the `features` list for the environment in `pixi.toml`.
35+
36+
```toml
37+
[environments]
38+
default = {features = ["24-Callum"]}
39+
```
40+
41+
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.
42+
43+
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`.
44+
45+
### Old
46+
2947
Both images use [`nb_conda_kernels` ](https://github.com/Anaconda-Platform/nb_conda_kernels) which allows our users to create their own Conda environments.
3048

3149
This makes it so that we don't have to package everything into the images to start with.

py-base/entrypoint.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)