Skip to content

Commit 80621b7

Browse files
authored
Dockerfile Maintain RMG-Py 3.7 (#792)
Dockerfile updated to be multistage build in order to reduce size. Also, specified the checkout of RMG-Py in order to keep it at 3.7. Updated entrywrapper/aliases and the environment.yml
2 parents b38742a + 35d891b commit 80621b7

9 files changed

Lines changed: 403 additions & 306 deletions

File tree

.github/workflows/cont_int.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
schedule:
1212
- cron: '0 0 * * *'
1313

14+
env:
15+
RMG_PY_COMMIT: 55464c54d1fa61b531e865682df598d33718597d
1416

1517
jobs:
1618
build:
@@ -37,22 +39,28 @@ jobs:
3739
- name: Cache RMG-Py
3840
id: cache-rmg-py
3941
uses: actions/cache@v3
40-
env:
41-
CACHE_NUMBER: 2
4242
with:
4343
path: RMG-Py
44-
key: ${{ runner.os }}-rmg-main
44+
key: ${{ runner.os }}-rmg-${{ env.RMG_PY_COMMIT }}
4545
restore-keys: |
4646
${{ runner.os }}-rmg-
4747
48-
- name: Checkout RMG-py
48+
# - name: Checkout RMG-Py at specific commit
49+
# if: steps.cache-rmg-py.outputs.cache-hit != 'true'
50+
# uses: actions/checkout@v3
51+
# with:
52+
# repository: ReactionMechanismGenerator/RMG-Py
53+
# path: RMG-Py
54+
# ref: ${{ env.RMG_PY_COMMIT }}^1
55+
# fetch-depth: 0
56+
57+
- name: Clone & checkout RMG-Py at specific SHA
4958
if: steps.cache-rmg-py.outputs.cache-hit != 'true'
50-
uses: actions/checkout@v3
51-
with:
52-
repository: ReactionMechanismGenerator/RMG-Py
53-
path: RMG-Py
54-
ref: main
55-
fetch-depth: 1
59+
run: |
60+
git clone --filter=blob:none --no-checkout https://github.com/ReactionMechanismGenerator/RMG-Py.git RMG-Py
61+
cd RMG-Py
62+
git fetch --no-tags --prune origin ${RMG_PY_COMMIT}
63+
git checkout --detach ${RMG_PY_COMMIT}
5664
5765
- name: Cache RMG-database
5866
id: cache-rmg-db
@@ -64,14 +72,15 @@ jobs:
6472
key: ${{ runner.os }}-rmgdb-main
6573
restore-keys: |
6674
${{ runner.os }}-rmgdb-
75+
6776
- name: Checkout RMG-database
6877
if: steps.cache-rmg-db.outputs.cache-hit != 'true'
6978
uses: actions/checkout@v3
7079
with:
7180
repository: ReactionMechanismGenerator/RMG-database
7281
path: RMG-database
7382
ref: main
74-
fetch-depth: 1
83+
fetch-depth: 0
7584

7685
- name: Cache AutoTST
7786
id: cache-autotst
@@ -135,7 +144,7 @@ jobs:
135144
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
136145

137146
- name: Set up miniconda
138-
uses: conda-incubator/setup-miniconda@v3
147+
uses: conda-incubator/setup-miniconda@v3.2.0
139148
with:
140149
auto-update-conda: true
141150
environment-file: environment.yml

.github/workflows/update-cache.yml

Lines changed: 92 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,128 +2,136 @@ name: Update cache
22

33
on:
44
schedule:
5-
- cron: "0 0 */7 * *"
5+
- cron: '0 0 */7 * *'
66
push:
7-
branches:
8-
- main
7+
branches: [ main ]
98

109
jobs:
1110
update_cache:
1211
runs-on: ubuntu-latest
1312
defaults:
1413
run:
15-
shell: bash -el {0}
14+
shell: bash -el {0}
15+
1616
steps:
17+
# ────────── source repo ──────────
1718
- name: Checkout ARC
18-
uses: actions/checkout@v3
19-
19+
uses: actions/checkout@v4
20+
21+
# ────────── RMG‑Py ──────────
2022
- name: Cache RMG
2123
id: cache-rmg
22-
uses: actions/cache@v2
24+
uses: actions/cache@v4
2325
with:
24-
path: RMG-Py
25-
key: ${{ runner.os }}-rmg-main
26-
27-
- name: Checkout RMG
28-
uses: actions/checkout@v3
26+
path: RMG-Py
27+
key: ${{ runner.os }}-rmg-main
28+
restore-keys: |
29+
${{ runner.os }}-rmg-
30+
- name: Checkout RMG-Py
31+
if: steps.cache-rmg.outputs.cache-hit != 'true'
32+
uses: actions/checkout@v4
2933
with:
30-
repository: ReactionMechanismGenerator/RMG-Py
31-
path: RMG-Py
32-
ref: main
33-
fetch-depth: 1
34+
repository: ReactionMechanismGenerator/RMG-Py
35+
path: RMG-Py
36+
ref: 55464c54d1fa61b531e865682df598d33718597d
37+
fetch-depth: 1
3438

39+
# ────────── RMG‑database ──────────
3540
- name: Cache RMG-database
3641
id: cache-rmg-db
37-
uses: actions/cache@v2
42+
uses: actions/cache@v4
3843
with:
39-
path: RMG-database
40-
key: ${{ runner.os }}-rmgdb-main
41-
44+
path: RMG-database
45+
key: ${{ runner.os }}-rmgdb-main
46+
restore-keys: |
47+
${{ runner.os }}-rmgdb-
4248
- name: Checkout RMG-database
43-
uses: actions/checkout@v3
49+
if: steps.cache-rmg-db.outputs.cache-hit != 'true'
50+
uses: actions/checkout@v4
4451
with:
45-
repository: ReactionMechanismGenerator/RMG-database
46-
path: RMG-database
47-
ref: main
48-
fetch-depth: 1
49-
52+
repository: ReactionMechanismGenerator/RMG-database
53+
path: RMG-database
54+
ref: main
55+
fetch-depth: 1
56+
57+
# ────────── AutoTST ──────────
5058
- name: Cache AutoTST
5159
id: cache-autotst
52-
uses: actions/cache@v2
60+
uses: actions/cache@v4
5361
with:
54-
path: AutoTST
55-
key: ${{ runner.os }}-autotst-main
56-
restore-keys: |
57-
${{ runner.os }}-autotst-
62+
path: AutoTST
63+
key: ${{ runner.os }}-autotst-main
64+
restore-keys: |
65+
${{ runner.os }}-autotst-
5866
- name: Checkout AutoTST
5967
if: steps.cache-autotst.outputs.cache-hit != 'true'
60-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
6169
with:
62-
repository: ReactionMechanismGenerator/AutoTST
63-
path: AutoTST
64-
ref: main
65-
fetch-depth: 1
66-
70+
repository: ReactionMechanismGenerator/AutoTST
71+
path: AutoTST
72+
ref: main
73+
fetch-depth: 1
74+
75+
# ────────── TS‑GCN ──────────
6776
- name: Cache TS-GCN
6877
id: cache-tsgcn
69-
uses: actions/cache@v2
78+
uses: actions/cache@v4
7079
with:
71-
path: TS-GCN
72-
key: ${{ runner.os }}-tsgcn-main
73-
restore-keys: |
74-
${{ runner.os }}-tsgcn-
80+
path: TS-GCN
81+
key: ${{ runner.os }}-tsgcn-main
82+
restore-keys: |
83+
${{ runner.os }}-tsgcn-
7584
- name: Checkout TS-GCN
7685
if: steps.cache-tsgcn.outputs.cache-hit != 'true'
77-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
7887
with:
79-
repository: ReactionMechanismGenerator/TS-GCN
80-
path: TS-GCN
81-
ref: main
82-
fetch-depth: 1
83-
88+
repository: ReactionMechanismGenerator/TS-GCN
89+
path: TS-GCN
90+
ref: main
91+
fetch-depth: 1
92+
93+
# ────────── KinBot ──────────
8494
- name: Cache KinBot
8595
id: cache-kinbot
86-
uses: actions/cache@v2
96+
uses: actions/cache@v4
8797
with:
88-
path: KinBot
89-
key: ${{ runner.os }}-kinbot-2.0.6
90-
restore-keys: |
91-
${{ runner.os }}-kinbot-
92-
93-
- name: Checkout Kinbot 2.0.6
98+
path: KinBot
99+
key: ${{ runner.os }}-kinbot-2.0.6
100+
restore-keys: |
101+
${{ runner.os }}-kinbot-
102+
- name: Checkout KinBot 2.0.6
94103
if: steps.cache-kinbot.outputs.cache-hit != 'true'
95-
uses: actions/checkout@v3
104+
uses: actions/checkout@v4
96105
with:
97-
repository: zadorlab/KinBot
98-
path: KinBot
99-
ref: v2.0.6
100-
fetch-depth: 1
101-
102-
- name: Cache Packages Packages
103-
uses: actions/cache@v2
104-
env:
105-
CACHE_NUMBER: 0
106+
repository: zadorlab/KinBot
107+
path: KinBot
108+
ref: v2.0.6
109+
fetch-depth: 1
110+
111+
# ────────── Conda package cache ──────────
112+
- name: Cache Conda packages
113+
id: cache-conda-pkgs
114+
uses: actions/cache@v4
106115
with:
107-
path: ~/conda_pkgs_dir
108-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
116+
path: ~/conda_pkgs_dir
117+
key: ${{ runner.os }}-conda-0-${{ hashFiles('environment.yml') }}
118+
119+
# ────────── Create / restore env ──────────
109120
- name: Setup ARC Env
110-
uses: conda-incubator/setup-miniconda@v3
121+
uses: conda-incubator/setup-miniconda@v3.2.0
111122
with:
112-
auto-update-conda: true
113-
environment-file: environment.yml
114-
activate-environment: arc_env
115-
miniconda-version: latest
116-
conda-solver: libmamba
117-
123+
auto-update-conda: true
124+
environment-file: environment.yml
125+
activate-environment: arc_env
126+
miniconda-version: latest
127+
conda-solver: libmamba
128+
129+
# ────────── Update env & save to cache ──────────
130+
- name: Update environment
131+
run: mamba env update -n arc_env -f environment.yml
132+
118133
- name: Cache ARC env
119-
uses: actions/cache@v2
134+
uses: actions/cache@v4
120135
with:
121-
path: ${{ env.CONDA }}/envs
122-
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ env.CACHE_NUMBER}}
123-
env:
124-
# Increase this value to reset cache if etc/example-environment.yml has not changed
125-
CACHE_NUMBER: 0
126-
id: cache-arc-env
127-
- name: Update environment
128-
run: conda env update -n arc_env -f environment.yml
129-
if: steps.cache-arc-env.outputs.cache-hit != 'true'
136+
path: ${{ env.CONDA }}/envs
137+
key: conda-${{ runner.os }}-${{ runner.arch }}-0

0 commit comments

Comments
 (0)