Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pytest-split to parallelize across 3 runners and speedup CI #985

Merged
merged 127 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
f05bce8
add ase base calculator classes from forcefield library
esoteric-ephemera Aug 2, 2024
5e538e3
add tests for ase calculators, refactor forcefields slightly
esoteric-ephemera Aug 2, 2024
d861b94
precommit
esoteric-ephemera Aug 2, 2024
786ce93
precommit
esoteric-ephemera Aug 2, 2024
4cd538f
add tests
esoteric-ephemera Aug 2, 2024
e25f61e
precommit
esoteric-ephemera Aug 2, 2024
e2eb2c1
fix forcefield post_init
esoteric-ephemera Aug 2, 2024
756c3fe
precmt
esoteric-ephemera Aug 2, 2024
e32636c
forcefield_objects -> objects rename
esoteric-ephemera Aug 2, 2024
5acc792
pin torchdata version to fix issues with matgl
esoteric-ephemera Aug 5, 2024
924e910
restore forcefield specific schema objects for backwards compatibilit…
esoteric-ephemera Aug 5, 2024
e83deaf
precommit
esoteric-ephemera Aug 5, 2024
b0f7c7c
mypy precommit for ancient python
esoteric-ephemera Aug 5, 2024
77a5833
add static makers
esoteric-ephemera Aug 7, 2024
e6f83a9
precommit
esoteric-ephemera Aug 7, 2024
e951a05
add tblite dependence to ase in toml
esoteric-ephemera Aug 7, 2024
1c1142d
fix merge conflicts
esoteric-ephemera Aug 7, 2024
b1952c9
migrate forcefield MD base class to ase
esoteric-ephemera Aug 7, 2024
4b1915b
add barebones tests for ase md jobs
esoteric-ephemera Aug 7, 2024
b0c9a77
ensure tests clean after completion
esoteric-ephemera Aug 7, 2024
9b13e45
precommit
esoteric-ephemera Aug 7, 2024
c57d9ff
Merge branch 'main' into ase
esoteric-ephemera Aug 7, 2024
89eb1c7
try to figure out why tblite is not working in ci, but is locally
esoteric-ephemera Aug 8, 2024
8d9a7ee
generalize to allow molecules in ase calcs
esoteric-ephemera Aug 9, 2024
d5b3a87
precommit
esoteric-ephemera Aug 9, 2024
ea6f1ea
fix molecule schemas / tests
esoteric-ephemera Aug 10, 2024
625d971
precommit
esoteric-ephemera Aug 10, 2024
9b341d2
Merge branch 'main' into ase
esoteric-ephemera Aug 12, 2024
38449da
make tblite dependence optional
esoteric-ephemera Aug 12, 2024
610ac72
precommit
esoteric-ephemera Aug 12, 2024
6adae2f
try to quarantine forcefield tests
esoteric-ephemera Aug 14, 2024
a90170f
ensure tblite installed for tests
esoteric-ephemera Aug 14, 2024
834ce73
pyrrhic quest to separate torch and non-torch tests, pt. 2 / ???
esoteric-ephemera Aug 14, 2024
af0f978
pyrrhic quest to separate torch and non-torch tests, pt. 3 / ???
esoteric-ephemera Aug 14, 2024
be6829e
remove cov file
esoteric-ephemera Aug 14, 2024
82d7dca
remove torch dependence from non-forcefield tests?
esoteric-ephemera Aug 14, 2024
526b5ad
move misplaced forcefield phonon test to forcefield tests
esoteric-ephemera Aug 14, 2024
d07ca25
move forcefield strict version pins to separate toml block
esoteric-ephemera Aug 14, 2024
b243b73
name refactor / enumification / lazy load md dynamics modules
esoteric-ephemera Aug 19, 2024
3efff87
precommit
esoteric-ephemera Aug 19, 2024
c5f7fe8
Merge branch 'main' into ase
esoteric-ephemera Aug 19, 2024
4a12353
make Ase{Structure,Molecule}TaskDoc construction a single function
esoteric-ephemera Aug 19, 2024
7cf617a
Merge branch 'main' into ase
esoteric-ephemera Aug 20, 2024
73c4269
precommit
esoteric-ephemera Aug 20, 2024
82ab00e
change ASE and forcefield result from dict to BaseModel
esoteric-ephemera Aug 20, 2024
e4f1803
pcmt
esoteric-ephemera Aug 20, 2024
86fe898
ensure ASE and forcefield result docs are subscriptable
esoteric-ephemera Aug 20, 2024
b652a3c
allow dict-style item assignment in AseResult
esoteric-ephemera Aug 20, 2024
e7edeea
Add "ionic_steps" to DATA_OBJECTS
orionarcher Aug 20, 2024
df4eca8
Add 'elapsed_time' and 'tags' to ASE schemas
orionarcher Aug 20, 2024
348678e
Adding timing to ASE runs.
orionarcher Aug 20, 2024
0d181e1
Pass elapsed time through doc
orionarcher Aug 21, 2024
c6d6ffc
Small lint
orionarcher Aug 21, 2024
eb51282
Pass tags through to task document. Add test.
orionarcher Aug 21, 2024
321a975
Merge pull request #4 from orionarcher/ase_fixes
esoteric-ephemera Aug 21, 2024
0d5c46a
Add dict to ionic_steps typing
orionarcher Aug 22, 2024
93dd9cc
define basic ase job schema; remove task_doc_kwargs from ase in favor…
esoteric-ephemera Aug 22, 2024
9585dc9
Change | to Union in type hints
orionarcher Aug 22, 2024
8d85829
pcmt
esoteric-ephemera Aug 22, 2024
bcd23f4
Merge branch 'ase' into ase_fixes_2
esoteric-ephemera Aug 22, 2024
73caa68
Merge pull request #5 from orionarcher/ase_fixes_2
esoteric-ephemera Aug 23, 2024
dcaeb85
revise ionic_step storage / only for md
esoteric-ephemera Aug 23, 2024
ff44149
Merge branch 'main' into ase
esoteric-ephemera Aug 27, 2024
902823d
Return NotImplemented -> Raise NotImplementedError
orionarcher Aug 28, 2024
e0bf592
Partially prevent ase_calculator from failing silently.
orionarcher Aug 28, 2024
0aa8a08
Rollback ability to accept raw forcefield stubs
orionarcher Sep 3, 2024
7b25b10
Merge branch 'main' into ase
esoteric-ephemera Sep 3, 2024
8f305e9
skip default forcefield mlff in phonon setup test
esoteric-ephemera Sep 3, 2024
808de7d
Merge pull request #6 from orionarcher/ase_fixes_3
esoteric-ephemera Sep 3, 2024
ec3a3c5
Merge branch 'main' into ase
esoteric-ephemera Sep 9, 2024
4508b9f
add option to pass forcefield name as str without MLFF. prefix or as …
esoteric-ephemera Sep 9, 2024
0b4987e
precommit
esoteric-ephemera Sep 9, 2024
da01791
correct typing of atoms in AseRelaxer
esoteric-ephemera Sep 9, 2024
063c1c9
add tblite to optional ase-ext and strict requirements; remove CI fai…
esoteric-ephemera Sep 9, 2024
ffacf71
add tblite to optional ase-ext and strict requirements; remove CI fai…
esoteric-ephemera Sep 9, 2024
763bcc6
Merge branch 'main' into ase
esoteric-ephemera Sep 9, 2024
aada903
ensure forcefield tests don't use deprecated makers, test for futurew…
esoteric-ephemera Sep 10, 2024
be168e4
precommit
esoteric-ephemera Sep 10, 2024
027defd
remove dependence on deprecated ff makers; make default calc kwargs a…
esoteric-ephemera Sep 10, 2024
7aa7675
precommit
esoteric-ephemera Sep 10, 2024
ed544be
remove frechet cell filter safety checks (this is included by the min…
esoteric-ephemera Sep 11, 2024
c1db9e6
made MD ensembles and enum
esoteric-ephemera Sep 11, 2024
bb0d2e8
pcmt
esoteric-ephemera Sep 11, 2024
9b077b1
move ase tests to separate test run, use pytest-split on rest of test…
esoteric-ephemera Sep 12, 2024
1e21c6b
forgot pytest-split dep in pyproject
esoteric-ephemera Sep 12, 2024
362db23
add test durations for split
esoteric-ephemera Sep 12, 2024
a638f42
reorg test wf
esoteric-ephemera Sep 12, 2024
f110574
reorg test wf
esoteric-ephemera Sep 12, 2024
4ba239b
update test split, run notebook test as separate test, update test time
esoteric-ephemera Sep 12, 2024
4c581bc
file cleanup
esoteric-ephemera Sep 12, 2024
3e68d3d
move jupyter notebook test into ase
esoteric-ephemera Sep 12, 2024
00aaf8d
move jupyter notebook test into ase
esoteric-ephemera Sep 12, 2024
4c3c13c
tweak some clean_dir to tmp_dir to prevent unncessary test file creation
esoteric-ephemera Sep 13, 2024
00ea296
reduce to 4 splits
esoteric-ephemera Sep 13, 2024
4b0d680
go back to 3 splits
esoteric-ephemera Sep 13, 2024
cde15a0
Merge branch 'main' into ase
esoteric-ephemera Sep 16, 2024
daf460f
try to get better ci timing estimate per @janosh's suggestion
esoteric-ephemera Sep 16, 2024
a40accb
try to get better ci timing estimate per @janosh's suggestion
esoteric-ephemera Sep 16, 2024
e576828
Merge branch 'main' into ase
esoteric-ephemera Sep 16, 2024
1c41666
fix test split cmd
esoteric-ephemera Sep 16, 2024
7e5abd6
revert pytest split change for separate pr
esoteric-ephemera Sep 16, 2024
1b64286
revert pytest split change for separate pr
esoteric-ephemera Sep 16, 2024
af1523e
sync with ase branch and add test split logic / times
esoteric-ephemera Sep 16, 2024
5fe8c1f
tweak wf
esoteric-ephemera Sep 16, 2024
30fe3f9
change pytest split algo
esoteric-ephemera Sep 16, 2024
1bab939
change pytest split algo, see if 5 splits works better for balancing
esoteric-ephemera Sep 16, 2024
10b0407
Merge remote-tracking branch 'upstream/ase' into splits
esoteric-ephemera Sep 16, 2024
bf6ef8a
change pytest split algo, see if 5 splits works better for balancing
esoteric-ephemera Sep 16, 2024
b317b4d
change to 3 splits
esoteric-ephemera Sep 17, 2024
3ea5f3e
change gruneisen test for time use - just make phonon maker cheaper
esoteric-ephemera Sep 17, 2024
e029eec
Merge remote-tracking branch 'upstream/ase' into splits
esoteric-ephemera Sep 20, 2024
44bc54c
add ase to phonon supported codes, enforce string literal in BasePhon…
esoteric-ephemera Sep 20, 2024
3f2915b
update timing for gruneisen
esoteric-ephemera Sep 20, 2024
32a3a44
Merge remote-tracking branch 'upstream/ase' into splits
esoteric-ephemera Sep 20, 2024
0b74403
Merge branch 'main' into ase
esoteric-ephemera Sep 23, 2024
7154149
Merge remote-tracking branch 'upstream/ase' into splits
esoteric-ephemera Sep 23, 2024
b72c91c
Merge branch 'main' into ase
esoteric-ephemera Sep 24, 2024
7002929
Merge remote-tracking branch 'upstream/ase' into splits
esoteric-ephemera Sep 24, 2024
4d1eeae
try to fix ci test wf
esoteric-ephemera Sep 24, 2024
9ca6d18
try to fix ci test wf
esoteric-ephemera Sep 24, 2024
481a9c9
ci test wf
esoteric-ephemera Sep 24, 2024
8626833
merge upstream
esoteric-ephemera Sep 24, 2024
53b43bb
Merge branch 'main' into splits
esoteric-ephemera Sep 25, 2024
72ca75b
merge conflict fixes, try reorg tests
esoteric-ephemera Sep 25, 2024
d341624
pcmt, other tweaks
esoteric-ephemera Sep 25, 2024
6b0642a
remove lingering ase frechet filter remarks
esoteric-ephemera Sep 25, 2024
19dedbb
Merge branch 'main' into splits
janosh Sep 27, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# ase needed to get FrechetCellFilter used by ML force fields
pip install git+https://gitlab.com/ase/ase
pip install .[strict,docs]

- name: Build
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# ase needed to get FrechetCellFilter used by ML force fields
pip install git+https://gitlab.com/ase/ase
pip install .[strict,docs]

- name: Build
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ jobs:

- uses: pre-commit/[email protected]

test:
test-non-ase:
# prevent this action from running on forks
if: github.repository == 'materialsproject/atomate2'

services:
local_mongodb:
image: mongo:4.0
Expand All @@ -37,6 +40,7 @@ jobs:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
split: [1, 2, 3]

steps:
- name: Check out repo
Expand Down Expand Up @@ -72,20 +76,30 @@ jobs:
micromamba activate a2
uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'

- name: Test
- name: Test split ${{ matrix.split }}
env:
MP_API_KEY: ${{ secrets.MP_API_KEY }}

# regenerate durations file with `pytest --store-durations --durations-path tests/.pytest-split-durations`
# Note the use of `--splitting-algorithm least_duration`.
# This helps prevent a test split having no tests to run, and then the GH action failing, see:
# https://github.com/jerry-git/pytest-split/issues/95
# However this `splitting-algorithm` means that tests cannot depend sensitively on the order they're executed in.
run: |
micromamba activate a2
pytest --ignore=tests/ase --cov=atomate2 --cov-report=xml
pytest --splits 3 --group ${{ matrix.split }} --durations-path tests/.pytest-split-durations --splitting-algorithm least_duration --ignore=tests/ase --cov=atomate2 --cov-report=xml

- uses: codecov/codecov-action@v1
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: coverage${{ matrix.split }}
file: ./coverage.xml

test-notebooks-and-ase:
# prevent this action from running on forks
if: github.repository == 'materialsproject/atomate2'

# It seems like anything torch-dependent and tblite can't be installed in the same environment
# without the tblite tests failing in CI, see, e.g.:
# https://github.com/tblite/tblite/issues/116
Expand Down Expand Up @@ -143,7 +157,7 @@ jobs:
MP_API_KEY: ${{ secrets.MP_API_KEY }}
run: |
micromamba activate a2
pytest --cov=atomate2 --cov-report=xml tests/ase
pytest --splits 1 --group 1 --cov=atomate2 --cov-report=xml tests/ase

- uses: codecov/codecov-action@v1
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
Expand Down Expand Up @@ -172,7 +186,7 @@ jobs:
run: sphinx-build docs docs_build

automerge:
needs: [lint, test, docs]
needs: [lint, test-non-ase, test-notebooks-and-ase, docs]
runs-on: ubuntu-latest

permissions:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ tests = [
"nbmake==1.5.4",
"pytest-cov==5.0.0",
"pytest-mock==3.14.0",
"pytest-split==0.9.0",
"pytest==8.3.3",
]
strict = [
Expand Down
1 change: 1 addition & 0 deletions tests/.pytest-split-durations

Large diffs are not rendered by default.

Loading