Skip to content

Commit b1370fe

Browse files
authored
[LAB-577] Plex upgrade to 0.10.0 (#626)
1 parent 4fc11d4 commit b1370fe

File tree

6 files changed

+58
-9
lines changed

6 files changed

+58
-9
lines changed

infrastructure/ansible/files/colabfold_mini_canary.sh

+20-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,25 @@
33
# exit the whole script if any command returns a non-zero exit code
44
set -e
55

6+
# IFPS Custom setup
7+
export IPFS_PATH=$(mktemp -d)
8+
export BACALHAU_SERVE_IPFS_PATH=${IPFS_PATH}
9+
export LOGFILE={{ repo_dir }}/plex_colabfold_out.log
10+
11+
# Ensure there is no port conflict with other canaries
12+
ipfs init -e
13+
ipfs bootstrap rm --all
14+
ipfs config Addresses.API /ip4/127.0.0.1/tcp/8001
15+
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8002
16+
ipfs config Addresses.Swarm --json '["/ip4/0.0.0.0/tcp/8000"]'
17+
export BACALHAU_IPFS_SWARM_ADDRESSES="/dns4/bacalhau.labdao.xyz/tcp/4001/p2p/$(curl -s -X POST bacalhau.labdao.xyz:5001/api/v0/id | jq -r '.ID')"
18+
619
# plex must run from the same place as tools directory
720
cd {{ repo_dir }}
21+
touch ${LOGFILE}
22+
echo "$(date) - Running Canary" | tee -a ${LOGFILE}
823

9-
plex init -t {{ repo_dir }}/tools/colabfold-mini.json -i '{"sequence": ["{{ repo_dir }}/testdata/folding/test.fasta"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a cron | tee plex_colabfold_out.log
24+
plex init -t {{ repo_dir }}/tools/colabfold-mini.json -i '{"sequence": ["{{ repo_dir }}/testdata/folding/test.fasta"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a cron | tee -a ${LOGFILE}
1025
# capture the exit status of the plex call
1126
plex_result_code=${PIPESTATUS[0]}
1227
# exit immediately if plex exited with an error
@@ -15,7 +30,7 @@ if [ $plex_result_code -gt 0 ]; then
1530
fi
1631

1732
# parse the output directory from the plex stdout
18-
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//')
33+
result_dir=$(cat ${LOGFILE} | grep -a 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//' | tail -n 1)
1934

2035
# exit if no docked files are found
2136
cd "$result_dir/entry-0/outputs"
@@ -30,4 +45,6 @@ rm -rf $result_dir
3045

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

33-
echo "Colabfold mini canary success"
48+
echo "$(date) - Colabfold mini canary success" | tee -a ${LOGFILE}
49+
50+
rm -rf ${IPFS_PATH}

infrastructure/ansible/files/equibind_canary.sh

+21-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@
33
# exit the whole script if any command returns a non-zero exit code
44
set -e
55

6+
# IFPS Custom setup
7+
export IPFS_PATH=$(mktemp -d)
8+
export BACALHAU_SERVE_IPFS_PATH=${IPFS_PATH}
9+
export LOGFILE={{ repo_dir }}/plex_equibind_out.log
10+
11+
# Ensure there is no port conflict with other canaries
12+
ipfs init -e
13+
ipfs bootstrap rm --all
14+
ipfs config Addresses.API /ip4/127.0.0.1/tcp/7001
15+
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/7002
16+
ipfs config Addresses.Swarm --json '["/ip4/0.0.0.0/tcp/7000"]'
17+
export BACALHAU_IPFS_SWARM_ADDRESSES="/dns4/bacalhau.labdao.xyz/tcp/4001/p2p/$(curl -s -X POST bacalhau.labdao.xyz:5001/api/v0/id | jq -r '.ID')"
18+
619
# plex must run from the same place as tools directory
720
cd {{ repo_dir }}
821

9-
plex init -t {{ repo_dir }}/tools/equibind.json -i '{"protein": ["{{ repo_dir }}/testdata/binding/abl/7n9g.pdb"], "small_molecule": ["{{ repo_dir }}/testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct -a test -a cron --autoRun=true 2>&1 | tee plex_equibind_out.log
22+
touch ${LOGFILE}
23+
echo "$(date) - Running Canary" | tee -a ${LOGFILE}
24+
25+
plex init -t {{ repo_dir }}/tools/equibind.json -i '{"protein": ["{{ repo_dir }}/testdata/binding/abl/7n9g.pdb"], "small_molecule": ["{{ repo_dir }}/testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct -a test -a cron --autoRun=true 2>&1 | tee -a ${LOGFILE}
1026
# capture the exit status of the plex call
1127
plex_result_code=${PIPESTATUS[0]}
1228
# exit immediately if plex exited with an error
@@ -15,7 +31,7 @@ if [ $plex_result_code -gt 0 ]; then
1531
fi
1632

1733
# parse the output directory from the plex stdout
18-
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//')
34+
result_dir=$(cat ${LOGFILE} | grep -a 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//' | tail -n 1)
1935

2036
# exit if no docked files are found
2137
cd "$result_dir/entry-0/outputs"
@@ -30,4 +46,6 @@ rm -rf $result_dir
3046

3147
curl -X POST -H "Authorization: Bearer ${HEII_ON_CALL_API_KEY}" https://api.heiioncall.com./triggers/a7660c2f-5262-4392-918b-d98aee244890/checkin
3248

33-
echo "Canary success"
49+
echo "$(date) - Canary success" | tee -a ${LOGFILE}
50+
51+
rm -rf ${IPFS_PATH}

infrastructure/ansible/provision_canary.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
repo_dir: "{{ canary_dir }}/repo"
77
binary_dir: "{{ canary_dir }}/binary"
88
tasks:
9+
# Must provide limit flag to ensure running against current environment
10+
- fail:
11+
msg: "you must use -l or --limit"
12+
when: ansible_limit is not defined
13+
run_once: true
14+
915
- name: Run common tasks
1016
ansible.builtin.include_tasks: tasks/common_tasks.yaml
1117

infrastructure/ansible/tasks/common_tasks.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- name: "Gather service facts"
2+
become: true
23
ansible.builtin.service_facts:
34

45
- name: "Disable unattended upgrades service"
6+
become: true
57
ansible.builtin.systemd:
68
name: "unattended-upgrades.service"
79
enabled: false
@@ -31,4 +33,6 @@
3133
become: true
3234
ansible.builtin.pip:
3335
name:
36+
- pip
3437
- boto3
38+
- pyopenssl

infrastructure/ansible/tasks/install_plex_tasks.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
become: true
44
ansible.builtin.pip:
55
name:
6-
- pip
7-
- pyopenssl
86
- github3.py
97

8+
- name: Print plex_version if provided
9+
ansible.builtin.debug:
10+
msg: "{{ plex_version }}"
11+
when: plex_version is defined
12+
1013
- name: Get the latest plex release
1114
community.general.github_release:
1215
repo: plex
@@ -17,8 +20,9 @@
1720
- name: Download the latest plex binary
1821
ansible.builtin.get_url:
1922
#https://github.com/labdao/plex/releases/download/v0.7.0/plex_0.7.0_linux_amd64.tar.gz
20-
url: https://github.com/labdao/plex/releases/download/{{ latest_release.tag }}/plex_{{ latest_release.tag | regex_replace('^v([0-9]\.[0-9]\.[0-9])$', '\1') }}_linux_amd64.tar.gz
23+
url: https://github.com/labdao/plex/releases/download/{{ latest_release.tag }}/plex_{{ latest_release.tag | regex_replace('^v([0-9]\.[0-9][0-9]\.[0-9])$', '\1') }}_linux_amd64.tar.gz
2124
dest: /tmp/plex_release.tar.gz
25+
force: true
2226

2327
- name: Unzip the plex release
2428
ansible.builtin.unarchive:

tools/.equibind.json.swp

12 KB
Binary file not shown.

0 commit comments

Comments
 (0)