diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3b79aa5..9bcd9ab 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,7 +36,7 @@ jobs: id: meta uses: docker/metadata-action@v5.8.0 with: - images: ghcr.io/${{ github.repository }} + images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} - name: Authenticate with GHCR id: auth @@ -54,9 +54,10 @@ jobs: id: build uses: docker/build-push-action@v6.18.0 with: + file: ./docker/Dockerfile platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - tags: ghcr.io/${{ github.repository }} + tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} outputs: type=image,push-by-digest=true,name-canonical=true,push=true - name: Export digest @@ -102,7 +103,7 @@ jobs: id: meta uses: docker/metadata-action@v5.8.0 with: - images: ghcr.io/${{ github.repository }} + images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} tags: dev - name: Create manifest list and push @@ -116,18 +117,18 @@ jobs: --annotation='index:org.opencontainers.image.created=${{ steps.timestamp.outputs.timestamp }}' \ --annotation='index:org.opencontainers.image.url=${{ github.event.repository.url }}' \ --annotation='index:org.opencontainers.image.source=${{ github.event.repository.url }}' \ - $(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *) + $(printf 'ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@sha256:%s ' *) - name: Create manifest list and push without annotations if: steps.annotate.outcome == 'failure' working-directory: ${{ runner.temp }}/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *) + $(printf 'ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@sha256:%s ' *) - name: Inspect image run: | - docker buildx imagetools inspect ghcr.io/${{ github.repository }}:dev + docker buildx imagetools inspect ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev tests: strategy: @@ -147,13 +148,9 @@ jobs: - name: Test notebooks shell: bash run: | - docker run -t ghcr.io/${{ github.repository }}:dev bash -c "\ - bash /home/jovyan/aiida-start; \ - jupyter nbconvert --to notebook --execute PTH2R_coarse-grained_tutorial.ipynb; \ - sleep 300; \ - verdi process list -a; \ - ! verdi process list -a | grep -E '\[(3.*?)\]'; \ - ! verdi process list -a | grep -E 'Waiting'; " + docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev bash -c " \ + pip install pytest nbmake; \ + find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; " tags: runs-on: ubuntu-24.04 @@ -175,14 +172,14 @@ jobs: shell: bash run: | docker buildx imagetools create \ - --tag ghcr.io/${{ github.repository }}:latest \ - --tag ghcr.io/${{ github.repository }}:${{ needs.build.outputs.tag }} \ - ghcr.io/${{ github.repository }}:dev + --tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest \ + --tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:${{ needs.build.outputs.tag }} \ + ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev - name: Post version update to dash uses: peter-evans/repository-dispatch@v3.0.0 with: token: ${{ secrets.BUILD_TOKEN }} repository: jimboid/biosim-workshops-dash - event-type: build + event-type: build client-payload: '{"repo": "${{ github.event.repository.name }}", "tag": "${{ needs.build.outputs.tag }}"}' diff --git a/Dockerfile b/docker/Dockerfile similarity index 82% rename from Dockerfile rename to docker/Dockerfile index adfee90..8a28306 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,9 @@ # Start with BioSim base image. ARG BASE_IMAGE=latest -FROM ghcr.io/jimboid/biosim-jupyterhub-base:$BASE_IMAGE +FROM ghcr.io/ccpbiosim/jupyterhub-base:$BASE_IMAGE LABEL maintainer="James Gebbie-Rayet " -LABEL org.opencontainers.image.source=https://github.com/jimboid/biosim-aiida-gpcr-workshop +LABEL org.opencontainers.image.source=https://github.com/ccpbiosim/aiida-gpcr-workshop LABEL org.opencontainers.image.description="A container environment for the PSDI workshop on AiiDA tools for data collection." LABEL org.opencontainers.image.licenses=MIT @@ -39,19 +39,18 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ fi RUN pip3 install aiida-gromacs mdtraj vermouth -RUN git clone https://github.com/jimboid/aiida-gromacs.git && \ +RUN git clone https://github.com/PSDI-UK/aiida-gromacs.git && \ mv aiida-gromacs/examples/PTH2R_coarse-grained_files . && \ mv aiida-gromacs/notebooks/PTH2R_coarse-grained_tutorial.ipynb . && \ rm -rf aiida-gromacs -COPY --chown=1000:100 aiida-stop /home/jovyan/ - RUN echo "./aiida-start" >> ~/.bashrc -COPY --chown=1000:100 default-37a8.jupyterlab-workspace /home/jovyan/.jupyter/lab/workspaces/default-37a8.jupyterlab-workspace +COPY --chown=1000:100 docker/default-37a8.jupyterlab-workspace /home/jovyan/.jupyter/lab/workspaces/default-37a8.jupyterlab-workspace COPY --chown=1000:100 aiida-start /home/jovyan/ +COPY --chown=1000:100 aiida-stop /home/jovyan/ # UNCOMMENT THIS LINE FOR REMOTE DEPLOYMENT -COPY jupyter_notebook_config.py /etc/jupyter/ +COPY docker/jupyter_notebook_config.py /etc/jupyter/ # Always finish with non-root user as a precaution. USER $NB_USER diff --git a/default-37a8.jupyterlab-workspace b/docker/default-37a8.jupyterlab-workspace similarity index 100% rename from default-37a8.jupyterlab-workspace rename to docker/default-37a8.jupyterlab-workspace diff --git a/jupyter_notebook_config.py b/docker/jupyter_notebook_config.py similarity index 100% rename from jupyter_notebook_config.py rename to docker/jupyter_notebook_config.py