Skip to content

Commit

Permalink
Fix docker build for 1.2.0 (#50)
Browse files Browse the repository at this point in the history
mamba-ify the previous conda-pip installation
  • Loading branch information
SarahG-579462 authored May 23, 2024
2 parents 913d7a8 + 4d274e5 commit 4becfc6
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 136 deletions.
31 changes: 13 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
FROM continuumio/miniconda3 as base
FROM mambaorg/micromamba as base

# The environment variable ensures that the python output is set straight
# to the terminal without buffering it first
ENV PYTHONUNBUFFERED 1

WORKDIR /app
RUN conda install python=3.9 -y
RUN conda install --channel conda-forge cartopy -y
RUN conda install --channel conda-forge esmpy && conda clean -afy

COPY ./requirements_minimal.txt /app/
COPY ./environment.yml /app

RUN pip install -r requirements_minimal.txt
RUN apt update
RUN apt install -y libtiff5
RUN micromamba install -y -n base -f environment.yml && micromamba clean -afy

RUN mkdir -p /notebook_dir/writable-workspace
ENV MAMBA_DOCKERFILE_ACTIVATE=1
RUN python -c 'import uuid; print(uuid.uuid4())' > /tmp/my_uuid

# RUN pip install -r requirements_minimal.txt

USER root
RUN mkdir -p /notebook_dir/writable-workspace && chown -R ${MAMBA_USER} /notebook_dir

WORKDIR /

COPY . app
COPY --chown=${MAMBA_USER} . app

WORKDIR /app

RUN pip install ./
RUN pip install --no-dependencies ./
USER ${MAMBA_USER}

EXPOSE 5006

Expand All @@ -40,10 +42,3 @@ ENV SHOW_HEADER=1
ENV SHOW_MODAL=1

CMD exec ./start_panel.sh

FROM base as base-fr

ENV LANG=fr
ENV PREFIX=analogs-fr

CMD exec ./start_panel.sh
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ profile:
panel serve Dashboard.py --prefix analogs --autoreload --log-level=debug --admin --profiler snakeviz --static-dirs fonts=./fonts

build-local:
docker build --target base -t analogues-spatiaux-en:dev .
docker build --target base-fr -t analogues-spatiaux-fr:dev .
docker build --target base -t analogues-spatiaux:dev .

run-local:
docker run -p 5006:5006 -d -e BOKEH_ALLOW_WS_ORIGIN=* analogues-spatiaux-en:dev
docker run -p 5007:5006 -d -e BOKEH_ALLOW_WS_ORIGIN=* analogues-spatiaux-fr:dev
docker rm -f analogues-spatiaux-en analogues-spatiaux-fr
docker run -p 5006:5006 -d -e LANG=en -e BOKEH_ALLOW_WS_ORIGIN=* --name analogues-spatiaux-en analogues-spatiaux:dev
docker run -p 5007:5006 -d -e LANG=fr -e BOKEH_ALLOW_WS_ORIGIN=* --name analogues-spatiaux-fr analogues-spatiaux:dev

rm-local:
CONTAINER_NAME="$(shell docker ps -a -q --filter ancestor='analogues-spatiaux-en:dev' --format="{{.ID}}")";docker stop $$CONTAINER_NAME;docker rm $$CONTAINER_NAME
Expand Down
29 changes: 29 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: analogues
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- cartopy=0.21
- esmpy=8.4
- xclim=0.44
- pandas=1.3
- panel=0.14
- param=1.13
- bokeh=2.4
- statsmodels
- numpy=1.22
- clisops=0.11
- dask=2023.8
- geopandas=0.13
- intake=0.7
- joblib=1.3
- jupyter=1.0
- matplotlib=3.4
- PyYAML=6.0
- Shapely=2.0
- xarray=2023.1
- xesmf=0.7
- geoviews=1.9
- hvplot=0.8
- pyogrio=0.6
2 changes: 0 additions & 2 deletions requirements.dev.txt

This file was deleted.

72 changes: 0 additions & 72 deletions requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions requirements_minimal.txt

This file was deleted.

182 changes: 182 additions & 0 deletions requirements_prod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# requirements as of september 2023, kept for posterity.
anyio==3.7.1
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
async-lru==2.0.4
attrs==23.1.0
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
bokeh==2.4.3
boltons==23.0.0
Bottleneck==1.3.7
brotlipy==0.7.0
Cartopy==0.21.1
certifi==2023.7.22
cf-xarray==0.8.4
cffi==1.15.1
cftime==1.6.2
charset-normalizer==2.0.4
click==8.1.7
click-plugins==1.1.1
cligj==0.7.2
clisops==0.11.0
cloudpickle==2.2.1
colorcet==3.0.1
comm==0.1.4
cryptography==39.0.1
cycler==0.11.0
dask==2023.8.1
debugpy==1.6.7.post1
decorator==5.1.1
defusedxml==0.7.1
distributed==2023.8.1
entrypoints==0.4
esmpy==8.4.2
exceptiongroup==1.1.3
executing==1.2.0
fastjsonschema==2.18.0
Fiona==1.9.4.post1
fqdn==1.5.1
fsspec==2023.6.0
geopandas==0.13.2
geoviews==1.9.6
holoviews==1.17.1
hvplot==0.8.4
idna==3.4
importlib-metadata==6.8.0
intake==0.7.0
ipykernel==6.25.1
ipython==8.14.0
ipython-genutils==0.2.0
ipywidgets==8.1.0
isoduration==20.11.0
jedi==0.19.0
Jinja2==3.1.2
joblib==1.3.2
json5==0.9.14
jsonpatch==1.32
jsonpickle==3.0.2
jsonpointer==2.1
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
jupyter==1.0.0
jupyter_client==8.3.1
jupyter-console==6.6.3
jupyter_core==5.3.1
jupyter-events==0.7.0
jupyter-lsp==2.2.0
jupyter_server==2.7.2
jupyter_server_terminals==0.4.4
jupyterlab==4.0.5
jupyterlab-pygments==0.2.2
jupyterlab_server==2.24.0
jupyterlab-widgets==3.0.8
kiwisolver==1.4.4
llvmlite==0.40.1
lmoments3==1.0.6
locket==1.0.0
loguru==0.7.0
lz4==4.3.2
Markdown==3.4.4
MarkupSafe==2.1.3
matplotlib==3.4.3
matplotlib-inline==0.1.6
mistune==3.0.1
msgpack==1.0.5
nbclient==0.8.0
nbconvert==7.8.0
nbformat==5.9.2
nest-asyncio==1.5.7
netCDF4==1.6.4
notebook==7.0.3
notebook_shim==0.2.3
numba==0.57.1
numpy==1.22.3
overrides==7.4.0
packaging==23.0
pandas==1.3.5
pandocfilters==1.5.0
panel==0.14.4
param==1.13.0
parso==0.8.3
partd==1.4.0
patsy==0.5.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.4.0
Pint==0.22
pip==23.2.1
platformdirs==3.10.0
pluggy==1.0.0
pooch==1.7.0
prometheus-client==0.17.1
prompt-toolkit==3.0.39
psutil==5.9.5
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==13.0.0
pycparser==2.21
pyct==0.5.0
Pygments==2.16.1
pyogrio==0.6.0
pyOpenSSL==23.2.0
pyparsing==3.1.1
pyproj==3.4.1
pyshp==2.3.1
PySocks==1.7.1
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3
pyviz_comms==3.0.0
PyYAML==6.0.1
pyzmq==25.1.1
qtconsole==5.4.3
QtPy==2.4.0
referencing==0.30.2
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
roocs-utils==0.6.4
rpds-py==0.10.0
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.6
scikit-learn==1.3.0
scipy==1.11.2
Send2Trash==1.8.2
setuptools==68.0.0
shapely==2.0.1
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.4.1
sparse==0.14.0
stack-data==0.6.2
statsmodels==0.14.0
tblib==2.0.0
terminado==0.17.1
threadpoolctl==3.2.0
tinycss2==1.2.1
tomli==2.0.1
toolz==0.12.0
tornado==6.3.3
tqdm==4.65.0
traitlets==5.9.0
typing_extensions==4.7.1
uri-template==1.3.0
urllib3==1.26.16
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.2
wheel==0.38.4
widgetsnbextension==4.0.8
xarray==2023.1.0
xclim==0.44.0
xesmf==0.7.1
zict==3.0.0
zipp==3.16.2
Loading

0 comments on commit 4becfc6

Please sign in to comment.