Skip to content

Commit

Permalink
tidy dockerfile and make, comment out arm-incompatible packages
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhq committed Jun 4, 2024
1 parent 5f34442 commit 9d2802e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ base-image :
.PHONY: base-notebook
base-notebook : base-image
cd base-notebook ; \
conda-lock lock -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64
conda-lock lock -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64; \
conda-lock render -k explicit -p linux-64; \
../generate-packages-list.py conda-linux-64.lock > packages.txt; \
docker build -t pangeo/base-notebook:master . ; \
Expand All @@ -22,7 +22,7 @@ pangeo-notebook : base-image
cd pangeo-notebook ; \
conda-lock lock -f environment.yml -f ../base-notebook/environment.yml -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64; \
conda-lock render -k explicit -p linux-64; \
../generate-packages-list.py conda-linux-64.lock > packages-64.txt; \
../generate-packages-list.py conda-linux-64.lock > packages.txt; \
docker build -t pangeo/pangeo-notebook:master . ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) pangeo/pangeo-notebook:master ./run_tests.sh pangeo-notebook

Expand All @@ -31,7 +31,7 @@ ml-notebook : base-image
cd ml-notebook ; \
conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64; \
conda-lock render -k explicit -p linux-64; \
../generate-packages-list.py conda-linux-64.lock > packages-64.txt; \
../generate-packages-list.py conda-linux-64.lock > packages.txt; \
docker build -t pangeo/ml-notebook:master . ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) pangeo/ml-notebook:master ./run_tests.sh ml-notebook

Expand All @@ -40,6 +40,6 @@ pytorch-notebook : base-image
cd pytorch-notebook ; \
conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64; \
conda-lock render -k explicit -p linux-64; \
../generate-packages-list.py conda-linux-64.lock > packages-64.txt; \
../generate-packages-list.py conda-linux-64.lock > packages.txt; \
docker build -t pangeo/pytorch-notebook:master . ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) pangeo/pytorch-notebook:master ./run_tests.sh pytorch-notebook
14 changes: 6 additions & 8 deletions base-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ ONBUILD USER ${NB_USER}
# We want to keep our images as reproducible as possible. If a lock
# file with exact versions of all required packages is present, we use
# it to install packages. conda-lock (https://github.com/conda-incubator/conda-lock)
# is used to generate this conda-${ARCH_LABEL}.lock file from a given environment.yml
# is used to generate this conda-lock.yml file from a given environment.yml
# file - so we get the exact same versions each time the image is built. Since this is
# different packages for different CPU architectures, we determine that dynamically so
# different packages for different CPU architectures
# the same dockerfile can be used to build different architecture images. This
# also lets us see what packages have changed between two images by diffing
# the contents of the lock file between those image versions.
Expand All @@ -159,13 +159,11 @@ ONBUILD USER ${NB_USER}
ONBUILD RUN echo "Checking for 'conda-lock.yml' 'conda-linux-64.lock' or 'environment.yml'..." \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; ARCH=$(uname -m) \
; if [ "${ARCH}" = "x86_64" ] ; then ARCH_LABEL="linux-64"; else ARCH_LABEL="linux-${ARCH}"; fi \
; if test -f "conda-${ARCH_LABEL}.lock" ; then \
mamba create --name ${CONDA_ENV} --file conda-${ARCH_LABEL}.lock \
; elif test -f "environment.yml" ; then \
; if test -f "conda-lock.yml" ; then echo "Using conda-lock.yml" & \
conda-lock install --name ${CONDA_ENV} \
; elif test -f "environment.yml" ; then echo "Using environment.yml" & \
mamba env create --name ${CONDA_ENV} -f environment.yml \
; else echo "No conda-lock.yml, conda-linux-64.lock, or environment.yml! *creating default env*" ; \
; else echo "No conda-lock.yml or environment.yml! *creating default env*" ; \
mamba create --name ${CONDA_ENV} pangeo-notebook \
; fi \
&& mamba clean -yaf \
Expand Down
4 changes: 2 additions & 2 deletions pangeo-notebook/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- cdsapi
- cfgrib
- cf_xarray
- ciso
#- ciso #until compat with osx-arm64
- cmocean
- dask-ml
- datashader
Expand Down Expand Up @@ -111,7 +111,7 @@ dependencies:
- xarray_leaflet
- xarray-spatial
- xbatcher
- xcape
#- xcape #until compat with osx-arm64
- xclim
- xesmf
- xgboost
Expand Down

0 comments on commit 9d2802e

Please sign in to comment.