Skip to content

Commit dd63838

Browse files
authored
[LAB-679] trying to fix compute in docker issue with CI (#703)
1 parent 2958c69 commit dd63838

File tree

5 files changed

+143
-79
lines changed

5 files changed

+143
-79
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,24 @@ jobs:
5353
- name: Test
5454
run: go test ./... -v
5555

56-
# Only downloading cli for linux
57-
ci-setup-compose:
58-
strategy:
59-
matrix:
60-
os: [ubuntu-22.04]
61-
runs-on: ${{ matrix.os }}
62-
environment: ci
63-
steps:
64-
- name: Download docker compose
65-
run: |
66-
# Download docker-compose plugin
67-
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
68-
curl -sSL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 -o docker-compose
69-
elif [[ "$OSTYPE" == "darwin"* ]]; then
70-
curl -sSL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-darwin-aarch64 -o docker-compose
71-
fi
72-
73-
- name: upload docker-compose plugin to be used later
74-
uses: actions/upload-artifact@v3
75-
with:
76-
name: docker-compose-plugin-${{matrix.os}}
77-
path: ./docker-compose
56+
# # Only downloading cli for macos
57+
# ci-setup-compose:
58+
# strategy:
59+
# matrix:
60+
# os: [macos-13]
61+
# runs-on: ${{ matrix.os }}
62+
# environment: ci
63+
# steps:
64+
# - name: Download docker compose
65+
# run: |
66+
# # Download docker-compose plugin
67+
# curl -sSL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-darwin-aarch64 -o docker-compose
68+
69+
# - name: upload docker-compose plugin to be used later
70+
# uses: actions/upload-artifact@v3
71+
# with:
72+
# name: docker-compose-plugin-${{matrix.os}}
73+
# path: ./docker-compose
7874

7975
ci-setup-ipfs:
8076
strategy:
@@ -101,7 +97,7 @@ jobs:
10197
with:
10298
name: ipfs-binary-${{matrix.os}}
10399
path: ./kubo/ipfs
104-
100+
105101
# Download Bacalhau CLI for troubleshooting
106102
ci-setup-bacalhau:
107103
strategy:
@@ -133,7 +129,7 @@ jobs:
133129
ci-public:
134130
needs:
135131
- go
136-
- ci-setup-compose
132+
# - ci-setup-compose
137133
- ci-setup-bacalhau
138134
strategy:
139135
matrix:
@@ -147,6 +143,7 @@ jobs:
147143
env:
148144
# Setting it at workflow level to be used by all the steps
149145
BACALHAU_API_HOST: "127.0.0.1"
146+
LOG_LEVEL: trace
150147
steps:
151148
- name: Checkout code
152149
uses: actions/checkout@v4
@@ -161,12 +158,6 @@ jobs:
161158
with:
162159
name: bacalhau-binary-${{matrix.os}}-${{matrix.bacalhau_version}}
163160

164-
- name: download docker compose plugin artifact
165-
if: runner.os != 'macos'
166-
uses: actions/download-artifact@v3
167-
with:
168-
name: docker-compose-plugin-${{matrix.os}}
169-
170161
- name: Setup docker (missing on MacOS)
171162
if: runner.os == 'macos'
172163
run: |
@@ -185,12 +176,6 @@ jobs:
185176
- name: Setup docker compose plugin
186177
if: runner.os != 'macos'
187178
run: |
188-
# Install docker-compose
189-
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
190-
mkdir -p $DOCKER_CONFIG/cli-plugins
191-
mv docker-compose $DOCKER_CONFIG/cli-plugins/docker-compose
192-
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
193-
194179
# Output version info
195180
docker version
196181
docker compose version
@@ -205,7 +190,7 @@ jobs:
205190
- name: Bring up the stack
206191
run: |
207192
# Setup docker compose
208-
docker compose up -d --wait
193+
docker compose -f docker-compose.yml up -d --wait
209194
env:
210195
NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}
211196

