Skip to content

Commit 076b00e

Browse files
authored
Merge pull request #7 from CCPBioSim/ci-update
Update build.yaml
2 parents e68359e + bc38eec commit 076b00e

5 files changed

Lines changed: 72 additions & 16 deletions

File tree

.github/workflows/build.yaml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
platform:
1515
- linux/amd64
16-
#- linux/arm64
16+
- linux/arm64
1717
runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
1818
name: build ${{ matrix.platform }}
1919
outputs:
@@ -39,42 +39,67 @@ jobs:
3939
with:
4040
images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
4141

42+
- name: Set up Docker Buildx
43+
id: buildx
44+
uses: docker/setup-buildx-action@v3.11.1
45+
46+
- name: Build and push by digest
47+
if: github.event_name == 'pull_request'
48+
uses: docker/build-push-action@v6.18.0
49+
with:
50+
build-args: TARGETPLATFORM=${{ matrix.platform }}
51+
file: ./docker/Dockerfile
52+
platforms: ${{ matrix.platform }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
55+
outputs: type=docker,push-by-digest=true,name-canonical=true,push=true
56+
57+
- name: Run tests
58+
if: github.event_name == 'pull_request'
59+
shell: bash
60+
run: |
61+
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest bash -c " \
62+
pip install pytest nbmake; \
63+
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
64+
4265
- name: Authenticate with GHCR
66+
if: github.event_name != 'pull_request'
4367
id: auth
4468
uses: docker/login-action@v3.6.0
4569
with:
4670
registry: ghcr.io
4771
username: ${{ github.repository_owner }}
4872
password: ${{ secrets.BUILD_TOKEN }}
4973

50-
- name: Set up Docker Buildx
51-
id: buildx
52-
uses: docker/setup-buildx-action@v3.11.1
53-
5474
- name: Build and push by digest
75+
if: github.event_name != 'pull_request'
5576
id: build
5677
uses: docker/build-push-action@v6.18.0
5778
with:
79+
build-args: TARGETPLATFORM=${{ matrix.platform }}
5880
file: ./docker/Dockerfile
5981
platforms: ${{ matrix.platform }}
6082
labels: ${{ steps.meta.outputs.labels }}
6183
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
6284
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
6385

64-
#- name: Test notebooks
65-
# shell: bash
66-
# run: |
67-
# docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
68-
# pip install pytest nbmake; \
69-
# find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
86+
- name: Run tests
87+
if: github.event_name != 'pull_request'
88+
shell: bash
89+
run: |
90+
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
91+
pip install pytest nbmake; \
92+
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
7093
7194
- name: Export digest
95+
if: github.event_name != 'pull_request'
7296
run: |
7397
mkdir -p ${{ runner.temp }}/digests
7498
digest="${{ steps.build.outputs.digest }}"
7599
touch "${{ runner.temp }}/digests/${digest#sha256:}"
76100
77101
- name: Upload digest
102+
if: github.event_name != 'pull_request'
78103
uses: actions/upload-artifact@v5.0.0
79104
with:
80105
name: digests-${{ env.PLATFORM_PAIR }}

1-allatom_setup/1-AA_assembly.ipynb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@
121121
"execution_count": null,
122122
"id": "132110f0",
123123
"metadata": {
124+
"tags": [
125+
"skip-execution"
126+
],
124127
"vscode": {
125128
"languageId": "shellscript"
126129
}
@@ -141,6 +144,9 @@
141144
"execution_count": null,
142145
"id": "17be9184",
143146
"metadata": {
147+
"tags": [
148+
"skip-execution"
149+
],
144150
"vscode": {
145151
"languageId": "shellscript"
146152
}

2-allatom_sim/2-AA_simulation.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"execution_count": null,
2424
"id": "e4676c05",
2525
"metadata": {
26+
"tags": [
27+
"skip-execution"
28+
],
2629
"vscode": {
2730
"languageId": "shellscript"
2831
}
@@ -68,6 +71,9 @@
6871
"execution_count": null,
6972
"id": "8232c4a7",
7073
"metadata": {
74+
"tags": [
75+
"skip-execution"
76+
],
7177
"vscode": {
7278
"languageId": "shellscript"
7379
}
@@ -120,6 +126,9 @@
120126
"execution_count": null,
121127
"id": "839435bb",
122128
"metadata": {
129+
"tags": [
130+
"skip-execution"
131+
],
123132
"vscode": {
124133
"languageId": "shellscript"
125134
}

4-coarsegrain_equilibration/4-CG_equilibration.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
"execution_count": 2,
8989
"id": "b072482e",
9090
"metadata": {
91+
"tags": [
92+
"skip-execution"
93+
],
9194
"vscode": {
9295
"languageId": "shellscript"
9396
}
@@ -104,11 +107,11 @@
104107
"name": "stdout",
105108
"output_type": "stream",
106109
"text": [
107-
"Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
110+
"Info) for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
108111
"Info) http://www.ks.uiuc.edu/Research/vmd/ \n",
109112
"Info) Email questions and bug reports to vmd@ks.uiuc.edu \n",
110113
"Info) Please include this reference in published work using VMD: \n",
111-
"Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual \n",
114+
"Info) Humphrey, W., Dalke, A. and Schulten, K., `- Visual \n",
112115
"Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.\n",
113116
"Info) -------------------------------------------------------------\n",
114117
"Info) Multithreading available, 24 CPUs detected.\n",
@@ -143,15 +146,15 @@
143146
"Info) Fragments: 18062 Protein: 0 Nucleic: 0\n",
144147
"after#0\n",
145148
"Material23\n",
146-
"Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
149+
"Info) for LINUXAMD64, version 1.9.2 (December 29, 2014)\n",
147150
"Info) Exiting normally.\n"
148151
]
149152
}
150153
],
151154
"source": [
152155
"%%bash\n",
153156
"\n",
154-
"vmd output_initial_state.pdb"
157+
"output_initial_state.pdb"
155158
]
156159
},
157160
{
@@ -3470,6 +3473,9 @@
34703473
"execution_count": null,
34713474
"id": "a417bb34",
34723475
"metadata": {
3476+
"tags": [
3477+
"skip-execution"
3478+
],
34733479
"vscode": {
34743480
"languageId": "shellscript"
34753481
}
@@ -3821,6 +3827,9 @@
38213827
"execution_count": null,
38223828
"id": "5cd6e11a",
38233829
"metadata": {
3830+
"tags": [
3831+
"skip-execution"
3832+
],
38243833
"vscode": {
38253834
"languageId": "shellscript"
38263835
}

docker/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ FROM ghcr.io/ccpbiosim/jupyterhub-base:$BASE_IMAGE
44

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

7+
ARG TARGETPLATFORM
8+
79
# Switch to jovyan user.
810
USER $NB_USER
911
WORKDIR $HOME
1012

1113
# Install workshop deps
12-
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
14+
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
15+
mamba install conda-forge/linux-64::gromacs=2024.5=nompi_h5f56185_100 -y; \
16+
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
17+
mamba install conda-forge/linux-aarch64::gromacs=2024.5=nompi_h9afd374_100 -y; \
18+
fi
19+
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
1320
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
1421

1522
# Get workshop files and move them to jovyan directory.

0 commit comments

Comments
 (0)