From fad8b3e17089506cef7cc89efbc28ed90cd90572 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Thu, 18 Jan 2024 11:36:51 -0700 Subject: [PATCH 1/4] Collocate conda environment files Also added all the cupid dependencies to the development environment --- README.md | 6 +++--- cupid/dev-environment.yml | 6 ------ .../cupid-analysis.yml | 0 environments/dev-environment.yml | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 9 deletions(-) delete mode 100644 cupid/dev-environment.yml rename cupid-analysis.yml => environments/cupid-analysis.yml (100%) create mode 100644 environments/dev-environment.yml diff --git a/README.md b/README.md index 2939a5c..56597dc 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,15 @@ $ ./manage_externals/checkout_externals Then build the necessary conda environments with ``` -$ conda env create -f cupid/dev-environment.yml +$ mamba env create -f environments/dev-environment.yml $ conda activate cupid-dev $ which cupid-run -$ conda env create -f cupid-analysis.yml +$ mamba env create -f environments/cupid-analysis.yml ``` Notes: -1. `conda` now defaults to using `mamba` to solve environments; the `cupid-analysis.yml` environment is complicated, so older versions of `conda` should be updated (`conda update -n base conda`) or you should use `mamba` instead. +1. As of version 23.10.0, `conda` defaults to using `mamba` to solve environments. It still feels slower than running `mamba` directly, hence the recommendation to install with `mamba env create` rather than `conda env create`. 1. If `./manage_externals/checkout_externals` is not found, run `git submodule update --init` to clone the submodule. 1. If `which cupid-run` returned the error `which: no cupid-run in ($PATH)`, then please run the following: diff --git a/cupid/dev-environment.yml b/cupid/dev-environment.yml deleted file mode 100644 index a821d37..0000000 --- a/cupid/dev-environment.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: cupid-dev -dependencies: - - python==3.11.4 - - pip - - pip: - - -e ../ diff --git a/cupid-analysis.yml b/environments/cupid-analysis.yml similarity index 100% rename from cupid-analysis.yml rename to environments/cupid-analysis.yml diff --git a/environments/dev-environment.yml b/environments/dev-environment.yml new file mode 100644 index 0000000..58f940d --- /dev/null +++ b/environments/dev-environment.yml @@ -0,0 +1,18 @@ +name: cupid-dev +dependencies: + - python=3.11.4 + - black + - dask + - dask-jobqueue + - intake + - intake-esm + - jinja2 + - jupyter-book + - pandas + - papermill + - pip + - ploomber=0.22.3 + - pyyaml + - xarray + - pip: + - -e ../ From 8268c9c4b59868362e094aac845a9b58b597d7ab Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 19 Jan 2024 10:58:53 -0700 Subject: [PATCH 2/4] Move docs.yml to environments Also created environments/README to document the various environments provided --- .github/workflows/deploy.yml | 4 ++-- environments/README | 10 ++++++++++ {build_envs => environments}/docs.yml | 0 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 environments/README rename {build_envs => environments}/docs.yml (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a3da887..2c6a042 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,7 +45,7 @@ jobs: - name: Set up conda environment uses: mamba-org/setup-micromamba@v1 with: - environment-file: build_envs/docs.yml + environment-file: environments/docs.yml cache-environment: true cache-environment-key: "docs-${{env.TODAY}}" create-args: >- @@ -99,4 +99,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 diff --git a/environments/README b/environments/README new file mode 100644 index 0000000..60310aa --- /dev/null +++ b/environments/README @@ -0,0 +1,10 @@ +This directory contains three conda environment files: + +1. dev-environment.yml: this creates (cupid-dev), which provides cupid-run and cupid-build, + and lets users update the main CUPiD code in cupid/ + +2. cupid-analysis.yml: this creates (cupid-analysis), the environment all scripts and notebooks + run in + +3. docs.yml: this creates (cupid-docs), which is used by github actions to build + https://ncar.github.io/CUPiD diff --git a/build_envs/docs.yml b/environments/docs.yml similarity index 100% rename from build_envs/docs.yml rename to environments/docs.yml From 1cee1afae3eea48d470d3901c2cc7d409d7fed61 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 19 Jan 2024 14:28:02 -0700 Subject: [PATCH 3/4] Add suggestion about running conda --version --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51fb4b4..fc097a3 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,9 @@ $ mamba env create -f environments/cupid-analysis.yml Notes: -1. As of version 23.10.0, `conda` defaults to using `mamba` to solve environments. It still feels slower than running `mamba` directly, hence the recommendation to install with `mamba env create` rather than `conda env create`. +1. As of version 23.10.0, `conda` defaults to using `mamba` to solve environments. +It still feels slower than running `mamba` directly, hence the recommendation to install with `mamba env create` rather than `conda env create`. +(To see what version of conda you have installed, run `conda --version`.) 1. If `./manage_externals/checkout_externals` is not found, run `git submodule update --init` to clone the submodule. 1. If `which cupid-run` returned the error `which: no cupid-run in ($PATH)`, then please run the following: From 3b85ec21a482407912f38762ae45c7a012b6471d Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 19 Jan 2024 14:33:28 -0700 Subject: [PATCH 4/4] Add comment about conda working but slowly --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fc097a3..18d5477 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Notes: 1. As of version 23.10.0, `conda` defaults to using `mamba` to solve environments. It still feels slower than running `mamba` directly, hence the recommendation to install with `mamba env create` rather than `conda env create`. +If you do not have `mamba` installed, you can still use `conda`... it will just be significantly slower. (To see what version of conda you have installed, run `conda --version`.) 1. If `./manage_externals/checkout_externals` is not found, run `git submodule update --init` to clone the submodule. 1. If `which cupid-run` returned the error `which: no cupid-run in ($PATH)`, then please run the following: