diff --git a/Dockerfile b/Dockerfile index 6e3fcdb8db..693efe1606 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,30 @@ -FROM us.gcr.io/vcm-ml/fv3gfs-compiled-default:latest +FROM jupyter/base-notebook -RUN apt-get update && apt-get install -y \ - python3 \ - python3-netcdf4 \ - cython3 +ENV ENVIRONMENT_SCRIPTS=$FV3NET/.environment-scripts +ENV PROJECT_NAME=fv3net +# Install dependencies (slow) +USER root +RUN apt-get update && apt-get install -y gfortran +ENV FV3NET=/home/$NB_USER/fv3net +ADD environment.yml $FV3NET/ +ADD Makefile $FV3NET/ +ADD .environment-scripts $ENVIRONMENT_SCRIPTS +RUN fix-permissions $FV3NET +WORKDIR $FV3NET -ADD docker/install_gcloud.sh install_gcloud.sh -RUN bash install_gcloud.sh +USER $NB_UID -ADD docker/download_inputdata.sh download_inputdata.sh -RUN bash download_inputdata.sh +ENV PATH=/opt/conda/envs/fv3net/bin:$PATH +RUN bash $ENVIRONMENT_SCRIPTS/build_environment.sh $PROJECT_NAME -ADD requirements.txt requirements.txt -RUN pip3 install -r requirements.txt +# Add rest of fv3net directory +USER root +ADD . $FV3NET +RUN fix-permissions $FV3NET +USER $NB_UID -COPY . /code -ENV PYTHONPATH=/code:$PYTHONPATH -WORKDIR /code +# setup the local python packages +RUN bash $ENVIRONMENT_SCRIPTS/install_local_packages.sh $PROJECT_NAME \ No newline at end of file diff --git a/Makefile b/Makefile index 4ac123d6da..756c1cd9a4 100644 --- a/Makefile +++ b/Makefile @@ -54,8 +54,15 @@ update_submodules: git submodule update --recursive --init +install_deps: + bash $(ENVIRONMENT_SCRIPTS)/build_environment.sh $(PROJECT_NAME) + +install_local_packages: + bash $(ENVIRONMENT_SCRIPTS)/install_local_packages.sh $(PROJECT_NAME) + create_environment: bash $(ENVIRONMENT_SCRIPTS)/build_environment.sh $(PROJECT_NAME) + bash $(ENVIRONMENT_SCRIPTS)/install_local_packages.sh $(PROJECT_NAME) overwrite_baseline_images: diff --git a/environment.yml b/environment.yml index 8e9bd0e475..717e6cc6ef 100644 --- a/environment.yml +++ b/environment.yml @@ -44,4 +44,5 @@ dependencies: - pip: - gsutil - nc-time-axis>=1.2.0 + - yq - bump2version>=0.5.11