Skip to content

Commit

Permalink
Add small molecule repex consistency tests (#1065)
Browse files Browse the repository at this point in the history
* add neutral test

* add small molecule tests

* remove charge test

* add charge test

* add guest mol2s

* fix charge changing test

* add cache

* make sure lrc is set correctly

* Small code cleanup. Fix docstring. Remove unused imports.

* Using LangevinDynamicsMove instead of LangevinSplittingDynamicsMove. Adds gpu tests decorator.

* Only using LangevinDynamicsMove in tests. Others stay the same as before.

* Making sure the CPU platform is used in geometry engine.

* Adjusting repex tests parameters for better performance.

* Revert "Making sure the CPU platform is used in geometry engine."

This reverts commit 1e90291.

* Keep the convergence criteria to be 6*dDDG

* Increasing n steps for move apply. Decreasing number of iterations

* Trying running self-hosted GPU tests on PR.

* switch to using openmm rc

* Testing phenol-paracetamol transformation. 250 steps, 1000 iterations. Oh Percy... y u no like smiles!

* Quick testing new instance type for gpu tests.

* Trying own fork with fix with unique instance name

* Going back to original runner repo.

* add us-east-1a subnet

* fix vim typo

* try p2.xlarge first

* Added us-east-1b subnet

* Added us-east-1c subnet

* Added us-east-1e subnet

* Added us-east-1f subnet

* go to next step even if we can't provision an instance

* switch to g4dn.xlarge

* switch to using once subnet for now while testing new ami

* fix comment error

* make sure we stop instances if they fail

* bump ci

* bump ci

* bump ci

* switch to using new ami

* try new subnet and sg

* bump ci

* bump ci

* switch to using micromamba

* remove unused channels and clean up CI workflow a bit

* debug provision-with-micromamba

* see if python 3.10 fixes it

* try latest version

* try older version

* Set default shell

* switch to newest version

* switch to a different action

* See if this fixes the unbound home var

* see if this fixes the issue with home not being set

* Testing GPU platforms specifically, debugging purposes

* timeout of 20 hrs instead of the 6 hrs default

* back to testing everything

* Putting timeout of 20 hrs in correct place/job.

* Using specific tagged url for tyk2 tests

* fix cudatoolkit version

* remove extra code we don't need anymore

* skip test for now, need better system to test with

* let codecov fail, also update the action

* only run on commit, on demand, on weekly

* Using bootstrapping from MBAR to compute errors

* Those damn signs! Making it less prone to sign errors.

* Better naming for quantities

* Making sure we test using decorrelated samples

* Swapping tests, now correct order.

* use micromamba

* micromamba thowing a fit about oPtIonS iT dOeSn'T uNDerStAnd

* Changing back the transformation order to the correct one.

* Correct comparison charge mutation. Naming cleanup

* Better naming. Minor indenting cleanup.

* Removing misplaced quotes, my bad!

* Update .github/workflows/self-hosted-gpu-test.yml

* Removing deprecated comment

* Lowering the number of steps per iteration to decrease run times.

* removing commented/unused line

* Update .github/workflows/self-hosted-gpu-test.yml

---------

Co-authored-by: Iván Pulido <[email protected]>
Co-authored-by: Iván Pulido <[email protected]>
Co-authored-by: Mike Henry <[email protected]>
  • Loading branch information
4 people authored Apr 28, 2023
1 parent 6730065 commit 8e3e423
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: true
62 changes: 29 additions & 33 deletions .github/workflows/self-hosted-gpu-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: self-hosted-gpu-test
on:
push:
branches:
- master
- main
workflow_dispatch:
schedule:
Expand All @@ -22,96 +21,93 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Start EC2 runner
- name: Try to start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@main
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-034abd52dd90b8023
ec2-instance-type: p2.xlarge
subnet-id: subnet-0e82552b8c708a999
security-group-id: sg-0589e74ec03965add
ec2-image-id: ami-04d16a12bbc76ff0b
ec2-instance-type: g4dn.xlarge
subnet-id: subnet-0dee8543e12afe0cd # us-east-1a
security-group-id: sg-0f9809618550edb98
# iam-role-name: self-hosted-runner # optional, requires additional permissions
aws-resource-tags: > # optional, requires additional permissions
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
]
do-the-job:
name: Do the job on the runner
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
timeout-minutes: 1200 # 20 hrs
env:
TEST_MODE: GPU
OPENMM: ${{ matrix.cfg.openmm }}
OPENMM: 8.0
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
HOME: /home/ec2-user

defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- name: setup env
run: |
echo $HOME
export HOME=/home/ec2-user
echo $HOME
- uses: actions/checkout@v3
- uses: mamba-org/provision-with-micromamba@main
with:
python-version: 3.9
channels: conda-forge,omnia-dev,openeye
environment-file: devtools/conda-envs/test_env.yaml
show-channel-urls: true
auto-activate-base: false
activate-environment: test
miniforge-version: latest
miniforge-variant: Mambaforge

- name: Refine test env
shell: bash -l {0}
run: |
conda install -y cudatoolkit==11.0.3 openmm>=7.7
channels: conda-forge,openeye
extra-specs: |
python==3.9
openmm>=8.0
cudatoolkit==11.7
- name: Additional info about the build
shell: bash -l {0}
run: |
uname -a
df -h
ulimit -a
conda info -a
conda list
micromamba info
micromamba list
python -c "import openmm; print(openmm.Platform.getPluginLoadFailures())"
python -m openmm.testInstallation
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps -v .
- name: Environment Information
shell: bash -l {0}
run: |
conda info -a
conda list
micromamba info
micromamba list
- name: Decrypt OpenEye license
shell: bash -l {0}
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: Test the package
shell: bash -l {0}
run: |
export TRAVIS=true
conda list --explicit
micromamba list
pytest -v --cov-report xml --cov=perses --durations=0 -a "not advanced" -m "gpu_ci or gpu_needed" perses/tests
- name: Codecov
if: ${{ github.repository == 'choderalab/perses'
&& github.event != 'schedule' }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: false

stop-runner:
name: Stop self-hosted EC2 runner
Expand Down
1 change: 0 additions & 1 deletion devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: test
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
- openeye
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion perses/app/relative_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def __init__(self,
spectator_mol = generate_unique_atom_names(spectator_mol)
self._spectator_molecules.append(spectator_mol)
# add this to a small molecule register
molecules.append(Molecule.from_openeye(spectator_mol,allow_undefined_stereo=True))
self._molecules.append(Molecule.from_openeye(spectator_mol,allow_undefined_stereo=True))
self._spectator_positions.append(extractPositionsFromOEMol(spectator_mol))
spectator_topology = forcefield_generators.generateTopologyFromOEMol(spectator_mol)
self._spectator_md_topologies.append(md.Topology.from_openmm(spectator_topology))
Expand Down
4 changes: 2 additions & 2 deletions perses/tests/test_relative.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,14 +1135,14 @@ def concatenate_files(input_files, output_file):
base_repo_url = "https://github.com/openforcefield/protein-ligand-benchmark"
ligand_files = []
for ligand in ['lig_ejm_42', 'lig_ejm_54']:
ligand_url = f"{base_repo_url}/raw/main/data/2020-02-07_tyk2/02_ligands/{ligand}/crd/{ligand}.sdf"
ligand_url = f"{base_repo_url}/raw/0.2.1/data/2020-02-07_tyk2/02_ligands/{ligand}/crd/{ligand}.sdf"
ligand_file = retrieve_file_url(ligand_url)
ligand_files.append(ligand_file)
concatenate_files(ligand_files, os.path.join(temp_dir, 'ligands.sdf'))
ligands_filename = os.path.join(temp_dir, 'ligands.sdf')

# Retrieve host PDB
pdb_url = f"{base_repo_url}/raw/main/data/2020-02-07_tyk2/01_protein/crd/protein.pdb"
pdb_url = f"{base_repo_url}/raw/0.2.1/data/2020-02-07_tyk2/01_protein/crd/protein.pdb"
host_pdb = retrieve_file_url(pdb_url)

# Generate topology proposal, old/new positions
Expand Down
Loading

0 comments on commit 8e3e423

Please sign in to comment.