Clean dependencies #1269
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AlphaPulldown-CI-CD | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11"] | |
install-type: ['user', 'developer'] | |
steps: | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Miniconda | |
id: setup_miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
auto-update-conda: true | |
channel-priority: flexible | |
use-mamba: true | |
python-version: ${{ matrix.python-version }} | |
- name: Create Conda Environment | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
mamba create -y -n AlphaPulldown -c omnia -c bioconda -c conda-forge \ | |
python=${{ matrix.python-version }} \ | |
openmm==8.0 pdbfixer==1.9 kalign2 hmmer hhsuite modelcif biopandas | |
- name: Install Pip Dependencies | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
pip install -U "jax[cuda12]" pyrosetta-installer | |
python -c 'import pyrosetta_installer; pyrosetta_installer.install_pyrosetta()' | |
- name: Install AlphaPulldown (User) | |
if: matrix.install-type == 'user' | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
pip install alphapulldown==2.0.0b6 | |
- name: Install AlphaPulldown (Developer) | |
if: matrix.install-type == 'developer' | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
pip install -e . | |
pip install -e ColabFold --no-deps | |
pip install -e alphafold --no-deps | |
- name: Set Environment Variables | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
export PYTHONPATH=$PWD/alphapulldown/analysis_pipeline:$PYTHONPATH | |
export PYTHONPATH=$PWD/AlphaLink2:$PYTHONPATH | |
- name: Install Optional Dependencies | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
# Install dependencies for AlphaLink backend if needed | |
# Uncomment the following lines if required | |
# mamba install -y -c pytorch pytorch==1.13.0 | |
# pip install setuptools==69.5.1 # Downgrade setuptools to avoid crashes when installing unicore | |
# git clone https://github.com/dptech-corp/Uni-Core.git | |
# cd Uni-Core | |
# python setup.py install --disable-cuda-ext | |
# cd .. | |
- name: Run Tests | |
shell: bash | |
run: | | |
source "${{ steps.setup_miniconda.outputs.conda-prefix }}/etc/profile.d/conda.sh" | |
conda activate AlphaPulldown | |
python test/test_python_imports.py | |
pytest -s test/test_custom_db.py | |
pytest -s test/test_remove_clashes_low_plddt.py | |
pytest -s test/test_modelcif.py | |
pytest -s test/test_features_with_templates.py | |
pytest -s test/test_post_prediction.py | |
pytest -s test/test_pdb_analyser.py | |
pytest -s test/test_get_good_inter_pae.py | |
build-fold-container: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Free disk space | |
run: | | |
rm -rf /opt/hostedtoolcache | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push fold container | |
if: github.event_name == 'push' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/pulldown.dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/fold:latest | |
ssh: default | |
- name: Build and push fold container with version | |
if: github.event_name == 'release' && github.event.action == 'published' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/pulldown.dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/fold:${{ github.event.release.tag_name }} | |
ssh: default | |
build-analysis-container: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Free disk space | |
run: | | |
rm -rf /opt/hostedtoolcache | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push analysis container | |
if: github.event_name == 'push' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/analysis.dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/fold_analysis:latest | |
- name: Build and push analysis container with version | |
if: github.event_name == 'release' && github.event.action == 'published' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/analysis.dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/fold_analysis:${{ github.event.release.tag_name }} |