Skip to content

Commit

Permalink
Simplify conda environments
Browse files Browse the repository at this point in the history
Pin only base dependencies needed for dev and prod environments
- Reduce chances of package conflicts
-Less complexity and easier to manage

Use single .yml for dev (e3sm_diags_env_dev) and for production (e3sm_diags_env) environments
- Conda will automatically resolve OS sub-dependencies so we don't to split envs by OS

Update GitHub Actions workflow
- Use dev .yml for GitHub Actions CI/CD conda environment
- Update step to show Conda env info

Update `e3sm_diags` dependency version to 2.4.0
  • Loading branch information
tomvothecoder committed Feb 25, 2021
1 parent aa581a3 commit 0b2e3cc
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 648 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,34 @@ jobs:
- name: Cache Conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
# Increase this value to reset cache if conda/e3sm_diags_env_dev.yml has not changed in the workflow
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/e3sm_diags_env_testing.yml') }}
hashFiles('conda/e3sm_diags_env_dev.yml') }}

- name: Build Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: e3sm_diags
environment-file: conda/e3sm_diags_env_testing.yml
activate-environment: e3sm_diags_env_dev
environment-file: conda/e3sm_diags_env_dev.yml
channel-priority: strict
python-version: 3.7
auto-update-conda: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Additional Conda Config
- name: Show Conda Environment Info
run: |
conda config --set anaconda_upload no
conda info
conda list
- name: Install Dependencies
- name: Install `e3sm-diags` Package
run: pip install .

- name: Run Tests
run: |
conda info
bash tests/test.sh
publish:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--config=setup.cfg"],
"python.linting.mypyEnabled": true,
"python.pythonPath": "/opt/miniconda3/envs/e3sm_diags/bin/python"
"python.pythonPath": "/opt/miniconda3/envs/e3sm_diags_env_dev/bin/python"
}
171 changes: 9 additions & 162 deletions conda/e3sm_diags_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,172 +4,19 @@ channels:
- defaults
- e3sm
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- attrs=20.3.0
# Base
- beautifulsoup4=4.9.3
- bokeh=2.2.3
- brotlipy=0.7.0
- bzip2=1.0.8
- c-ares=1.17.1
- ca-certificates=2020.11.8
- cartopy=0.18.0
- cdat_info=8.2.1
- cdp=1.7.0
- cdms2==3.1.5
- cdtime=3.1.4
- cdutil=8.2.1
- certifi=2020.11.8
- cffi=1.14.4
- chardet=3.0.4
- click=7.1.2
- cloudpickle=1.6.0
- cryptography=3.2.1
- curl=7.71.1
- cycler=0.10.0
- cytoolz=0.11.0
- dask=2.30.0
- dask-core=2.30.0
- dbus=1.13.6
- distarray=2.12.2
- distributed=2.30.1
- e3sm=2.3.0
- esmf=8.0.1
- esmpy=8.0.1
- expat=2.2.9
- fontconfig=2.13.1
- freetype=2.10.4
- fsspec=0.8.4
- future=0.18.2
- g2clib=1.6.0
- genutil=8.2.1
- geos=3.8.1
- gettext=0.19.8.1
- glib=2.66.3
- gst-plugins-base=1.14.5
- gstreamer=1.14.5
- hdf4=4.2.13
- hdf5=1.10.6
- heapdict=1.0.1
- icu=67.1
- idna=2.10
- importlib-metadata=3.1.0
- importlib_metadata=3.1.0
- ipython_genutils=0.2.0
- jasper=1.900.1
- jinja2=2.11.2
- jpeg=9d
- jsonschema=3.2.0
- jupyter_core=4.7.0
- kiwisolver=1.3.1
- krb5=1.17.2
- lazy-object-proxy=1.5.2
- lcms2=2.11
- ld_impl_linux-64=2.35.1
- libblas=3.8.0
- libcblas=3.8.0
- libcdms=3.1.2
- libcf=1.0.3
- libclang=10.0.1
- libcurl=7.71.1
- libdrs=3.1.2
- libdrs_f=3.1.2
- libedit=3.1.20191231
- libev=4.33
- libevent=2.1.10
- libffi=3.2.1
- libgcc-ng=9.3.0
- libgfortran-ng=9.3.0
- libgfortran5=9.3.0
- libglib=2.66.3
- libgomp=9.3.0
- libiconv=1.16
- liblapack=3.8.0
- libllvm10=10.0.1
- libnetcdf=4.7.4
- libnghttp2=1.41.0
- libopenblas=0.3.10
- libpng=1.6.37
- libpq=12.3
- libssh2=1.9.0
- libstdcxx-ng=9.3.0
- libtiff=4.1.0
- libuuid=2.32.1
- libwebp-base=1.1.0
- libxcb=1.13
- libxkbcommon=0.10.0
- libxml2=2.9.10
- libxslt=1.1.33
- locket=0.2.0
- lxml=4.6.2
- lz4-c=1.9.2
- markupsafe=1.1.1
- matplotlib=3.3.3
- matplotlib-base=3.3.3
- msgpack-python=1.0.0
- mysql-common=8.0.21
- mysql-libs=8.0.21
- nbformat=5.0.8
- ncurses=6.2
- netcdf-fortran=4.5.3
- nspr=4.29
- nss=3.59
- numpy=1.19.4
- olefile=0.46
- openblas=0.3.10
- openssl=1.1.1h
- output_viewer=1.3.1
- packaging=20.4
- pandas=1.1.4
- partd=1.1.0
- pcre=8.44
- pillow=8.0.1
- pip=20.3
- proj=7.1.1
- psutil=5.7.3
- pthread-stubs=0.4
- pycparser=2.20
- pyopenssl=20.0.0
- pyparsing=2.4.7
- pyqt=5.12.3
- pyrsistent=0.17.3
- pyshp=2.1.2
- pysocks=1.7.1
- python=3.7.8
- python-dateutil=2.8.1
- python_abi=3.7
- pytz=2020.4
- pyyaml=5.3.1
- qt=5.12.9
- readline=8.0
- requests=2.25.0
- scipy=1.5.3
- setuptools=49.6.0
- shapely=1.7.1
- six=1.15.0
- sortedcontainers=2.3.0
- soupsieve=2.0.1
- sqlite=3.33.0
- tblib=1.6.0
- tk=8.6.10
- toolz=0.11.1
- tornado=6.1
- traitlets=5.0.5
- typing_extensions=3.7.4.3
- udunits2=2.2.27.6
- urllib3=1.25.11
- wheel=0.36.0
- xorg-libxau=1.0.9
- xorg-libxdmcp=1.1.3
- xz=5.2.5
- yaml=0.2.5
- zict=2.0.0
- zipp=3.4.0
- zlib=1.2.11
- zstd=1.4.5
- pip:
- cdms2==3.1.5
- pyqt5-sip==4.19.18
- pyqtchart==5.12
- pyqtwebengine==5.12.1
- regrid2==3.1.5
prefix: /export/zhang40/miniconda3/envs/e3sm_diags_env
- matplotlib=3.3.4
- numpy=1.20.1
- pip=21.0.1
- python=3.7.10
# Additional
- e3sm_diags=2.4.0
prefix: /opt/miniconda3/envs/e3sm_diags_env
Loading

0 comments on commit 0b2e3cc

Please sign in to comment.