Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base notebook/init #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 12 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-include .env

# Makefile for convenience, (doesn't look for command outputs)
.PHONY: all
all: base-image base-notebook pangeo-notebook ml-notebook pytorch-notebook
Expand All @@ -6,40 +8,32 @@ TESTDIR=/srv/test
.PHONY: base-image
base-image :
cd base-image ; \
docker build -t pangeo/base-image:master --progress=plain --platform linux/amd64,linux/arm64 .
docker build -t datalabs/base-image:master --progress=plain --platform linux/amd64 .

.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 -f environment.yml -p linux-64; \
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 . --progress=plain --platform linux/amd64,linux/arm64 ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) pangeo/base-notebook:master ./run_tests.sh base-notebook
docker build -t datalabs/base-notebook:master . --no-cache --progress=plain --platform linux/amd64; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) datalabs/base-notebook:master ./run_tests.sh base-notebook

.PHONY: pangeo-notebook
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.txt; \
docker build -t pangeo/pangeo-notebook:master . --progress=plain --platform linux/amd64,linux/arm64 ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) pangeo/pangeo-notebook:master ./run_tests.sh pangeo-notebook

.PHONY: ml-notebook
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; \
cp -r ../base-notebook/resources . ; \
conda-lock lock -f environment.yml -f ../base-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64; \
conda-lock render -k explicit -p linux-64; \
../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
docker build -t datalabs/pangeo-notebook:master . --progress=plain --platform linux/amd64; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) datalabs/pangeo-notebook:master ./run_tests.sh pangeo-notebook

.PHONY: pytorch-notebook
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; \
conda-lock render -k explicit -p linux-64; \
../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
docker build -t datalabs/pytorch-notebook:master . ; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) datalabs/pytorch-notebook:master ./run_tests.sh pytorch-notebook
14 changes: 12 additions & 2 deletions base-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ONBUILD RUN echo "Checking for 'jupyter_notebook_config.py'..." \
&& cp jupyter_notebook_config.py /etc/jupyter \
; fi

ONBUILD USER ${NB_USER}
# 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
Expand Down Expand Up @@ -184,6 +184,16 @@ ONBUILD RUN echo "Checking for pip 'requirements.txt'..." \
${NB_PYTHON_PREFIX}/bin/pip install --no-cache -r requirements.txt \
; fi

ONBUILD COPY resources/layer-cleanup.sh /usr/local/bin
ONBUILD RUN chmod +x /usr/local/bin/layer-cleanup.sh

ONBUILD RUN for script in $(find "resources" -type f -name "install.sh"); do \
chmod +x "$script"; \
echo "Executing $script"; \
bash "$script"; \
layer-cleanup.sh; \
done

# If a postBuild file exists, run it!
# After it's done, we try to remove any possible cruft commands there
# leave behind under $HOME - particularly stuff that jupyterlab extensions
Expand All @@ -210,4 +220,4 @@ ONBUILD RUN echo "Checking for 'start'..." \
chmod +x start \
&& cp start /srv/start \
; fi
# ----------------------
# ----------------------
2 changes: 1 addition & 1 deletion base-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# files (such as conda-linux-64.lock, start) in this repo.
# Refer to the base-image/Dockerfile for documentation.
ARG PANGEO_BASE_IMAGE_TAG=master
FROM pangeo/base-image:${PANGEO_BASE_IMAGE_TAG}
FROM datalabs/base-image:${PANGEO_BASE_IMAGE_TAG}
19 changes: 19 additions & 0 deletions base-notebook/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build-essential
curl
dfc
file
git
htop
jq
less
ncdu
ranger
rclone
rsync
silversearcher-ag
software-properties-common
tig
tmux
tree
unzip
vim
Loading
Loading