Skip to content

Commit

Permalink
Fix docker launch script
Browse files Browse the repository at this point in the history
* Fix docker startup
- pull-start - perform docker-compose "pull" before doing "start"
  (default for "runall)
- bundler-waiter: wait long (10 seconds, with delays) for bundler to
start.
* add skip cache flag.
* pull,stat,run
* build cache: add contracts to cache ID
* fix "bundler aborted" hangup
(bundler-waiter would wait forever, instead of timeout)
* dump images, ids to action logs
  • Loading branch information
drortirosh authored Dec 6, 2023
1 parent 113297a commit 3786fe1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ on:
description: 'skip test - check github update'
required: false
type: boolean

ignore_cache:
description: 'ignore cache'
required: false
type: boolean
# push:
# branches:
# - '*'
Expand Down Expand Up @@ -69,9 +74,10 @@ jobs:

# restore cache of bundler-spec-tests, and its submodules
- uses: actions/cache@v3
if: ${{ ! inputs.ignore_cache }}
with:
path: bundler-spec-tests
key: ${{ runner.os }}-${{ hashFiles('bundler-spec-tests/pdm.lock') }}
key: ${{ runner.os }}-${{ hashFiles('bundler-spec-tests/pdm.lock', 'bundler-spec-tests/@account-abstraction/contracts/**/*.sol') }}

- run: cd bundler-spec-tests; git checkout
name: "re-checkout bundler-spec-tests (on top of cache)"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build/
/bundler-spec-tests/
/out-results/
.DS_Store
9 changes: 7 additions & 2 deletions runall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ name=`sed -ne 's/ *NAME=[ "]*\([^"]*\)"*/\1/p' $bundler`

test -z $name && name=$basename

echo "Running bundler $bundler, name=$name" > $outraw
if $root/runbundler/runbundler.sh $bundler start; then
echo "`date`: starting bundler $bundler, name=$name" | tee -a $outraw
if $root/runbundler/runbundler.sh $bundler pull-start; then

echo "`date`: started bundler $bundler, name=$name" | tee -a $outraw

case "$bunder" in
*yml) PYTEST_FOLDER=`getEnv $root/runbundler/runbundler.env PYTEST_FOLDER tests/single` ;;
Expand All @@ -77,6 +79,9 @@ if $root/runbundler/runbundler.sh $bundler start; then

fi

echo "`date`: done bundler $bundler, name=$name" | tee -a $outraw
$root/runbundler/runbundler.sh $bundler images | tee -a $outraw

$root/runbundler/runbundler.sh $bundler logs -t > $outlogs
$root/runbundler/runbundler.sh $bundler down

Expand Down
4 changes: 2 additions & 2 deletions runbundler/run2bundlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ services:
depends_on:
bundler:
condition: service_started
restart: on-failure:5
restart: on-failure:10

bundler-waiter2:
image: ghcr.io/foundry-rs/foundry:latest
Expand All @@ -69,7 +69,7 @@ services:
depends_on:
bundler2:
condition: service_started
restart: on-failure:5
restart: on-failure:10

wait-all:
image: ghcr.io/foundry-rs/foundry:latest
Expand Down
1 change: 1 addition & 0 deletions runbundler/runbundler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ cmd=$cmd
case "$cmd" in

start) $DC run --rm wait-all ;;
pull-start) $DC pull --quiet && $DC config|grep image && $DC run --rm wait-all ;;
down) $DC down -t 1 ;;
stop) $DC stop -t 1 ;;
#execute misc docker-compose command
Expand Down
11 changes: 7 additions & 4 deletions runbundler/runbundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ services:
bundler-waiter:
image: ghcr.io/foundry-rs/foundry:latest
command:
- "cast rpc eth_chainId -r $BUNDLER_URL"
- "sleep 2; cast rpc eth_chainId -r $BUNDLER_URL"
depends_on:
bundler:
condition: service_started
restart: on-failure:5
#not depending on bundler: if bundler process aborts, this "waiter" would hang forever..
deployer:
condition: service_completed_successfully
restart: on-failure:10

wait-all:
image: ghcr.io/foundry-rs/foundry:latest
command: echo started
depends_on:
bundler:
condition: service_started
bundler-waiter:
condition: service_completed_successfully

Expand Down

0 comments on commit 3786fe1

Please sign in to comment.