From 0bf1e59607509c45e97d8b219f851eb40c7daafa Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Tue, 27 Aug 2024 14:59:16 -0300 Subject: [PATCH 1/4] Fix ci cache key --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2eb2a4..c99e474e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} + key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- - name: Startup Nitro testnode From 3552cb84c70ee894c9465874ff2006c028621985 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Wed, 28 Aug 2024 10:37:44 -0300 Subject: [PATCH 2/4] Removes unnecessary scripts build --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 12062b5a..d40484a8 100755 --- a/test-node.bash +++ b/test-node.bash @@ -366,7 +366,7 @@ if $blockscout; then fi if $build_node_images; then - docker compose build --no-rm $NODES scripts + docker compose build --no-rm $NODES fi if $force_init; then From 8916287065d944c13d61ee482ab2008b01361180 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Wed, 28 Aug 2024 10:39:20 -0300 Subject: [PATCH 3/4] Workaround to cache docker layers in CI when using docker-compose --- .github/workflows/testnode.bash | 2 +- docker-compose-ci-cache.json | 37 +++++++++++++++++++++++++++++++++ test-node.bash | 17 ++++++++++++--- 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 docker-compose-ci-cache.json diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index be7e6961..63e5edf3 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -5,7 +5,7 @@ # Start the test node and get PID, to terminate it once send-l2 is done. cd ${GITHUB_WORKSPACE} -./test-node.bash "$@" +./test-node.bash "$@" --ci if [ $? -ne 0 ]; then echo "test-node.bash failed" diff --git a/docker-compose-ci-cache.json b/docker-compose-ci-cache.json new file mode 100644 index 00000000..0fee603d --- /dev/null +++ b/docker-compose-ci-cache.json @@ -0,0 +1,37 @@ +{ + "target": { + "scripts": { + "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 d40484a8..58cb2ef1 100755 --- a/test-node.bash +++ b/test-node.bash @@ -36,6 +36,7 @@ else fi run=true +ci=false validate=false detach=false blockscout=false @@ -107,6 +108,10 @@ while [[ $# -gt 0 ]]; do done fi ;; + --ci) + ci=true + shift + ;; --build) build_dev_nitro=true build_dev_blockscout=true @@ -342,11 +347,17 @@ if $build_utils; then if $tokenbridge || $l3_token_bridge; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" fi - UTILS_NOCACHE="" - if $force_build_utils; then + + if [ "$ci" == true ]; then + # workaround to cache docker layers and keep using docker-compose in CI + docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $LOCAL_BUILD_NODES + else + UTILS_NOCACHE="" + if $force_build_utils; then UTILS_NOCACHE="--no-cache" + fi + docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES fi - docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES fi if $dev_nitro; then From f7ffe6111e01b2870d3f81d959c4f54c8906928b Mon Sep 17 00:00:00 2001 From: spsjvc Date: Tue, 15 Oct 2024 13:24:49 +0200 Subject: [PATCH 4/4] Change geth ref from latest to stable --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f8facecc..c3cbf4cf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -47,7 +47,7 @@ services: - "127.0.0.1:6379:6379" geth: - image: ethereum/client-go:latest + image: ethereum/client-go:stable ports: - "127.0.0.1:8545:8545" - "127.0.0.1:8551:8551"