Skip to content

Commit

Permalink
Merge branch 'main' into oechemless-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
IAlibay authored Oct 28, 2024
2 parents 076117e + 979676a commit 1cbf972
Show file tree
Hide file tree
Showing 122 changed files with 3,301 additions and 699 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ on:
pull_request:
branches:
- main
# Skip CI if changed files only affect the following folders
# - docs: documentation changes don't need code validation
# See here for more details: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths
paths-ignore:
- "docs/*"
push:
branches:
- main
Expand All @@ -24,29 +29,34 @@ defaults:

jobs:
tests:
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} 🗃️${{ matrix.pydantic-version }} oechem: ${{ matrix.openeye }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu"]
os: ["ubuntu-latest"]
pydantic-version: [">1"]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
openeye: ["no"]
include:
- os: "macos"
python-version: "3.11"
- os: "macos-12"
python-version: "3.12"
pydantic-version: ">1"
- os: "ubuntu"
- os: "ubuntu-latest"
python-version: "3.11"
pydantic-version: "<2"
- os: "ubuntu"
- os: "ubuntu-latest"
python-version: "3.11"
pydantic-version: ">1"
openeye: "yes"
- os: "macos-latest"
python-version: "3.12"
pydantic-version: ">1"
omff-version: ">0.13"
openeye: ["no"]

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
Expand All @@ -63,6 +73,8 @@ jobs:
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ~/.local/bin/micromamba
environment-file: environment.yml
environment-name: openfe_env
cache-environment: true
Expand Down Expand Up @@ -99,6 +111,7 @@ jobs:
run: |
micromamba info
micromamba list
pip list
- name: "Run tests"
env:
Expand All @@ -111,7 +124,7 @@ jobs:
- name: codecov-pr
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand All @@ -126,7 +139,7 @@ jobs:
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name != 'schedule'
&& github.event_name != 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/conda_cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "conda_cron"
on:
workflow_dispatch:
schedule:
# At 07:00 UTC every day
- cron: "0 7 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash -leo pipefail {0}

jobs:
condacheck:
runs-on: ${{ matrix.OS }}
name: "daily conda check"
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'macos-12']
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- os: 'macos-latest'
python-version: '3.9'

steps:
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ~/.local/bin/micromamba
environment-name: openfe
create-args: >-
python=${{ matrix.python-version }}
pip
jq
condarc: |
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
init-shell: bash

- name: "Install openfe + optional deps"
run: |
# get latest version from conda-forge
LATEST_VERSION=$(micromamba search --json openfe | jq '.result.pkgs[0].version')
echo "LATEST_VERSION: $LATEST_VERSION"
# Removing the quotes from the vesrion number
# https://mywiki.wooledge.org/BashGuide/Parameters#Parameter_Expansion
micromamba install openfe=${LATEST_VERSION//\"} pytest -c conda-forge
python -m pip install pytest-xdist
- name: "env info"
run: |
micromamba info
micromamba list
pip list
- id: run-tests
name: "Run tests"
run: |
# note: this only runs the fast tests
pytest -n auto --pyargs openfe openfecli
2 changes: 1 addition & 1 deletion .github/workflows/docker-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ jobs:
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} openfe --version
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import gufe; print(gufe.__version__)"
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs gufe -v
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs openfe --pyargs openfecli -v
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs openfe -v
6 changes: 3 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} openfe --version
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import gufe; print(gufe.__version__)"
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs gufe -v
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs openfecli --pyargs openfe -v
docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs openfe -v
- name: Push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.1.2
apptainer-version: 1.3.4

