diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eabb854..52367a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,5 +35,17 @@ jobs: key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- + # - name: ls1 + # run: ls /tmp/.buildx-cache + + # - name: Build + # run: docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json scripts + # + # - name: ls2 + # run: ls /tmp/.buildx-cache + # + # - name: up + # run: docker compose up scripts + - name: Startup Nitro testnode run: ${{ github.workspace }}/.github/workflows/testnode.bash ${{ matrix.pos == true && '--pos' || '' }} diff --git a/docker-compose-ci-cache.json b/docker-compose-ci-cache.json new file mode 100644 index 0000000..dd28aa0 --- /dev/null +++ b/docker-compose-ci-cache.json @@ -0,0 +1,246 @@ +{ + "target": { + "blockscout": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "postgres": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "redis": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "geth": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "create_beacon_chain_genesis": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "prysm_beacon_chain": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "prysm_validator": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "sequencer": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "sequencer_b": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "sequencer_c": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "sequencer_d": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "staker-unsafe": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "poster": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "poster_b": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "poster_c": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "validator": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "l3node": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "validation_node": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "scripts": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "relay": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "rollupcreator": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + }, + "tokenbridge": { + "cache-from": [ + "type=local,src=/tmp/.buildx-cache" + ], + "cache-to": [ + "type=local,dest=/tmp/.buildx-cache,mode=max" + ], + "output": [ + "type=docker" + ] + } + } +} diff --git a/test-node.bash b/test-node.bash index af683f3..03344ac 100755 --- a/test-node.bash +++ b/test-node.bash @@ -292,7 +292,7 @@ if $force_build; then if $tokenbridge || $l3_token_bridge; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" fi - docker compose build --no-rm $LOCAL_BUILD_NODES + docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $LOCAL_BUILD_NODES fi if $dev_build_nitro; then @@ -314,7 +314,7 @@ else fi if $force_build; then - docker compose build --no-rm $NODES scripts + docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $NODES scripts fi if $force_init; then