Skip to content

Commit

Permalink
pin h5py version, avoid environment before/after build
Browse files Browse the repository at this point in the history
pin h5py, don't use environment_after.yml
  • Loading branch information
swelborn committed Apr 14, 2023
1 parent 1cc8150 commit b36cebc
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 41 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "master"
- "update-dockerfile-staging"
pull_request:
branches:
- "master"
Expand All @@ -23,6 +24,18 @@ jobs:
tag-suffix: -conda-jammy

steps:

-
name: Sets DOCKERHUB_ORG if pushing to fork
run: |
echo "DOCKERHUB_ORG=${{ vars.DOCKERHUB_ORG }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'pull_request' }}

-
name: Sets DOCKERHUB_ORG if PR
run: |
echo "DOCKERHUB_ORG=openchemistry" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}
-
name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -56,10 +69,11 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
build-args: |
DOCKERFILE_SUBDIR=${{ matrix.version }}${{ matrix.tag-suffix}}
tags: ${{ vars.DOCKERHUB_ORG }}/${{ matrix.version }}-base:latest${{ matrix.tag-suffix }}
tags: ${{ env.DOCKERHUB_ORG }}/${{ matrix.version }}-base:latest${{ matrix.tag-suffix }}
cache-to: type=gha
cache-from: type=gha,mode=max


# Builds stempy every time after build-base is done
build-stempy:
runs-on: ubuntu-latest
Expand All @@ -85,9 +99,21 @@ jobs:
with:
fetch-depth: 0
submodules: 'recursive'
-
name: Sets DOCKERHUB_ORG if pushing to fork
run: |
echo "DOCKERHUB_ORG=${{ vars.DOCKERHUB_ORG }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'pull_request' }}

-
name: Sets DOCKERHUB_ORG if PR
run: |
echo "DOCKERHUB_ORG=openchemistry" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}
-
name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -102,9 +128,9 @@ jobs:
file: ./docker/${{ matrix.version }}${{ matrix.tag-suffix}}/Dockerfile.stempy${{matrix.notebook}}
build-args: |
DOCKERFILE_SUBDIR=${{ matrix.version }}${{ matrix.tag-suffix}}
DOCKERHUB_ORG=${{ vars.DOCKERHUB_ORG }}
DOCKERHUB_ORG=${{ env.DOCKERHUB_ORG }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ vars.DOCKERHUB_ORG }}/${{ matrix.version }}${{matrix.notebook}}:latest${{ matrix.tag-suffix}}
tags: ${{ env.DOCKERHUB_ORG }}/${{ matrix.version }}${{matrix.notebook}}:latest${{ matrix.tag-suffix}}

# Seperate job for building original version
build-stempy-old:
Expand All @@ -123,9 +149,21 @@ jobs:
with:
fetch-depth: 0
submodules: 'recursive'
-
name: Sets DOCKERHUB_ORG if pushing to fork
run: |
echo "DOCKERHUB_ORG=${{ vars.DOCKERHUB_ORG }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'pull_request' }}

-
name: Sets DOCKERHUB_ORG if PR
run: |
echo "DOCKERHUB_ORG=openchemistry" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}
-
name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -140,7 +178,7 @@ jobs:
context: .
file: ./docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ vars.DOCKERHUB_ORG }}/${{ matrix.version }}:latest
tags: ${{ env.DOCKERHUB_ORG }}/${{ matrix.version }}:latest
build-args: |
MPI=${{ matrix.MPI }}
cache-to: type=gha
Expand All @@ -154,4 +192,4 @@ jobs:
context: .
file: ./docker/Dockerfile.ipykernel
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ vars.DOCKERHUB_ORG }}/${{ matrix.version }}-ipykernel:latest
tags: ${{ env.DOCKERHUB_ORG }}/${{ matrix.version }}-ipykernel:latest
3 changes: 1 addition & 2 deletions docker/stempy-conda-jammy/Dockerfile.stempy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /source
COPY . /source/stempy/
ARG CONDA_ENV_DIR=/source/stempy/docker/${DOCKERFILE_SUBDIR}/conda

RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml && \
RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment.yml && \
mkdir -p /build/stempy && \
cd /build/stempy && \
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
Expand All @@ -18,7 +18,6 @@ RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml
make -j 16 && \
cp -r -L /build/stempy/lib/stempy \
/opt/miniconda3/lib/python${PYTHON_VERSION}/site-packages && \
mamba env update -n base -f ${CONDA_ENV_DIR}/environment_after.yml && \
rm -rf /source/stempy && \
conda clean -a -y -q

Expand Down
3 changes: 1 addition & 2 deletions docker/stempy-conda-jammy/Dockerfile.stempy-ipykernel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /source
COPY . /source/stempy/
ARG CONDA_ENV_DIR=/source/stempy/docker/${DOCKERFILE_SUBDIR}/conda

RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml && \
RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_ipykernel.yml && \
mkdir -p /build/stempy && \
cd /build/stempy && \
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
Expand All @@ -18,7 +18,6 @@ RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml
make -j 16 && \
cp -r -L /build/stempy/lib/stempy \
/opt/miniconda3/lib/python${PYTHON_VERSION}/site-packages && \
mamba env update -n base -f ${CONDA_ENV_DIR}/environment_ipykernel.yml && \
rm -rf /source/stempy && \
conda clean -a -y -q

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ dependencies:
- click
- imageio
- ncempy
- h5py=3.6
- h5py=3.6
- pip:
- cmake
8 changes: 0 additions & 8 deletions docker/stempy-conda-jammy/conda/environment_before.yml

This file was deleted.

4 changes: 3 additions & 1 deletion docker/stempy-conda-jammy/conda/environment_ipykernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ dependencies:
- h5py=3.6
- ipykernel=6.4.2
- ipympl=0.8.6
- matplotlib=3.4.3
- matplotlib=3.4.3
- pip:
- cmake
7 changes: 2 additions & 5 deletions docker/stempy-mpi-conda-jammy/Dockerfile.stempy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /source
COPY . /source/stempy/
ARG CONDA_ENV_DIR=/source/stempy/docker/${DOCKERFILE_SUBDIR}/conda

RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml && \
RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment.yml && \
mkdir -p /build/stempy && \
cd /build/stempy && \
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
Expand All @@ -18,10 +18,7 @@ RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml
make -j 16 && \
cp -r -L /build/stempy/lib/stempy \
/opt/miniconda3/lib/python${PYTHON_VERSION}/site-packages && \
mamba env update -n base -f ${CONDA_ENV_DIR}/environment_after.yml && \
rm -rf /source/stempy && \
conda clean -a -y -q

RUN /sbin/ldconfig


RUN /sbin/ldconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies:
- ncempy
- h5py=2.10
- pip:
- cmake
- mpi4py==3.1.4
7 changes: 0 additions & 7 deletions docker/stempy-mpi-conda-jammy/conda/environment_before.yml

This file was deleted.

3 changes: 1 addition & 2 deletions docker/stempy-mpi-conda/Dockerfile.stempy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /source
COPY . /source/stempy/
ARG CONDA_ENV_DIR=/source/stempy/docker/${DOCKERFILE_SUBDIR}/conda

RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml && \
RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment.yml && \
mkdir -p /build/stempy && \
cd /build/stempy && \
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
Expand All @@ -18,7 +18,6 @@ RUN mamba env update -n base -f ${CONDA_ENV_DIR}/environment_before.yml
make -j 16 && \
cp -r -L /build/stempy/lib/stempy \
/opt/miniconda3/lib/python${PYTHON_VERSION}/site-packages && \
mamba env update -n base -f ${CONDA_ENV_DIR}/environment_after.yml && \
rm -rf /source/stempy && \
conda clean -a -y -q

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies:
- ncempy
- h5py=2.10
- pip:
- cmake
- mpi4py==3.1.4
8 changes: 0 additions & 8 deletions docker/stempy-mpi-conda/conda/environment_before.yml

This file was deleted.

0 comments on commit b36cebc

Please sign in to comment.