Skip to content

Commit fa24e13

Browse files
authored
Merge pull request #17 from nmfs-opensci/copilot/remove-env-yml-files
Reorganize environment files into /environment directory
2 parents 2415141 + 4c1314b commit fa24e13

11 files changed

Lines changed: 16 additions & 154 deletions

File tree

.github/scripts/filter_and_validate_packages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def parse_env_files(repo_root: Path) -> Dict[str, Set[str]]:
2626
Returns:
2727
Dictionary mapping filename to set of package names
2828
"""
29-
env_files = sorted(repo_root.glob("env-*.yml"))
29+
env_dir = repo_root / "environment"
30+
env_files = sorted(env_dir.glob("env-*.yml"))
3031
packages_by_file = {}
3132

3233
for env_file in env_files:

.github/workflows/build-and-push.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99
- 'action.yml'
1010
- '.github/workflows/build-and-push.yml'
1111
- 'Dockerfile'
12-
- 'env-*.yml'
13-
- 'environment.yml'
12+
- 'environment/env-*.yml'
1413
- 'install.R'
1514
- 'apt.txt'
1615
- 'Desktop/**'

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ USER root
1313
# Install Zotero; must be run before apt since apt install zotero requires this script be run first
1414
RUN wget -qO- https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | bash
1515

16-
# Copy the repo files into /tmp (env-*.yml, install.R, etc)
16+
# Copy the repo files into /tmp (environment/*.yml, install.R, etc)
1717
COPY . /tmp/
1818

1919
# Update conda env sequentially to prevent hairy solve
20-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/env-core1.yml || (echo "install env-core1 failed" && exit 1)
21-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/env-core2.yml || (echo "install env-core2 failed" && exit 1)
22-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/env-geo.yml || (echo "install env-geo failed" && exit 1)
23-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/env-viz.yml || (echo "install env-viz failed" && exit 1)
24-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/env-qgis.yml || (echo "install env-qgis failed" && exit 1)
20+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment/env-core1.yml || (echo "install env-core1 failed" && exit 1)
21+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment/env-core2.yml || (echo "install env-core2 failed" && exit 1)
22+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment/env-geo.yml || (echo "install env-geo failed" && exit 1)
23+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment/env-viz.yml || (echo "install env-viz failed" && exit 1)
24+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment/env-qgis.yml || (echo "install env-qgis failed" && exit 1)
2525
RUN /pyrocket_scripts/install-apt-packages.sh /tmp/apt.txt || (echo "install-apt-packages.sh failed" && exit 1)
2626
RUN /pyrocket_scripts/install-desktop.sh /tmp/Desktop|| (echo "setup-desktop.sh failed" && exit 1)
2727

NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 2026-02-08
44

5-
* In January 2026, the solver stopped solving. It was also getting long, over an hour. I broke the environment.yml into 5 smaller files and add these sequentially to the conda notebook env. This seemed to fix the impossible to solve environment.
5+
* In January 2026, the solver stopped solving. It was also getting long, over an hour. I broke the main environment file into 5 smaller files (environment/env-*.yml) and add these sequentially to the conda notebook env. This seemed to fix the impossible to solve environment.
66
* Removed some unneeded packages
77
* The R package installs were messed up. First install_geospatial.sh needs to be run first. Then other packages.
88
- When I fixed the problem of installs going to /home (and then getting wiped out), I caused installs via install-r-packages.sh to go to source rather than binary.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TeXLive and Quarto are installed along with MyST and JupyterBook.
1616

1717
Python 3.11 is installed with a conda environment called notebook that is activated on opening the container. R 4.5.X is installed and operates separate from the conda notebook environment (conda is not on the PATH when using R). R can be used from RStudio or JupyterLab and the same R environment is used.
1818

19-
* [Python packages (source env files)](env-core1.yml)
19+
* [Python packages (source env files)](environment/env-core1.yml)
2020
* [R packages (source install file)](install.R)
2121
* [Pinned Python packages](packages-python-pinned.yaml) - Auto-generated list of all Python packages with pinned versions
2222
* [Pinned R packages](packages-r-pinned.R) - Auto-generated list of all R packages with pinned versions
@@ -29,7 +29,7 @@ Python 3.11 is installed with a conda environment called notebook that is activa
2929

3030
## Customizing py-rocket-geospatial-2
3131

32-
* edit the Python packages here `env-*.yml`
32+
* edit the Python packages here `environment/env-*.yml`
3333
* edit the R packages here `install.R`
3434
* update the QGIS, CoastWatch Utilities, and Panoply installs here `Dockerfile`
3535
* update the systems installs here `apt.txt`
@@ -39,16 +39,16 @@ If the changes are core functionality, not scientific, put in an [issue in py-ro
3939
### Package Pinning and Validation
4040

4141
The repository automatically maintains pinned package versions with validation:
42-
- `packages-python-pinned.yaml` - Contains Python packages from env-*.yml files with exact versions (not all 900+ conda packages)
42+
- `packages-python-pinned.yaml` - Contains Python packages from environment/env-*.yml files with exact versions (not all 900+ conda packages)
4343
- `packages-r-pinned.R` - Contains all R packages from the site-library with exact versions
4444
- `build.log` - Validation report showing if all packages from env files and rocker scripts are present
4545

4646
The [Pin Package Versions workflow](.github/workflows/pin-packages.yml):
4747
- Runs automatically after each successful build
4848
- Can be manually triggered from the Actions tab
4949
- Extracts package versions from the published Docker image
50-
- **Filters Python packages** to only include those specified in env-*.yml files
51-
- **Validates Python packages** that all packages from env-*.yml files are present in the container
50+
- **Filters Python packages** to only include those specified in environment/env-*.yml files
51+
- **Validates Python packages** that all packages from environment/env-*.yml files are present in the container
5252
- **Validates R packages** that all packages from install.R, /rocker_scripts/install_geospatial.sh, and /rocker_scripts/install_tidyverse.sh are present in the container
5353
- Creates a PR with:
5454
- Updated pinned package files
@@ -73,7 +73,7 @@ FROM ghcr.io/nmfs-opensci/container-images/py-rocket-geospatial-2:2026.02.08
7373
USER root
7474
7575
COPY . /tmp/
76-
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/environment.yml || echo "install-conda-packages.sh failed" || true
76+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp/your-environment.yml || echo "install-conda-packages.sh failed" || true
7777
RUN /pyrocket_scripts/install-r-packages.sh /tmp/install.R || echo "install-r-package.sh failed" || true
7878
RUN rm -rf /tmp/*
7979

environment.yml

Lines changed: 0 additions & 138 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)