@@ -216,16 +201,28 @@ jobs:
216201
217202
- name: Run Equibind
218203
run: |
219-
# point towards prod env until docker in docker job launcher is fixed
220-
export BACALHAU_API_HOST=bacalhau.prod.labdao.xyz
221-
chmod +x ./bacalhau
204+
# Execute permission
205+
chmod +x ./bacalhau ./plex
206+
207+
# Dump BACALHAU_API_HOST
208+
echo "BACALHAU_API_HOST set to ${BACALHAU_API_HOST}"
209+
210+
# Create bacalhau config file
222211
./bacalhau version
223212
224-
# Add execute permission
225-
chmod +x plex
213+
# Pull equibind image before running the job to get better idea of job run
214+
docker pull $(cat tools/equibind-ci.json | jq -r '.dockerPull')
226215
227-
result_dir=$(./plex init -t tools/equibind.json -i '{"protein": ["testdata/binding/abl/7n9g.pdb"], "small_molecule": ["testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a ci | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')
216+
# Get node list
217+
./bacalhau node list
218+
219+
# Run the job
220+
./plex init -t tools/equibind-ci.json -i '{"protein": ["testdata/binding/abl/7n9g.pdb"], "small_molecule": ["testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a ci | tee -a plex_run_output.log
221+
result_dir=$(cat plex_run_output.log | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')
222+
223+
# chdir for outputs
228224
cd "$result_dir/entry-0/outputs"
225+
229226
if [ "$(find . -name '*docked.sdf' | grep 'docked.sdf')" == "" ]; then
230227
echo "No docked files found"
231228
exit 1
@@ -234,25 +231,13 @@ jobs:
234231
find . -name '*docked.sdf' | grep 'docked.sdf'
235232
fi
236233
237-
# revert back to local host for any other steps
238-
export BACALHAU_API_HOST="127.0.0.1"
239-
240234
- name: Run bacalhau describe
241235
# run always even when
242236
if: always()
243237
run: |
244-
# point towards prod env until docker in docker job launcher is fixed
245-
export BACALHAU_API_HOST=bacalhau.prod.labdao.xyz
246-
247-
# Execute permission
248-
chmod +x ./bacalhau
249-
./bacalhau version
250238
JOB_ID=$(./bacalhau list --output json | jq -r '.[0].State.JobID')
251239
./bacalhau describe ${JOB_ID}
252240
253-
# revert back to local host for any other steps
254-
export BACALHAU_API_HOST="127.0.0.1"
255-
256241
- name: Run Gateway Integration Tests
257242
uses: ./.github/actions/gateway-tests
258243

@@ -262,25 +247,33 @@ jobs:
262247
run: |
263248
docker compose logs
264249
250+
- name: Run docker logs to get additional logs
251+
# run always even when
252+
if: always()
253+
run: |
254+
docker ps -a
255+
for container in $(docker ps -qa); do echo ${container};docker logs ${container};done
256+
265257
- name: upload outputs
266258
# run always even when
267259
if: always()
268260
uses: actions/upload-artifact@v3
269261
with:
270262
name: ci-public-output-${{matrix.os}}-${{matrix.bacalhau_version}}
271263
path: |
264+
plex_run_output.log
272265
job-*
273266
jobs/
274267
275268
ci-private:
276269
needs:
277270
- go
278-
- ci-setup-compose
271+
# - ci-setup-compose
279272
- ci-setup-ipfs
280273
- ci-setup-bacalhau
281274
strategy:
282275
matrix:
283-
os:
276+
os:
284277
- ubuntu-22.04
285278
# - macos-13
286279
bacalhau_version:
@@ -290,6 +283,7 @@ jobs:
290283
env:
291284
# Setting it at workflow level to be used by all the steps
292285
BACALHAU_API_HOST: "127.0.0.1"
286+
LOG_LEVEL: trace
293287
steps:
294288
- name: Checkout code
295289
uses: actions/checkout@v4
@@ -309,12 +303,6 @@ jobs:
309303
with:
310304
name: bacalhau-binary-${{matrix.os}}-${{matrix.bacalhau_version}}
311305

312-
- name: download docker compose plugin artifact
313-
if: runner.os != 'macos'
314-
uses: actions/download-artifact@v3
315-
with:
316-
name: docker-compose-plugin-${{matrix.os}}
317-
318306
- name: Setup docker (missing on MacOS)
319307
if: runner.os == 'macos'
320308
run: |
@@ -333,12 +321,6 @@ jobs:
333321
- name: Setup docker compose plugin
334322
if: runner.os != 'macos'
335323
run: |
336-
# Install docker-compose
337-
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
338-
mkdir -p $DOCKER_CONFIG/cli-plugins
339-
mv docker-compose $DOCKER_CONFIG/cli-plugins/docker-compose
340-
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
341-
342324
# Output version info
343325
docker version
344326
docker compose version
@@ -364,11 +346,23 @@ jobs:
364346
365347
- name: Run Equibind
366348
# turn back on once baclahau docker in docker job launcher is fixed
367-
if: false
368349
run: |
369350
set -x
370-
# Add execute permission
371-
chmod +x plex ipfs
351+
352+
# Execute permission
353+
chmod +x ./bacalhau ./plex ./ipfs
354+
355+
# Dump BACALHAU_API_HOST
356+
echo "BACALHAU_API_HOST set to ${BACALHAU_API_HOST}"
357+
358+
# Create bacalhau config file
359+
./bacalhau version
360+
361+
# Pull equibind image before running the job to get better idea of job run
362+
docker pull $(cat tools/equibind-ci.json | jq -r '.dockerPull')
363+
364+
# Get node list
365+
./bacalhau node list
372366
373367
# Run tests against it
374368
# using temp directory for ipfs stuff
@@ -382,8 +376,12 @@ jobs:
382376
383377
export BACALHAU_SERVE_IPFS_PATH="${IPFS_PATH}"
384378
export BACALHAU_IPFS_SWARM_ADDRESSES="/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWLpoHJCGxxKozRaUK1e1m2ocyVPB9dzbsU2cydujYBCD7"
379+
export BACALHAU_NODE_IPFS_SWARMADDRESSES="/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWLpoHJCGxxKozRaUK1e1m2ocyVPB9dzbsU2cydujYBCD7"
380+
381+
# Run the job
382+
./plex init -t tools/equibind-ci.json -i '{"protein": ["testdata/binding/abl/7n9g.pdb"], "small_molecule": ["testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a ci | tee -a plex_run_output.log
383+
result_dir=$(cat plex_run_output.log | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')
385384
386-
result_dir=$(./plex init -t tools/equibind.json -i '{"protein": ["testdata/binding/abl/7n9g.pdb"], "small_molecule": ["testdata/binding/abl/ZINC000003986735.sdf"]}' --scatteringMethod=dotProduct --autoRun=true -a test -a ci | grep 'Finished processing, results written to' | sed -n 's/^.*Finished processing, results written to //p' | sed 's/\/io.json//')
387385
cd "$result_dir/entry-0/outputs"
388386
ls -ltraR
389387
cat exitCode stderr stderr log.txt || true
@@ -396,12 +394,9 @@ jobs:
396394
fi
397395
398396
- name: Run bacalhau describe
399-
# turn back on once baclahau docker in docker job launcher is fixed
400-
if: false
397+
# run always even when
398+
if: always()
401399
run: |
402-
# Execute permission
403-
chmod +x ./bacalhau
404-
./bacalhau version
405400
JOB_ID=$(./bacalhau list --output json | jq -r '.[0].State.JobID')
406401
./bacalhau describe ${JOB_ID}
407402
@@ -414,12 +409,20 @@ jobs:
414409
run: |
415410
docker compose logs
416411
412+
- name: Run docker logs to get additional logs
413+
# run always even when
414+
if: always()
415+
run: |
416+
docker ps -a
417+
for container in $(docker ps -qa); do echo ${container};docker logs ${container};done
418+
417419
- name: upload outputs
418420
# run always even when
419421
if: always()
420422
uses: actions/upload-artifact@v3
421423
with:
422424
name: ci-private-output-${{matrix.os}}-${{matrix.bacalhau_version}}
423425
path: |
426+
plex_run_output.log
424427
job-*
425428
jobs/

docker-compose.private.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ services:
1919
PRIVATE_IPFS: "true"
2020
LIBP2P_FORCE_PNET: "1"
2121
IPFS_DEBUG: "true"
22+
IPFS_LOGGING: "debug"
2223
volumes:
2324
- privateipfs:/data/ipfs
2425

2526
backend:
2627
environment:
2728
BACALHAU_IPFS_SWARM_ADDRESSES: "/dns4/ipfs/tcp/4001/p2p/12D3KooWLpoHJCGxxKozRaUK1e1m2ocyVPB9dzbsU2cydujYBCD7"
29+
BACALHAU_NODE_IPFS_SWARMADDRESSES: "/dns4/ipfs/tcp/4001/p2p/12D3KooWLpoHJCGxxKozRaUK1e1m2ocyVPB9dzbsU2cydujYBCD7"
2830
IPFS_S3_ENABLED: "false"
2931
IPFS_SWARM_KEY_BASE64: "L2tleS9zd2FybS9wc2svMS4wLjAvCi9iYXNlMTYvCjk0Y2Y4ODFiMDZmZDI5YTgxNDVlMmY2MjNiMmRjNGMwNTU2Y2QxNTIwNWM4YjhjMzg0YWEzOThkY2U4YWFhMzYK"
3032
PRIVATE_IPFS: "true"

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ services:
5454
environment:
5555
LOG_LEVEL: trace
5656
DOCKER_DEFAULT_PLATFORM: linux/amd64
57+
# Keep containers around - I think
58+
KEEP_STACK: "true"
59+
BACALHAU_DIR: /tmp/bacalhau
5760
volumes:
5861
- /var/run/docker.sock:/var/run/docker.sock
5962
- /tmp:/tmp
@@ -168,8 +171,10 @@ services:
168171
condition: service_healthy
169172

170173
ipfs:
171-
image: "ipfs/kubo"
174+
image: "ipfs/kubo:v0.18.0"
172175
hostname: ipfs
176+
environment:
177+
IPFS_LOGGING: "debug"
173178
volumes:
174179
- ipfs:/data/ipfs
175180
ports:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "${IPFS_DEBUG}" == "true" ]; then
5+
set -x
6+
fi
7+
8+
if [ -n "${IPFS_GATEWAY_PORT}" ]; then
9+
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/"${IPFS_GATEWAY_PORT}"
10+
fi

0 commit comments

Comments
 (0)