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

Update conda and add py311 environment #34

Merged
merged 2 commits into from
Feb 3, 2023
Merged
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
92 changes: 56 additions & 36 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,44 @@ jobs:
matrix:
include:
- distro: alpine
conda_ver: 4.12.0
conda_ver: '22.11.1'
py_ver: '3.11'
platform: linux/amd64
- distro: alpine
conda_ver: '22.11.1'
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
conda_ver: 4.10.3
py_ver: 3.9
conda_ver: '22.11.1'
py_ver: '3.9'
platform: linux/amd64
- distro: alpine
conda_ver: 4.10.3
py_ver: 3.8
conda_ver: '22.11.1'
py_ver: '3.8'
platform: linux/amd64
- distro: alpine
conda_ver: 4.10.3
py_ver: 3.7
conda_ver: '22.11.1'
py_ver: '3.7'
platform: linux/amd64
- distro: debian
conda_ver: '22.11.1'
py_ver: '3.11'
platform: linux/amd64
- distro: debian
conda_ver: 4.12.0
conda_ver: '22.11.1'
py_ver: '3.10'
platform: linux/amd64
- distro: debian
conda_ver: 4.10.3
py_ver: 3.9
conda_ver: '22.11.1'
py_ver: '3.9'
platform: linux/amd64
- distro: debian
conda_ver: 4.10.3
py_ver: 3.8
conda_ver: '22.11.1'
py_ver: '3.8'
platform: linux/amd64
- distro: debian
conda_ver: 4.10.3
py_ver: 3.7
conda_ver: '22.11.1'
py_ver: '3.7'
platform: linux/amd64
# - distro: debian
# conda_ver: 4.10.3
Expand All @@ -59,9 +67,9 @@ jobs:
PLATFORM: ${{matrix.platform}}
DOCKER_CLIENT_TIMEOUT: "120"
COMPOSE_HTTP_TIMEOUT: "120"
BASE_IMAGE_HASH: "fe9fb41"
BASE_IMAGE_HASH: "270a9fc"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
Expand All @@ -77,7 +85,7 @@ jobs:
awk '{print $2}')")
docker save "${REF}" | gzip > "py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
- name: Add image artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{format('py{0}-{1}-{2}', matrix.py_ver, matrix.distro, env.PLATFORM_TAG)}}
path: >
Expand All @@ -90,29 +98,35 @@ jobs:
strategy:
matrix:
include:
- distro: alpine
py_ver: '3.11'
platform: linux/amd64
- distro: alpine
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
py_ver: 3.9
py_ver: '3.9'
platform: linux/amd64
- distro: alpine
py_ver: 3.8
py_ver: '3.8'
platform: linux/amd64
- distro: alpine
py_ver: 3.7
py_ver: '3.7'
platform: linux/amd64
- distro: debian
py_ver: '3.11'
platform: linux/amd64
- distro: debian
py_ver: '3.10'
platform: linux/amd64
- distro: debian
py_ver: 3.9
py_ver: '3.9'
platform: linux/amd64
- distro: debian
py_ver: 3.8
py_ver: '3.8'
platform: linux/amd64
- distro: debian
py_ver: 3.7
py_ver: '3.7'
platform: linux/amd64
# - distro: debian
# py_ver: 3.9
Expand All @@ -128,13 +142,13 @@ jobs:
PY_VER: ${{matrix.py_ver}}
PLATFORM: ${{matrix.platform}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{format('py{0}-{1}-{2}', matrix.py_ver, matrix.distro, env.PLATFORM_TAG)}}
- uses: dbhi/qus/action@main
Expand All @@ -157,29 +171,35 @@ jobs:
strategy:
matrix:
include:
- distro: alpine
py_ver: '3.11'
platform: linux/amd64
- distro: alpine
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
py_ver: 3.9
py_ver: '3.9'
platform: linux/amd64
- distro: alpine
py_ver: 3.8
py_ver: '3.8'
platform: linux/amd64
- distro: alpine
py_ver: 3.7
py_ver: '3.7'
platform: linux/amd64
- distro: debian
py_ver: '3.11'
platform: linux/amd64
- distro: debian
py_ver: '3.10'
platform: linux/amd64
- distro: debian
py_ver: 3.9
py_ver: '3.9'
platform: linux/amd64
- distro: debian
py_ver: 3.8
py_ver: '3.8'
platform: linux/amd64
- distro: debian
py_ver: 3.7
py_ver: '3.7'
platform: linux/amd64
# - distro: debian
# py_ver: 3.9
Expand All @@ -197,13 +217,13 @@ jobs:
DOCKER_USERNAME: ${{secrets.docker_username}}
DOCKER_PASSWORD: ${{secrets.docker_password}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{format('py{0}-{1}-{2}', matrix.py_ver, matrix.distro, env.PLATFORM_TAG)}}
- name: Publish image
Expand All @@ -217,7 +237,7 @@ jobs:
docker push "${IMAGE}:${TAG}"
docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
[ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \
[ "$PY_VER" == "3.11" ] && [ "$DISTRO" == "debian" ] \
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
&& docker push "${IMAGE}:latest" \
|| echo "skipping 'latest' tag..."
Expand All @@ -231,13 +251,13 @@ jobs:
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
# - name: Upload docs artifact
# uses: actions/upload-artifact@v1
# uses: actions/upload-artifact@v3
# with:
# name: docs-html
# path: docs/_build/html/
Expand Down
17 changes: 10 additions & 7 deletions config/.env
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
## build

# PY_VER='3.10'
# CONDA_VER=4.12.0
# PY_VER='3.11'
# CONDA_VER=22.11.1

PY_VER=3.9
CONDA_VER=4.10.3
PY_VER='3.10'
CONDA_VER=22.11.1

# PY_VER=3.9
# CONDA_VER=22.11.1

# PY_VER=3.8
# CONDA_VER=4.10.3
# CONDA_VER=22.11.1

# PY_VER=3.7
# CONDA_VER=4.10.3
# CONDA_VER=22.11.1

BASE_IMAGE_HASH=fe9fb41
BASE_IMAGE_HASH=270a9fc



Expand Down
9 changes: 0 additions & 9 deletions dist/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ RUN \
sed 's|\s|\n|g' > $APK_REQUIREMENTS && \
/entrypoint.sh echo done && \
export PY_VER=$(python --version 2>&1 | grep -o "\d.\d") && \
if echo "$PY_VER" | grep -o "3\.9\|3\.8"; then \
pip install --platform=manylinux1_x86_64 --only-binary=:all: \
--target=/opt/conda/lib/python${PY_VER}/site-packages \
--no-cache-dir matplotlib; \
elif echo "$PY_VER" | grep -o "3\.6"; then \
pip install --only-binary=:all: \
--target=/opt/conda/lib/python${PY_VER}/site-packages \
--no-cache-dir pillow; \
fi && \
pip install --no-cache-dir datajoint && \
pip uninstall datajoint -y && \
rm $APK_REQUIREMENTS
Expand Down
9 changes: 0 additions & 9 deletions dist/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ RUN \
echo 'graphviz' > $APT_REQUIREMENTS && \
/entrypoint.sh echo done && \
export PY_VER=$(python --version 2>&1 | grep -oP "\d.\d") && \
if echo "$PY_VER" | grep -oP "3\.9\|3\.8"; then \
pip install --platform=manylinux1_x86_64 --only-binary=:all: \
--target=/opt/conda/lib/python${PY_VER}/site-packages \
--no-cache-dir matplotlib; \
elif echo "$PY_VER" | grep -oP "3\.6"; then \
pip install --only-binary=:all: \
--target=/opt/conda/lib/python${PY_VER}/site-packages \
--no-cache-dir pillow; \
fi && \
pip install datajoint --no-cache-dir && \
pip uninstall datajoint -y && \
# decorator package had a conflict so installing again to force resolve
Expand Down
24 changes: 14 additions & 10 deletions tests/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,28 @@ IMAGE=$(echo $REF | awk -F':' '{print $1}')
SHELL_CMD_TEMPLATE="docker run --rm -i \$SHELL_CMD_FLAGS $REF \
$(docker inspect "$REF" --format '{{join .Config.Cmd " "}}') -c"
# determine reference size
if [ $DISTRO == alpine ] && [ $PY_VER == '3.10' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=741
if [ $DISTRO == alpine ] && [ $PY_VER == '3.11' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=774
elif [ $DISTRO == alpine ] && [ $PY_VER == '3.10' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=543
elif [ $DISTRO == alpine ] && [ $PY_VER == '3.9' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=484
SIZE_LIMIT=533
elif [ $DISTRO == alpine ] && [ $PY_VER == '3.8' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=442 # 599
SIZE_LIMIT=516
elif [ $DISTRO == alpine ] && [ $PY_VER == '3.7' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=452 # 629
SIZE_LIMIT=481
elif [ $DISTRO == debian ] && [ $PY_VER == '3.11' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=897
elif [ $DISTRO == debian ] && [ $PY_VER == '3.10' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=879
SIZE_LIMIT=666
elif [ $DISTRO == debian ] && [ $PY_VER == '3.9' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=640
SIZE_LIMIT=655
elif [ $DISTRO == debian ] && [ $PY_VER == '3.8' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=599 # 833
SIZE_LIMIT=638
elif [ $DISTRO == debian ] && [ $PY_VER == '3.7' ] && [ $PLATFORM == 'linux/amd64' ]; then
SIZE_LIMIT=597 # 863
SIZE_LIMIT=603
fi
SIZE_LIMIT=$(echo "scale=4; $SIZE_LIMIT * 1.06" | bc)
SIZE_LIMIT=$(echo "scale=4; $SIZE_LIMIT * 1.05" | bc)
# verify size minimal
SIZE=$(docker images --filter "reference=$REF" --format "{{.Size}}" | awk -F'MB' '{print $1}')
assert "minimal footprint" "(( $(echo "$SIZE <= $SIZE_LIMIT" | bc -l) ))" $LINENO
Expand Down