Skip to content

Commit 46bb1e5

Browse files
alabdaothetechnocrat-dev
andauthored
[LAB-630] bacalhau 1.1.0 compose (#693)
Co-authored-by: thetechnocrat-dev <josh.mcmenemy@openzyme.bio>
1 parent 563e3d4 commit 46bb1e5

5 files changed

Lines changed: 220 additions & 39 deletions

File tree

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: 'Gateway Tests'
2+
description: 'Tests that gateway features work'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Test healthcheck endpoint
7+
run: |
8+
response=$(curl --silent http://localhost:8080/healthcheck)
9+
if [[ "$response" != "Healthy" ]]; then
10+
echo "Test 1 failed: Expected 'Healthy' but got '$response'"
11+
exit 1
12+
else
13+
echo "Gateway Healthcheck passed"
14+
fi
15+
shell: bash
16+
17+
- name: Test add Datafile endpoint
18+
run: |
19+
# upload first file
20+
response=$(curl --silent -X POST \
21+
-F "file=@testdata/binding/abl/7n9g.pdb;filename=7n9g.pdb" \
22+
-F "filename=7n9g.pdb" \
23+
-F "wallet_address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" \
24+
http://localhost:8080/datafiles)
25+
if echo "$response" | jq -e '.cid' > /dev/null; then
26+
echo "File upload test passed"
27+
else
28+
echo "File upload test failed: 'cid' key not found in the response"
29+
exit 1
30+
fi
31+
32+
# upload second file
33+
response=$(curl --silent -X POST \
34+
-F "file=@testdata/binding/abl/ZINC000003986735.sdf;filename=ZINC000003986735.sdf" \
35+
-F "filename=ZINC000003986735.sdf" \
36+
-F "wallet_address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" \
37+
http://localhost:8080/datafiles)
38+
if echo "$response" | jq -e '.cid' > /dev/null; then
39+
echo "File upload test passed"
40+
else
41+
echo "File upload test failed: 'cid' key not found in the response"
42+
exit 1
43+
fi
44+
shell: bash
45+
46+
- name: Test List Datafiles Endpoint
47+
run: |
48+
response=$(curl --silent http://localhost:8080/datafiles)
49+
length=$(echo "$response" | jq 'length')
50+
51+
if [ "$length" -eq 2 ]; then
52+
echo "Datafiles test passed"
53+
else
54+
echo "Datafiles test failed: Expected length of 2 but got '$length'"
55+
exit 1
56+
fi
57+
shell: bash
58+
59+
- name: Test add Tool Endpoint
60+
run: |
61+
TOOL_JSON_CONTENT=$(jq -c . < tools/equibind.json)
62+
json_payload="{\"toolJson\": $TOOL_JSON_CONTENT, \"walletAddress\": \"0xab5801a7d398351b8be11c439e05c5b3259aec9b\"}"
63+
response=$(curl -s -X POST "http://localhost:8080/tools" \
64+
-H "Content-Type: application/json" \
65+
-d "$json_payload")
66+
67+
cid_value=$(echo "$response" | jq -r '.cid')
68+
69+
if [ "$cid_value" == "QmTFMb527A3VDCmVNwC1d6yCM3eUdvLwHsEXwtRULeczZ2" ]; then
70+
echo "Add Tool upload test passed"
71+
else
72+
echo "Add Tool upload test failed: Expected 'QmTFMb527A3VDCmVNwC1d6yCM3eUdvLwHsEXwtRULeczZ2' but got '$cid_value'"
73+
exit 1
74+
fi
75+
shell: bash
76+
77+
- name: Test list Tools Endpoint
78+
run: |
79+
response=$(curl --silent http://localhost:8080/tools)
80+
length=$(echo "$response" | jq 'length')
81+
82+
if [ "$length" -eq 1 ]; then
83+
echo "List Tools test passed"
84+
else
85+
echo "List Tools test failed: Expected length of 1 but got '$length'"
86+
exit 1
87+
fi
88+
shell: bash
89+
90+
- name: Test Add Flow Endpoint
91+
run: |
92+
payload='{
93+
"name": "testFlow",
94+
"walletAddress": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
95+
"toolCid": "QmTFMb527A3VDCmVNwC1d6yCM3eUdvLwHsEXwtRULeczZ2",
96+
"scatteringMethod": "dotProduct",
97+
"kwargs": {
98+
"protein": ["QmUWCBTqbRaKkPXQ3M14NkUuM4TEwfhVfrqLNoBB7syyyd/7n9g.pdb"],
99+
"small_molecule": ["QmV6qVzdQLNM6SyEDB3rJ5R5BYJsQwQTn1fjmPzvCCkCYz/ZINC000003986735.sdf"]
100+
}
101+
}'
102+
103+
response=$(curl -s -X POST "http://localhost:8080/flows" \
104+
-H "Content-Type: application/json" \
105+
-d "$payload")
106+
107+
# Extract the CID from the response
108+
cid_value=$(echo "$response" | jq -r '.cid')
109+
110+
# Check if the CID exists
111+
if [[ ! -z "$cid_value" && "$cid_value" != "null" ]]; then
112+
echo "Create Flow test passed"
113+
else
114+
echo "Create Flow test failed: CID not found in the response"
115+
exit 1
116+
fi
117+
shell: bash

.github/workflows/ci.yml

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,24 @@ jobs:
103103
strategy:
104104
matrix:
105105
os: [ubuntu-22.04]
106+
bacalhau_version: [1.0.3, 1.1.0]
106107
runs-on: ${{ matrix.os }}
107108
environment: ci
108109
steps:
109110
- name: Download bacalhau
110111
run: |
111112
# Download bacalhau plugin
112113
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
113-
curl -sSL https://github.com/bacalhau-project/bacalhau/releases/download/v1.0.3/bacalhau_v1.0.3_linux_amd64.tar.gz -o bacalhau.tgz
114+
curl -sSL https://github.com/bacalhau-project/bacalhau/releases/download/v${{ matrix.bacalhau_version }}/bacalhau_v${{ matrix.bacalhau_version }}_linux_amd64.tar.gz -o bacalhau.tgz
114115
elif [[ "$OSTYPE" == "darwin"* ]]; then
115-
curl -sSL https://github.com/bacalhau-project/bacalhau/releases/download/v1.0.3/bacalhau_v1.0.3_darwin_arm64.tar.gz -o bacalhau.tgz
116+
curl -sSL https://github.com/bacalhau-project/bacalhau/releases/download/v${{ matrix.bacalhau_version }}/bacalhau_v${{ matrix.bacalhau_version }}_darwin_arm64.tar.gz -o bacalhau.tgz
116117
fi
117118
tar -zxvf bacalhau.tgz
118119
119120
- name: upload bacalhau plugin to be used later
120121
uses: actions/upload-artifact@v3
121122
with:
122-
name: bacalhau-binary-${{matrix.os}}
123+
name: bacalhau-binary-${{matrix.os}}-${{matrix.bacalhau_version}}
123124
path: ./bacalhau
124125

125126
ci-public:
@@ -130,6 +131,7 @@ jobs:
130131
strategy:
131132
matrix:
132133
os: [ubuntu-22.04] # , macos-13]
134+
bacalhau_version: [1.0.3, 1.1.0]
133135
runs-on: ${{ matrix.os }}
134136
environment: ci
135137
env:
@@ -148,7 +150,7 @@ jobs:
148150
- name: download bacalhau binary
149151
uses: actions/download-artifact@v3
150152
with:
151-
name: bacalhau-binary-${{matrix.os}}
153+
name: bacalhau-binary-${{matrix.os}}-${{matrix.bacalhau_version}}
152154

153155
- name: download docker compose plugin artifact
154156
if: runner.os != 'macos'
@@ -192,13 +194,24 @@ jobs:
192194
NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}
193195

194196
- name: Bring up the stack
197+
if: matrix.bacalhau_version == '1.0.3'
195198
run: |
196-
# Setup docker compose private
199+
# Setup docker compose
197200
docker compose up -d --wait
201+
202+
- name: Bring up the stack
203+
if: matrix.bacalhau_version == '1.1.0'
204+
run: |
205+
# Setup docker compose 1.1.0
206+
docker compose -f docker-compose.yml -f docker-compose.1.1.0.yml up -d --wait
207+
208+
- name: Run docker compose ps
209+
run: |
198210
# Inspect number of running containers
199211
docker compose ps
200212
201213
- name: Run Equibind
214+
if: matrix.bacalhau_version == '1.0.3'
202215
run: |
203216
# Add execute permission
204217
chmod +x plex
@@ -213,27 +226,31 @@ jobs:
213226
find . -name '*docked.sdf' | grep 'docked.sdf'
214227
fi
215228
216-
- name: Run docker compose logs
217-
# run always even when
218-
if: always()
219-
run: |
220-
docker compose logs
221-
222229
- name: Run bacalhau describe
230+
if: matrix.bacalhau_version == '1.0.3'
223231
# run always even when
224-
if: always()
225232
run: |
226233
# Execute permission
227234
chmod +x ./bacalhau
235+
./bacalhau version
228236
JOB_ID=$(./bacalhau list --output json | jq -r '.[0].State.JobID')
229237
./bacalhau describe ${JOB_ID}
230238
239+
- name: Run Gateway Integration Tests
240+
uses: ./.github/actions/gateway-tests
241+
242+
- name: Run docker compose logs
243+
# run always even when
244+
if: always()
245+
run: |
246+
docker compose logs
247+
231248
- name: upload outputs
232249
# run always even when
233250
if: always()
234251
uses: actions/upload-artifact@v3
235252
with:
236-
name: ci-public-output-${{matrix.os}}
253+
name: ci-public-output-${{matrix.os}}-${{matrix.bacalhau_version}}
237254
path: |
238255
job-*
239256
jobs/
@@ -247,12 +264,13 @@ jobs:
247264
strategy:
248265
matrix:
249266
os: [ubuntu-22.04] # , macos-13]
267+
bacalhau_version: [1.0.3, 1.1.0]
250268
runs-on: ${{ matrix.os }}
251269
environment: ci
252270
env:
253271
# Setting it at workflow level to be used by all the steps
254272
BACALHAU_API_HOST: "127.0.0.1"
255-
NEXT_PUBLIC_PRIVY_APP_ID: "{{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}"
273+
NEXT_PUBLIC_PRIVY_APP_ID: "${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}"
256274
steps:
257275
- name: Checkout code
258276
uses: actions/checkout@v4
@@ -270,7 +288,7 @@ jobs:
270288
- name: download bacalhau binary
271289
uses: actions/download-artifact@v3
272290
with:
273-
name: bacalhau-binary-${{matrix.os}}
291+
name: bacalhau-binary-${{matrix.os}}-${{matrix.bacalhau_version}}
274292

275293
- name: download docker compose plugin artifact
276294
if: runner.os != 'macos'
@@ -314,13 +332,24 @@ jobs:
314332
NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}
315333

316334
- name: Bring up the stack
335+
if: matrix.bacalhau_version == '1.0.3'
317336
run: |
318337
# Setup docker compose private
319338
docker compose -f docker-compose.yml -f docker-compose.private.yml up -d --wait
339+
340+
- name: Bring up the stack
341+
if: matrix.bacalhau_version == '1.1.0'
342+
run: |
343+
# Setup docker compose private
344+
docker compose -f docker-compose.yml -f docker-compose.1.1.0.yml -f docker-compose.private.yml up -d --wait
345+
346+
- name: Run docker compose ps
347+
run: |
320348
# Inspect number of running containers
321349
docker compose ps
322350
323351
- name: Run Equibind
352+
if: matrix.bacalhau_version == '1.0.3'
324353
run: |
325354
set -x
326355
# Add execute permission
@@ -351,27 +380,30 @@ jobs:
351380
find . -name '*docked.sdf' | grep 'docked.sdf'
352381
fi
353382
354-
- name: Run docker compose logs
355-
# run always even when
356-
if: always()
357-
run: |
358-
docker compose logs
359-
360383
- name: Run bacalhau describe
361-
# run always even when
362-
if: always()
384+
if: matrix.bacalhau_version == '1.0.3'
363385
run: |
364386
# Execute permission
365387
chmod +x ./bacalhau
388+
./bacalhau version
366389
JOB_ID=$(./bacalhau list --output json | jq -r '.[0].State.JobID')
367390
./bacalhau describe ${JOB_ID}
368391
392+
- name: Run Gateway Integration Tests
393+
uses: ./.github/actions/gateway-tests
394+
395+
- name: Run docker compose logs
396+
# run always even when
397+
if: always()
398+
run: |
399+
docker compose logs
400+
369401
- name: upload outputs
370402
# run always even when
371403
if: always()
372404
uses: actions/upload-artifact@v3
373405
with:
374-
name: ci-private-output-${{matrix.os}}
406+
name: ci-private-output-${{matrix.os}}-${{matrix.bacalhau_version}}
375407
path: |
376408
job-*
377409
jobs/

docker-compose.1.1.0.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
3+
version: "3.7"
4+
5+
services:
6+
# sidecar container for setting up required key material
7+
requester_setup:
8+
image: "alpine"
9+
command: >
10+
sh -c '
11+
mkdir -p /home/nonroot/.bacalhau &&
12+
echo CAASqAkwggSkAgEAAoIBAQDQubr6zD3DLEQ07K2wPUQEFfVQLfqTQihc8lQOWuihElXcqZJLajK4od5zc+nCQ/jyUmrmOsYd7aKBmXfyTwOBwCaXEpqqxlP+Pal/Ruh+Ptpfl11KP4sHg3P5sYM/bMRJrEtg1k3mbaToioH5I9GrH7zv5LDHUSezbYFCJ4ZyakUgal+GXPx+TpbdhIx93pZXPHzxgd/m1rbSyiR7sUqXAokzKf2Qv1sOnGrHHcKy8DiSrXo+YUyDRC3lQKwaSfyrBFq1BLqE+E383zYIc5yhcV3kSGivQ2v9o67j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SwKB55JK/zgVWkZ5a/sdD0CaT/MQKBgA7CMHQIjXl8FqATmBgiejGV6BnbUHko4m0Ab7fQUZY1qlgKrqcXgFmMQkb+p8Og1YeVn8Qy8xuvueAfwemA8OxvLuQNzQcA2qhGZID4Tu2Ng+XIkNxMj1gJelppqVeDnZSFr3TbZcSXIVhk1idAnpGDilS8cOO6LUY/hH/IVGGe > /home/nonroot/.bacalhau/libp2p_private_key &&
13+
chown -R 65532:65532 /home/nonroot/'
14+
15+
requester:
16+
image: "ghcr.io/bacalhau-project/bacalhau:v1.1.0"
17+
18+
# sidecar container for requester healthcheck
19+
requester_health:
20+
healthcheck:
21+
test: curl -f http://requester:1234/api/v1/healthz
22+
interval: 10s
23+
timeout: 10s
24+
retries: 10
25+
start_period: 10s
26+
27+
compute:
28+
image: "ghcr.io/bacalhau-project/bacalhau:v1.1.0"
29+
30+
# sidecar container for compute healthcheck
31+
compute_health:
32+
healthcheck:
33+
test: curl -f http://requester:1234/api/v1/healthz
34+
interval: 10s
35+
timeout: 10s
36+
retries: 10
37+
start_period: 10s

0 commit comments

Comments
 (0)