Skip to content

Commit

Permalink
LAB-507 Add colabfold mini canary (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
hevans66 committed Aug 11, 2023
1 parent c4cf38a commit 030ad2a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
33 changes: 33 additions & 0 deletions infrastructure/ansible/files/colabfold_mini_canary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# exit the whole script if any command returns a non-zero exit code
set -e

# plex must run from the same place as tools directory
cd {{ repo_dir }}

plex create -t {{ repo_dir }}/tools/colabfold-mini.json -i {{ repo_dir}}/testdata/folding --autoRun=True -a test -a cron | tee plex_colabfold_out.log
# capture the exit status of the plex call
plex_result_code=${PIPESTATUS[0]}
# exit immediately if plex exited with an error
if [ $plex_result_code -gt 0 ]; then
exit $plex_result_code
fi

# parse the output directory from the plex stdout
result_dir=$(cat plex_colabfold_out.log | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')

# exit if no docked files are found
cd "$result_dir/entry-0/outputs"
if [ "$(find . -name '*scores.json')" == "" ]; then
echo "No scores fiels found"
exit 1
else
echo "Scores files found"
fi

rm -rf $result_dir

curl -X POST -H "Authorization: Bearer ${HEII_ON_CALL_API_KEY}" https://api.heiioncall.com./triggers/991a6388-5c61-422c-b8cf-202b4c4b55a6/checkin

echo "Colabfold mini canary success"
4 changes: 2 additions & 2 deletions infrastructure/ansible/files/equibind_canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
# plex must run from the same place as tools directory
cd {{ repo_dir }}

plex create -t {{ repo_dir }}/tools/equibind.json -i {{ repo_dir }}/testdata/binding/pdbbind_processed_size1 -a test -a cron --autoRun=true 2>&1 | tee plex_out.log
plex create -t {{ repo_dir }}/tools/equibind.json -i {{ repo_dir }}/testdata/binding/pdbbind_processed_size1 -a test -a cron --autoRun=true 2>&1 | tee plex_equibind_out.log
# capture the exit status of the plex call
plex_result_code=${PIPESTATUS[0]}
# exit immediately if plex exited with an error
Expand All @@ -15,7 +15,7 @@ if [ $plex_result_code -gt 0 ]; then
fi

# parse the output directory from the plex stdout
result_dir=$(cat plex_out.log | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')
result_dir=$(cat plex_equibind_out.log | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')

# exit if no docked files are found
cd "$result_dir/entry-0/outputs"
Expand Down
20 changes: 16 additions & 4 deletions infrastructure/ansible/provision_canary.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: Provision Canary
remote_user: ubuntu
hosts: "{{ target_hosts | default('tag_Type_compute') }}"
hosts: "{{ target_hosts | default('tag_Type_compute_only') }}"
vars:
canary_dir: /opt/local/canary
repo_dir: "{{ canary_dir }}/repo"
Expand Down Expand Up @@ -31,14 +31,26 @@
vars:
plex_dir: "{{ binary_dir }}"

- name: Place canary srcript
- name: Place equibind canary script
ansible.builtin.template:
src: files/equibind_canary.sh
dest: "{{ canary_dir }}/equibind_canary.sh"
mode: 'u+x'

- name: Set a cron job to run canary
- name: Place colabfold canary script
ansible.builtin.template:
src: files/colabfold_mini_canary.sh
dest: "{{ canary_dir }}/colabfold_mini_canary.sh"
mode: 'u+x'

- name: Set a cron job to run equibind canary
ansible.builtin.cron:
name: "Run equibind canary"
job: "{{ canary_dir }}/equibind_canary.sh"
minute: "*/5"
minute: "*/5" # every 5 minutes

- name: Set a cron job to run colabfold
ansible.builtin.cron:
name: "Run colabfold canary"
job: "{{ canary_dir }}/colabfold_mini_canary.sh"
minute: "27" # once per hour

0 comments on commit 030ad2a

Please sign in to comment.