From c9cf07f210ed49dae3549ac1776ca5b46c13c6ee Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Fri, 14 Feb 2025 11:15:56 -0600 Subject: [PATCH 1/7] Add PyTorch nightlies --- devtools/conda-envs/nightly.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devtools/conda-envs/nightly.yaml b/devtools/conda-envs/nightly.yaml index 5ea8f9e..f706486 100644 --- a/devtools/conda-envs/nightly.yaml +++ b/devtools/conda-envs/nightly.yaml @@ -63,5 +63,9 @@ dependencies: - git+https://github.com/openforcefield/openff-toolkit.git@main - git+https://github.com/openforcefield/openff-recharge.git@main - git+https://github.com/openforcefield/openff-units.git@main - + - --pre + - --extra-index-url https://download.pytorch.org/whl/nightly/cpu + - torch + - torchvision + - torchaudio From c8f93cbfc3c27809e1fb9675260e93a0139a4ef9 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Fri, 14 Feb 2025 11:16:29 -0600 Subject: [PATCH 2/7] Drop other CI --- .github/workflows/base-ci.yaml | 76 ------------ .github/workflows/examples-ci.yaml | 92 -------------- .github/workflows/gh-ci.yaml | 187 ----------------------------- .github/workflows/gpu.yaml | 98 --------------- 4 files changed, 453 deletions(-) delete mode 100644 .github/workflows/base-ci.yaml delete mode 100644 .github/workflows/examples-ci.yaml delete mode 100644 .github/workflows/gh-ci.yaml delete mode 100644 .github/workflows/gpu.yaml diff --git a/.github/workflows/base-ci.yaml b/.github/workflows/base-ci.yaml deleted file mode 100644 index b5d29d2..0000000 --- a/.github/workflows/base-ci.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: Base tests -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - main_tests: - name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, openeye=${{ matrix.include-openeye }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-13, macOS-latest, ubuntu-latest] - python-version: ["3.10", "3.11", "3.12"] - include-openeye: [false, true] - - steps: - - uses: actions/checkout@v4 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/base.yaml - create-args: >- - python=${{ matrix.python-version }} - - - name: Install package - run: | - python -m pip install . --no-deps - - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == 'true' - - - name: Run tests - run: python -m pytest -n logical --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml deleted file mode 100644 index ddc1035..0000000 --- a/.github/workflows/examples-ci.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: Examples CI -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - example_tests: - name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ["3.11", "3.12"] - pydantic-version: ["2"] - include-rdkit: [true] - include-openeye: [false] - include-dgl: [true] - - - steps: - - uses: actions/checkout@v4 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: devtools/conda-envs/examples_env.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} - - - name: Install package - run: | - python -m pip install . --no-deps - - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: conda remove --force rdkit --yes || echo "rdkit not installed" - - - name: Python information - run: | - which python - conda info - conda list - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - - name: Run example notebooks - run: | - python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --nbval-cell-timeout=50000 --dist loadscope examples diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml deleted file mode 100644 index 55027c8..0000000 --- a/.github/workflows/gh-ci.yaml +++ /dev/null @@ -1,187 +0,0 @@ -name: GH Actions CI -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - main_tests: - name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-13, macOS-latest, ubuntu-latest] - python-version: ["3.10", "3.11", "3.12"] - pydantic-version: ["1", "2"] - include-rdkit: [false, true] - include-openeye: [false, true] - include-dgl: [false, true] - exclude: - - include-rdkit: false - include-openeye: false - - - steps: - - uses: actions/checkout@v4 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/test_env_dgl_${{ matrix.include-dgl }}.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} - - - name: Install package - run: | - python -m pip install . --no-deps - - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: micromamba remove --force rdkit --yes || echo "rdkit not installed" - - # See https://github.com/openforcefield/openff-nagl/issues/103 - - name: Rewrite DGL config - if: matrix.include-dgl == true - run: | - mkdir -p ~/.dgl - echo '{"backend": "pytorch"}' > ~/.dgl/config.json - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - - name: Check DGL installation - if: matrix.include-dgl == true - run: | - python -c "import dgl" - - - name: Run tests - run: | - python -m pytest -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - - - name: codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - verbose: True - # name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} - - pylint_check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install Pylint - run: | - which pip - which python - pip install pylint - - - name: Run Pylint - env: - PYLINTRC: .pylintrc - run: | - pylint openff.nagl - - - pypi_check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install dependencies - run: | - pip install setuptools twine - - - name: Build package - run: | - python3 -m pip install --upgrade build - python3 -m build - - - name: Check package build - run: | - DISTRIBUTION=$(ls -t1 dist/openff_nagl-*.tar.gz | head -n 1) - test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff_nagl-*.tar.gz found"; exit 1; } - echo "twine check $DISTRIBUTION" - twine check $DISTRIBUTION - - install_from_source_conda: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - - name: Install conda - uses: mamba-org/setup-micromamba@v2 - with: - environment-name: openff-nagl - create-args: >- - python=${{ matrix.python-version }} - - - name: Build from source - run: | - micromamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml - python --version - python -m pip install . --no-deps - micromamba list - - - name: Check success - run: | - python -c "import openff.nagl ; print(openff.nagl.__version__)" diff --git a/.github/workflows/gpu.yaml b/.github/workflows/gpu.yaml deleted file mode 100644 index d1d4d75..0000000 --- a/.github/workflows/gpu.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: GPU-enabled CI -on: - workflow_dispatch: - pull_request: - branches: - - "main" - -defaults: - run: - shell: bash -l {0} - -jobs: - start-aws-runner: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - outputs: - mapping: ${{ steps.aws-start.outputs.mapping }} - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role - aws-region: us-east-1 - - name: Create cloud runner - id: aws-start - uses: omsf-eco-infra/gha-runner@v0.4.0 - with: - provider: "aws" - action: "start" - aws_image_id: ami-0d5079d9be06933e5 - aws_instance_type: g4dn.xlarge - # IAM default might be 5 GB? - aws_root_device_size: 125 - aws_region_name: us-east-1 - aws_home_dir: /home/ubuntu - env: - GH_PAT: ${{ secrets.GH_PAT }} - self-hosted-test: - runs-on: self-hosted - needs: - - start-aws-runner - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Print disk usage - run: "df -h" - - - name: Print Docker details - run: "docker version || true" - - - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/test_cuda_env.yaml - - - name: Install Package - run: python -m pip install . --no-deps - - - name: Double-check local installation - run: python -c "from openff.nagl import __version__; print(__version__)" - - - name: Check that PyTorch can see CUDA - run: python -c "import torch; assert torch.cuda.is_available()" - - - name: Check we can see DGL - run: python -c "import dgl; print(dgl.__version__)" - - - name: Run tests - run: python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - - stop-aws-runner: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - needs: - - start-aws-runner - - self-hosted-test - if: ${{ always() }} - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role - aws-region: us-east-1 - - name: Stop instances - uses: omsf-eco-infra/gha-runner@v0.4.0 - with: - provider: "aws" - action: "stop" - instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }} - aws_region_name: us-east-1 - env: - GH_PAT: ${{ secrets.GH_PAT }} From 36dec7ab824659bb114757dda181f5b6b0749670 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Fri, 14 Feb 2025 12:42:23 -0600 Subject: [PATCH 3/7] Run nightlies in this PR --- .github/workflows/dev-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev-ci.yaml b/.github/workflows/dev-ci.yaml index 40e9b86..6d06b0c 100644 --- a/.github/workflows/dev-ci.yaml +++ b/.github/workflows/dev-ci.yaml @@ -1,5 +1,7 @@ name: Upstream nightly version CI on: + push: + pull_request: schedule: # weekly tests, Sundays at midnight - cron: "0 0 * * 0" From ced03da6095a6c50c2e3e391c9a76d2946b9ce88 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 18 Feb 2025 13:40:17 -0800 Subject: [PATCH 4/7] Revert "Drop other CI" This reverts commit c8f93cbfc3c27809e1fb9675260e93a0139a4ef9. --- .github/workflows/base-ci.yaml | 76 ++++++++++++ .github/workflows/examples-ci.yaml | 92 ++++++++++++++ .github/workflows/gh-ci.yaml | 187 +++++++++++++++++++++++++++++ .github/workflows/gpu.yaml | 98 +++++++++++++++ 4 files changed, 453 insertions(+) create mode 100644 .github/workflows/base-ci.yaml create mode 100644 .github/workflows/examples-ci.yaml create mode 100644 .github/workflows/gh-ci.yaml create mode 100644 .github/workflows/gpu.yaml diff --git a/.github/workflows/base-ci.yaml b/.github/workflows/base-ci.yaml new file mode 100644 index 0000000..b5d29d2 --- /dev/null +++ b/.github/workflows/base-ci.yaml @@ -0,0 +1,76 @@ +name: Base tests +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # weekly tests, Sundays at midnight + - cron: "0 0 * * 0" + +concurrency: + # Specific group naming so CI is only cancelled + # within same PR or on merge to main + group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} + cancel-in-progress: true + +defaults: + run: + shell: bash -l {0} + +env: + OE_LICENSE: ${{ github.workspace }}/oe_license.txt + +jobs: + main_tests: + name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, openeye=${{ matrix.include-openeye }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macOS-13, macOS-latest, ubuntu-latest] + python-version: ["3.10", "3.11", "3.12"] + include-openeye: [false, true] + + steps: + - uses: actions/checkout@v4 + + - name: Build information + run: | + uname -a + df -h + ulimit -a + + - name: Install environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: devtools/conda-envs/base.yaml + create-args: >- + python=${{ matrix.python-version }} + + - name: Install package + run: | + python -m pip install . --no-deps + + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} + + + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" + + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == 'true' + + - name: Run tests + run: python -m pytest -n logical --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml new file mode 100644 index 0000000..ddc1035 --- /dev/null +++ b/.github/workflows/examples-ci.yaml @@ -0,0 +1,92 @@ +name: Examples CI +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # weekly tests, Sundays at midnight + - cron: "0 0 * * 0" + +concurrency: + # Specific group naming so CI is only cancelled + # within same PR or on merge to main + group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} + cancel-in-progress: true + +defaults: + run: + shell: bash -l {0} + +env: + OE_LICENSE: ${{ github.workspace }}/oe_license.txt + +jobs: + example_tests: + name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ["3.11", "3.12"] + pydantic-version: ["2"] + include-rdkit: [true] + include-openeye: [false] + include-dgl: [true] + + + steps: + - uses: actions/checkout@v4 + + - name: Build information + run: | + uname -a + df -h + ulimit -a + + - name: Install environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda-envs/examples_env.yaml + create-args: >- + python=${{ matrix.python-version }} + pydantic=${{ matrix.pydantic-version }} + + - name: Install package + run: | + python -m pip install . --no-deps + + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} + + + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" + + - name: Uninstall RDKit + if: matrix.include-rdkit == false + run: conda remove --force rdkit --yes || echo "rdkit not installed" + + - name: Python information + run: | + which python + conda info + conda list + + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' + + - name: Run example notebooks + run: | + python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --nbval-cell-timeout=50000 --dist loadscope examples diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml new file mode 100644 index 0000000..55027c8 --- /dev/null +++ b/.github/workflows/gh-ci.yaml @@ -0,0 +1,187 @@ +name: GH Actions CI +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # weekly tests, Sundays at midnight + - cron: "0 0 * * 0" + +concurrency: + # Specific group naming so CI is only cancelled + # within same PR or on merge to main + group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} + cancel-in-progress: true + +defaults: + run: + shell: bash -l {0} + +env: + OE_LICENSE: ${{ github.workspace }}/oe_license.txt + +jobs: + main_tests: + name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macOS-13, macOS-latest, ubuntu-latest] + python-version: ["3.10", "3.11", "3.12"] + pydantic-version: ["1", "2"] + include-rdkit: [false, true] + include-openeye: [false, true] + include-dgl: [false, true] + exclude: + - include-rdkit: false + include-openeye: false + + + steps: + - uses: actions/checkout@v4 + + - name: Build information + run: | + uname -a + df -h + ulimit -a + + - name: Install environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: devtools/conda-envs/test_env_dgl_${{ matrix.include-dgl }}.yaml + create-args: >- + python=${{ matrix.python-version }} + pydantic=${{ matrix.pydantic-version }} + + - name: Install package + run: | + python -m pip install . --no-deps + + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} + + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" + + - name: Uninstall RDKit + if: matrix.include-rdkit == false + run: micromamba remove --force rdkit --yes || echo "rdkit not installed" + + # See https://github.com/openforcefield/openff-nagl/issues/103 + - name: Rewrite DGL config + if: matrix.include-dgl == true + run: | + mkdir -p ~/.dgl + echo '{"backend": "pytorch"}' > ~/.dgl/config.json + + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' + + - name: Check DGL installation + if: matrix.include-dgl == true + run: | + python -c "import dgl" + + - name: Run tests + run: | + python -m pytest -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ + + - name: codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + verbose: True + # name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} + + pylint_check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install Pylint + run: | + which pip + which python + pip install pylint + + - name: Run Pylint + env: + PYLINTRC: .pylintrc + run: | + pylint openff.nagl + + + pypi_check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + pip install setuptools twine + + - name: Build package + run: | + python3 -m pip install --upgrade build + python3 -m build + + - name: Check package build + run: | + DISTRIBUTION=$(ls -t1 dist/openff_nagl-*.tar.gz | head -n 1) + test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff_nagl-*.tar.gz found"; exit 1; } + echo "twine check $DISTRIBUTION" + twine check $DISTRIBUTION + + install_from_source_conda: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Install conda + uses: mamba-org/setup-micromamba@v2 + with: + environment-name: openff-nagl + create-args: >- + python=${{ matrix.python-version }} + + - name: Build from source + run: | + micromamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml + python --version + python -m pip install . --no-deps + micromamba list + + - name: Check success + run: | + python -c "import openff.nagl ; print(openff.nagl.__version__)" diff --git a/.github/workflows/gpu.yaml b/.github/workflows/gpu.yaml new file mode 100644 index 0000000..d1d4d75 --- /dev/null +++ b/.github/workflows/gpu.yaml @@ -0,0 +1,98 @@ +name: GPU-enabled CI +on: + workflow_dispatch: + pull_request: + branches: + - "main" + +defaults: + run: + shell: bash -l {0} + +jobs: + start-aws-runner: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + outputs: + mapping: ${{ steps.aws-start.outputs.mapping }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role + aws-region: us-east-1 + - name: Create cloud runner + id: aws-start + uses: omsf-eco-infra/gha-runner@v0.4.0 + with: + provider: "aws" + action: "start" + aws_image_id: ami-0d5079d9be06933e5 + aws_instance_type: g4dn.xlarge + # IAM default might be 5 GB? + aws_root_device_size: 125 + aws_region_name: us-east-1 + aws_home_dir: /home/ubuntu + env: + GH_PAT: ${{ secrets.GH_PAT }} + self-hosted-test: + runs-on: self-hosted + needs: + - start-aws-runner + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Print disk usage + run: "df -h" + + - name: Print Docker details + run: "docker version || true" + + - name: Setup Conda Environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: devtools/conda-envs/test_cuda_env.yaml + + - name: Install Package + run: python -m pip install . --no-deps + + - name: Double-check local installation + run: python -c "from openff.nagl import __version__; print(__version__)" + + - name: Check that PyTorch can see CUDA + run: python -c "import torch; assert torch.cuda.is_available()" + + - name: Check we can see DGL + run: python -c "import dgl; print(dgl.__version__)" + + - name: Run tests + run: python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ + + stop-aws-runner: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + needs: + - start-aws-runner + - self-hosted-test + if: ${{ always() }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role + aws-region: us-east-1 + - name: Stop instances + uses: omsf-eco-infra/gha-runner@v0.4.0 + with: + provider: "aws" + action: "stop" + instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }} + aws_region_name: us-east-1 + env: + GH_PAT: ${{ secrets.GH_PAT }} From fd7f3da8f506aa4c739731f8e1699e983c892bc8 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 18 Feb 2025 20:38:14 -0800 Subject: [PATCH 5/7] Drop nightly channel --- devtools/conda-envs/nightly.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devtools/conda-envs/nightly.yaml b/devtools/conda-envs/nightly.yaml index f706486..9628a29 100644 --- a/devtools/conda-envs/nightly.yaml +++ b/devtools/conda-envs/nightly.yaml @@ -2,7 +2,6 @@ name: openff-nagl-test channels: - openeye - conda-forge - - pytorch-nightly dependencies: # Base depends - python @@ -20,7 +19,7 @@ dependencies: - openeye-toolkits # gnn - - pytorch + - pytorch ~=2.6 - torchvision - torchaudio From 673ca01280b0fd03504cd046c0c7157810c25b54 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Wed, 19 Feb 2025 05:24:03 -0800 Subject: [PATCH 6/7] Debug --- devtools/conda-envs/nightly.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/devtools/conda-envs/nightly.yaml b/devtools/conda-envs/nightly.yaml index 9628a29..e86d293 100644 --- a/devtools/conda-envs/nightly.yaml +++ b/devtools/conda-envs/nightly.yaml @@ -20,8 +20,6 @@ dependencies: # gnn - pytorch ~=2.6 - - torchvision - - torchaudio # database - pyarrow From 46a2ccb1b81632b37de8d4006b23ba6dddc7803d Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 31 Mar 2025 08:48:07 -0500 Subject: [PATCH 7/7] Force NumPy 1 --- devtools/conda-envs/nightly.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/conda-envs/nightly.yaml b/devtools/conda-envs/nightly.yaml index e86d293..a92291a 100644 --- a/devtools/conda-envs/nightly.yaml +++ b/devtools/conda-envs/nightly.yaml @@ -6,6 +6,7 @@ dependencies: # Base depends - python - pip + - numpy =1 # UI - click