Skip to content

Commit

Permalink
Pangeo notebook/init (#5)
Browse files Browse the repository at this point in the history
* feat: add qgis to pangeo-notebook
* fix: Docker organization name
  • Loading branch information
eroan-marie authored Dec 3, 2024
1 parent 3b990df commit b74fee2
Show file tree
Hide file tree
Showing 30 changed files with 5,700 additions and 2,590 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '*'

env:
DOCKER_ORG: pangeo
DOCKER_ORG: cnes
GITHUB_REF: ${{ github.ref }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
context: base-image
platforms: linux/amd64,linux/arm64
tags: localhost:5000/pangeo/base-image:PR
tags: localhost:5000/cnes/base-image:PR
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ base-image :
.PHONY: base-notebook
base-notebook : base-image
cd base-notebook ; \
conda-lock lock -f environment.yml -p linux-64; \
conda-lock lock --mamba -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 cnes/base-notebook:master . --no-cache --progress=plain --platform linux/amd64; \
Expand All @@ -23,16 +23,17 @@ base-notebook : base-image
pangeo-notebook : base-image
cd pangeo-notebook ; \
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 lock --mamba -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; \
../merge-apt.sh ../base-notebook/apt.txt apt.txt; \
docker build -t cnes/pangeo-notebook:master . --progress=plain --platform linux/amd64; \
docker run -w $(TESTDIR) -v $(PWD):$(TESTDIR) cnes/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 lock --mamba -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 cnes/pytorch-notebook:master . ; \
Expand Down
2 changes: 1 addition & 1 deletion 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
19 changes: 19 additions & 0 deletions merge-apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Check if at least two files are provided
if [ "$#" -lt 2 ]; then
echo "Usage: $0 file1_apt.txt file2_apt.txt ... target_apt.txt"
exit 1
fi

# Get last file as target file
target_file="${@: -1}"

# Merge all files while removing duplicates
# - Ignore empty lines and comments
awk 1 "$@" | grep -v '^#' | grep -v '^$' | sort | uniq > merged_apt.txt

# Move merged file into target file
mv merged_apt.txt "$target_file"

echo "Merge done."
16 changes: 16 additions & 0 deletions pangeo-notebook/apt.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
build-essential
curl
dfc
file
git
groff
htop
jq
less
ncdu
ranger
rclone
rsync
silversearcher-ag
software-properties-common
tig
tmux
tree
unzip
vim
741 changes: 373 additions & 368 deletions pangeo-notebook/conda-linux-64.lock

Large diffs are not rendered by default.

Loading

0 comments on commit b74fee2

Please sign in to comment.