Skip to content
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
52 changes: 41 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ jobs:
matrix:
platform:
- linux/amd64
#- linux/arm64
# - linux/arm64
runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
name: build ${{ matrix.platform }}
outputs:
tag: ${{ steps.envvars.outputs.tag }}
steps:

- name: "node-cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a

- name: checkout
uses: actions/checkout@v5.0.0

Expand All @@ -39,19 +46,39 @@ jobs:
with:
images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.11.1

- name: Build and push by digest
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6.18.0
with:
file: ./docker/Dockerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
outputs: type=docker,push-by-digest=true,name-canonical=true,push=true

- name: Run tests
if: github.event_name == 'pull_request'
shell: bash
run: |
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest bash -c " \
pip install pytest nbmake; \
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "

- name: Authenticate with GHCR
if: github.event_name != 'pull_request'
id: auth
uses: docker/login-action@v3.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.BUILD_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.11.1

- name: Build and push by digest
if: github.event_name != 'pull_request'
id: build
uses: docker/build-push-action@v6.18.0
with:
Expand All @@ -61,20 +88,23 @@ jobs:
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=true

#- name: Test notebooks
# shell: bash
# run: |
# docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
# pip install pytest nbmake; \
# find ./notebooks -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
- name: Run tests
if: github.event_name != 'pull_request'
shell: bash
run: |
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
pip install pytest nbmake; \
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "

- name: Export digest
if: github.event_name != 'pull_request'
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"

- name: Upload digest
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v5.0.0
with:
name: digests-${{ env.PLATFORM_PAIR }}
Expand Down
4 changes: 2 additions & 2 deletions Setup_DNA-simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,9 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "htmd",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "htmd"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
6 changes: 2 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ RUN conda install -c acellera -c conda-forge ambertools htmd matplotlib mdtraj n

# Get workshop files and move them to jovyan directory.
COPY --chown=1000:100 . .
RUN rm -rf requirements.txt LICENSE README.md docker .git .github
RUN rm -rf requirements.txt LICENSE README.md docker .git .github tested_files

RUN wget https://www.hecbiosim.ac.uk/file-store/tw2025-dna-workshop/01_Prod-0.nc && \
wget https://www.hecbiosim.ac.uk/file-store/tw2025-dna-workshop/01_Prod-2.nc && \
cp 01_Prod-0.nc data/ && \
mv 01_Prod-0.nc 01_Prod-2.nc tested_files/
mv 01_Prod-0.nc data/

# Copy updated lab workspace
COPY --chown=1000:100 docker/default-37a8.jupyterlab-workspace /home/jovyan/.jupyter/lab/workspaces/default-37a8.jupyterlab-workspace
Expand Down