diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a37806c1..3f4e9133 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -35,61 +35,18 @@ jobs: sed -i 's/ishocon2-bench/${{ env.UNAME }}\/ishocon2-bench/g' ./docker-compose.yml sed -i 's/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/${{ env.UNAME }}\/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/g' ./docker-compose.yml cat ./docker-compose.yml - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ env.UNAME }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Cache docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-${{ matrix.language }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx-${{ matrix.language }} - ${{ runner.os }}-buildx - - name: Build bench image - uses: docker/build-push-action@v5 - with: - context: . - file: ./docker/benchmarker/Dockerfile - tags: ${{ env.UNAME }}/ishocon2-bench:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - platforms: linux/amd64,linux/arm64/v8 - - name: Build base image - uses: docker/build-push-action@v5 - with: - context: . - file: ./docker/app/base/Dockerfile - tags: ${{ env.UNAME }}/ishocon2-app-base:latest,ishocon2-app-base:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - platforms: linux/amd64,linux/arm64/v8 - - name: Build app image - uses: docker/build-push-action@v5 - with: - context: . - file: ./docker/app/${{ env.ISHOCON_APP_LANG }}/Dockerfile - tags: ${{ env.UNAME }}/ishocon2-app-${{ env.ISHOCON_APP_LANG }}:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - platforms: linux/amd64,linux/arm64/v8 + - name: Build images + run: | + make pull || true + make build + timeout-minutes: 20 - run: make up bench-with-db-init timeout-minutes: 10 - name: Dump docker logs uses: jwalton/gh-docker-logs@v2 if: ${{ always() }} - - name: Move new cache to the place where to be cached - run: | - echo "Temporary fix for cleaning up old cache." - echo "See isssues: - - https://github.com/docker/build-push-action/issues/252 - - https://github.com/moby/buildkit/issues/1896 - " - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/Makefile b/Makefile index 2332e6da..14d7e358 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ build-bench: build-app: change-lang build-base ISHOCON_APP_LANG=$(ISHOCON_APP_LANG:python) + BASE_IMAGE ?= $(LOCAL_ISHOCON_BASE_IMAGE) docker build \ + -arg BASE_IMAGE=$(BASE_IMAGE) \ -f ./docker/app/$(ISHOCON_APP_LANG)/Dockerfile \ -t ishocon2-app-$(ISHOCON_APP_LANG):latest \ -t $(UNAME)/ishocon2-app-$(ISHOCON_APP_LANG):latest \