diff --git a/.github/workflows/cpu-long-tests.yaml b/.github/workflows/cpu-long-tests.yaml index 1cd94c34c..416e23a6b 100644 --- a/.github/workflows/cpu-long-tests.yaml +++ b/.github/workflows/cpu-long-tests.yaml @@ -21,8 +21,9 @@ jobs: uses: omsf/start-aws-gha-runner@v1.0.0 with: aws_image_id: ami-0b7f661c228e6a4bb - aws_instance_type: t3a.small # TODO try t3a.medium next + aws_instance_type: c7i.xlarge aws_home_dir: /home/ubuntu + aws_root_device_size: 125 env: GH_PAT: ${{ secrets.GH_PAT }} @@ -46,9 +47,6 @@ jobs: - name: Print Docker details run: "docker version || true" - - name: Check for nvidia-smi - run: "nvidia-smi" - - name: "Setup Micromamba" uses: mamba-org/setup-micromamba@v2 with: @@ -88,12 +86,11 @@ jobs: - name: "Run tests" env: - # Set the OFE_SLOW_TESTS to True if running a Cron job OFE_SLOW_TESTS: "true" DUECREDIT_ENABLE: 'yes' OFE_INTEGRATION_TESTS: FALSE run: | - pytest -n logical -vv --durations=10 + pytest -n logical -vv --durations=10 openfecli/tests/ openfe/tests/ stop-aws-runner: runs-on: ubuntu-latest diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 107e4ee15..226a02083 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -43,7 +43,7 @@ jobs: - name: "Install steps" run: | python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main - python -m pip install mypy + python -m pip install "mypy<1.16.0" python -m pip install types-setuptools python -m pip install --no-deps -e . diff --git a/openfe/tests/protocols/conftest.py b/openfe/tests/protocols/conftest.py index d705af40f..6f1cbe901 100644 --- a/openfe/tests/protocols/conftest.py +++ b/openfe/tests/protocols/conftest.py @@ -223,7 +223,7 @@ def afe_solv_transformation_json() -> str: """ d = resources.files('openfe.tests.data.openmm_afe') fname = "AHFEProtocol_json_results.gz" - + with gzip.open((d / fname).as_posix(), 'r') as f: # type: ignore return f.read().decode() # type: ignore @@ -240,3 +240,31 @@ def md_json() -> str: with gzip.open((d / fname).as_posix(), 'r') as f: # type: ignore return f.read().decode() # type: ignore + +@pytest.fixture +def get_available_openmm_platforms() -> set[str]: + """ + OpenMM Platforms that are available and functional on system + """ + import openmm + from openmm import Platform + # Get platforms that openmm was built with + platforms = {Platform.getPlatform(i).getName() for i in range(Platform.getNumPlatforms())} + + # Now check if we can actually use the platforms + working_platforms = set() + for platform in platforms: + system = openmm.System() + system.addParticle(1.0) + integrator = openmm.VerletIntegrator(0.001) + try: + context = openmm.Context(system, integrator, Platform.getPlatformByName(platform)) + working_platforms.add(platform) + del context + except openmm.OpenMMException: + continue + finally: + del system, integrator + + + return working_platforms diff --git a/openfe/tests/protocols/openmm_ahfe/test_ahfe_slow.py b/openfe/tests/protocols/openmm_ahfe/test_ahfe_slow.py index bde8ec0af..acffdb326 100644 --- a/openfe/tests/protocols/openmm_ahfe/test_ahfe_slow.py +++ b/openfe/tests/protocols/openmm_ahfe/test_ahfe_slow.py @@ -15,11 +15,11 @@ @pytest.mark.parametrize('platform', ['CPU', 'CUDA']) def test_openmm_run_engine( platform, - available_platforms, + get_available_openmm_platforms, benzene_modifications, tmpdir ): - if platform not in available_platforms: + if platform not in get_available_openmm_platforms: pytest.skip(f"OpenMM Platform: {platform} not available") # Run a really short calculation to check everything is going well diff --git a/openfe/tests/protocols/openmm_rfe/test_hybrid_top_slow.py b/openfe/tests/protocols/openmm_rfe/test_hybrid_top_slow.py index ffad3f501..a49c372a6 100644 --- a/openfe/tests/protocols/openmm_rfe/test_hybrid_top_slow.py +++ b/openfe/tests/protocols/openmm_rfe/test_hybrid_top_slow.py @@ -17,11 +17,11 @@ def test_openmm_run_engine( benzene_vacuum_system, platform, - available_platforms, + get_available_openmm_platforms, benzene_modifications, tmpdir ): - if platform not in available_platforms: + if platform not in get_available_openmm_platforms: pytest.skip(f"OpenMM Platform: {platform} not available") # this test actually runs MD # these settings are a small self to self sim, that has enough eq that