- name: Build Apptainer Image
run: singularity build openfe_${{ steps.latest-version.outputs.VERSION }}.sif docker-daemon:${{ steps.fqirp.outputs.FQIRP }}
Expand All @@ -123,7 +123,7 @@ jobs:
cd test_apptainer
singularity run ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif --help
singularity run ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif --version
singularity run ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif pytest --pyargs openfecli --pyargs openfe -v -n auto
singularity run ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif pytest --pyargs openfe -v -n auto
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
singularity push ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif oras://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.latest-version.outputs.VERSION }}-apptainer
singularity push ../openfe_${{ steps.latest-version.outputs.VERSION }}.sif oras://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-apptainer
128 changes: 128 additions & 0 deletions .github/workflows/gpu-runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Test Self-Hosted Runner
on:
workflow_dispatch:

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::010438489691:role/GHARunnerAWS
aws-region: us-east-2
- name: Create cloud runner
id: aws-start
uses: omsf-eco-infra/gha-runner@v0.2.0
with:
provider: "aws"
action: "start"
aws_image_id: ami-0b7f661c228e6a4bb
aws_instance_type: g4dn.xlarge
aws_region_name: us-east-2
aws_home_dir: /home/ubuntu
env:
GH_PAT: ${{ secrets.GH_PAT }}

self-hosted-test:
runs-on: self-hosted
timeout-minutes: 720 # 12 hours
defaults:
run:
shell: bash -leo pipefail {0}
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

needs:
- start-aws-runner
steps:
- uses: actions/checkout@v4

- name: Print disk usage
run: "df -h"

- name: Print Docker details
run: "docker version || true"

- name: Check for nvidia-smi
run: "nvidia-smi"

- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
environment-file: environment.yml
environment-name: openfe_env
condarc: |
channels:
- conda-forge
- openeye
create-args: >-
espaloma_charge==0.0.8
openeye-toolkits
- name: "Check if OpenMM can get a GPU"
run: python -m openmm.testInstallation

- name: "Install GUFE from main@HEAD"
run: python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main

- name: "Install"
run: python -m pip install --no-deps -e .

- name: "Test imports"
run: |
# if we add more to this, consider changing to for + env vars
python -Ic "import openfe; print(openfe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
pip list
- name: Test OE License & Write License to File
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'OpenEye license checks failed!'"
- 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: TRUE
run: |
pytest -n 4 -v --durations=10
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::010438489691:role/GHARunnerAWS
aws-region: us-east-2
- name: Stop instances
uses: omsf-eco-infra/gha-runner@v0.2.0
with:
provider: "aws"
action: "stop"
instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }}
aws_region_name: us-east-2
env:
GH_PAT: ${{ secrets.GH_PAT }}
8 changes: 5 additions & 3 deletions .github/workflows/installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}

jobs:
test:
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
os: [macos-14, macos-12, ubuntu-latest]

steps:
- name: Checkout Code
Expand All @@ -37,6 +37,8 @@ jobs:
- name: Install constructor environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ~/.local/bin/micromamba
environment-name: installer
create-args: >-
python=3.10
Expand All @@ -60,7 +62,7 @@ jobs:
chmod +x ${{ steps.file-name.outputs.FILE_NAME }}
./${{ steps.file-name.outputs.FILE_NAME }} -b
export PATH="$HOME/openfeforge/bin:$PATH"
OFE_SLOW_TESTS=FALSE pytest -v --pyargs openfe pytest -v --pyargs openfe
OFE_SLOW_TESTS=FALSE pytest -v --pyargs openfe
# Copy for "latest" release by removing version
# Inspired by https://github.com/conda-forge/miniforge/blob/main/.github/workflows/ci.yml
cp ${{ steps.file-name.outputs.FILE_NAME }} $(echo ${{ steps.file-name.outputs.FILE_NAME }} | sed -e 's/-[^-]*//')
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ jobs:
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
environment-file: environment.yml
environment-name: openfe_env
cache-environment: true
cache-downloads: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.9
python=3
rdkit=2023.09.5
init-shell: bash

- 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 types-pkg_resources
python -m pip install --no-deps -e .
- name: "Environment Information"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
environment-file: environment.yml
environment-name: openfe_env
cache-environment: true
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ ci:
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-added-large-files
Loading

0 comments on commit 1cbf972

Please sign in to comment.