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
47 changes: 36 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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:
Expand All @@ -39,42 +39,67 @@ 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:
build-args: TARGETPLATFORM=${{ matrix.platform }}
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:
build-args: TARGETPLATFORM=${{ matrix.platform }}
file: ./docker/Dockerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
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 . -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
6 changes: 6 additions & 0 deletions 1-allatom_setup/1-AA_assembly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
"execution_count": null,
"id": "132110f0",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand All @@ -141,6 +144,9 @@
"execution_count": null,
"id": "17be9184",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down
9 changes: 9 additions & 0 deletions 2-allatom_sim/2-AA_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"execution_count": null,
"id": "e4676c05",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down Expand Up @@ -68,6 +71,9 @@
"execution_count": null,
"id": "8232c4a7",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down Expand Up @@ -120,6 +126,9 @@
"execution_count": null,
"id": "839435bb",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down
17 changes: 13 additions & 4 deletions 4-coarsegrain_equilibration/4-CG_equilibration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
"execution_count": 2,
"id": "b072482e",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand All @@ -104,11 +107,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
"Info) for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
"Info) http://www.ks.uiuc.edu/Research/vmd/ \n",
"Info) Email questions and bug reports to vmd@ks.uiuc.edu \n",
"Info) Please include this reference in published work using VMD: \n",
"Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual \n",
"Info) Humphrey, W., Dalke, A. and Schulten, K., `- Visual \n",
"Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.\n",
"Info) -------------------------------------------------------------\n",
"Info) Multithreading available, 24 CPUs detected.\n",
Expand Down Expand Up @@ -143,15 +146,15 @@
"Info) Fragments: 18062 Protein: 0 Nucleic: 0\n",
"after#0\n",
"Material23\n",
"Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
"Info) for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
"Info) Exiting normally.\n"
]
}
],
"source": [
"%%bash\n",
"\n",
"vmd output_initial_state.pdb"
"output_initial_state.pdb"
]
},
{
Expand Down Expand Up @@ -3470,6 +3473,9 @@
"execution_count": null,
"id": "a417bb34",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down Expand Up @@ -3821,6 +3827,9 @@
"execution_count": null,
"id": "5cd6e11a",
"metadata": {
"tags": [
"skip-execution"
],
"vscode": {
"languageId": "shellscript"
}
Expand Down
9 changes: 8 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ FROM ghcr.io/ccpbiosim/jupyterhub-base:$BASE_IMAGE

LABEL maintainer="James Gebbie-Rayet <james.gebbie@stfc.ac.uk>"

ARG TARGETPLATFORM

# Switch to jovyan user.
USER $NB_USER
WORKDIR $HOME

# Install workshop deps
RUN mamba install gromacs=2024.4=nompi_h5f56185_100 matplotlib=3.10.6 mdanalysis=2.9.0 numpy=2.3.3 scikit-learn=1.7.2 tqdm=4.67.1 mdtraj=1.11.0 iprogress ipywidgets salilab::dssp=3.0.0 -y
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
mamba install conda-forge/linux-64::gromacs=2024.5=nompi_h5f56185_100 -y; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
mamba install conda-forge/linux-aarch64::gromacs=2024.5=nompi_h9afd374_100 -y; \
fi
RUN mamba install matplotlib=3.10.6 mdanalysis=2.9.0 numpy=2.3.3 scikit-learn=1.7.2 tqdm=4.67.1 mdtraj=1.11.0 iprogress ipywidgets -y
RUN pip install alphashape==1.3.1 click==8.3.0 click-log==0.4.0 coby==1.0.9 pbr==7.0.1 rtree==1.4.1 shapely==2.1.2 trimesh==4.8.3 vermouth==0.15.0

# Get workshop files and move them to jovyan directory.
Expand Down