From c820e11d4ab08f66ac864c49618893e7a583e312 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Tue, 27 Aug 2024 19:27:20 -0300 Subject: [PATCH] wip --- .github/workflows/ci.yml | 21 ++++++++++++++++++-- docker-compose-ci-cache.json | 37 ++++++++++++++++++++++++++++++++++++ test-node.bash | 3 ++- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 docker-compose-ci-cache.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eabb8540..74916801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,5 +35,22 @@ jobs: key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- - - name: Startup Nitro testnode - run: ${{ github.workspace }}/.github/workflows/testnode.bash ${{ matrix.pos == true && '--pos' || '' }} + # - 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: Startup Nitro testnode + # run: ${{ github.workspace }}/.github/workflows/testnode.bash ${{ matrix.pos == true && '--pos' || '' }} + + # - # Temp fix + # # https://github.com/docker/build-push-action/issues/252 + # # https://github.com/moby/buildkit/issues/1896 + # name: Move cache + # run: | + # rm -rf /tmp/.buildx-cache + # mv /tmp/.buildx-cache-new /tmp/.buildx-cache 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 af683f3e..04a7c66f 100755 --- a/test-node.bash +++ b/test-node.bash @@ -292,7 +292,8 @@ 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 + ls /tmp/.buildx-cache + docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $LOCAL_BUILD_NODES fi if $dev_build_nitro; then