From ab1b46f50181b2ff24ec77ba46f2d6105dfd3d9d Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 11 Dec 2023 13:58:48 +0000 Subject: [PATCH 1/4] Debug docker build --- .github/workflows/update_docker_ci.yml | 17 +++++++++++------ docker/ci/dockerfile | 14 +++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update_docker_ci.yml b/.github/workflows/update_docker_ci.yml index 61c5a91bf..51bfdc368 100644 --- a/.github/workflows/update_docker_ci.yml +++ b/.github/workflows/update_docker_ci.yml @@ -5,6 +5,11 @@ on: paths: - 'docker/ci/**' workflow_dispatch: + pull_request: + branches: [develop] + paths: + - 'docker/ci/**' + - .github/workflows/update_docker_ci.yml jobs: build: @@ -16,11 +21,11 @@ jobs: env: DOCKERHUB_REPO: rippleci steps: - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PW }} + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USER }} + # password: ${{ secrets.DOCKERHUB_PW }} - uses: actions/checkout@v4 @@ -31,6 +36,6 @@ jobs: docker build . -t clio_ci --progress=plain --platform=${{ matrix.target_platform }} for tag in "$GITHUB_SHA" "latest" ; do docker tag clio_ci ${DOCKERHUB_REPO}/clio_ci:${tag} - docker push ${DOCKERHUB_REPO}/clio_ci:${tag} + # docker push ${DOCKERHUB_REPO}/clio_ci:${tag} done diff --git a/docker/ci/dockerfile b/docker/ci/dockerfile index 4ed86de7c..e95fff064 100644 --- a/docker/ci/dockerfile +++ b/docker/ci/dockerfile @@ -10,13 +10,13 @@ ENV GCC_VERSION=11 \ GH_VERSION=2.40.0 # Add repositories -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends --no-install-suggests gnupg wget curl software-properties-common \ - && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ - && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \ - && apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' \ - && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${LLVM_TOOLS_VERSION} main" >> /etc/apt/sources.list \ - && wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - +RUN apt-get -qq update +RUN apt-get -qq install -y --no-install-recommends --no-install-suggests gnupg wget curl software-properties-common +RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - +RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' +RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${LLVM_TOOLS_VERSION} main" >> /etc/apt/sources.list +RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add # Install packages RUN apt update -qq \ From 6642e5908a5d110ec665601f63228f3eff41a3fa Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 11 Dec 2023 15:10:03 +0000 Subject: [PATCH 2/4] Update docker image build workflow --- .github/workflows/update_docker_ci.yml | 33 ++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update_docker_ci.yml b/.github/workflows/update_docker_ci.yml index 51bfdc368..f5ebb9dd8 100644 --- a/.github/workflows/update_docker_ci.yml +++ b/.github/workflows/update_docker_ci.yml @@ -4,6 +4,7 @@ on: branches: [develop] paths: - 'docker/ci/**' + - .github/workflows/update_docker_ci.yml workflow_dispatch: pull_request: branches: [develop] @@ -12,14 +13,9 @@ on: - .github/workflows/update_docker_ci.yml jobs: - build: - strategy: - matrix: - target_platform: [linux/amd64, linux/arm64] + build_and_push: name: Build and push docker image runs-on: ubuntu-20.04 - env: - DOCKERHUB_REPO: rippleci steps: # - name: Login to DockerHub # uses: docker/login-action@v3 @@ -28,14 +24,21 @@ jobs: # password: ${{ secrets.DOCKERHUB_PW }} - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/metadata-action@v5 + id: meta + with: + images: rippleci/clio_ci + tags: | + type=raw,value=latest + type=raw,value=${{ env.GITHUB_SHA }} - - name: Build image - shell: bash - run: | - cd docker/ci - docker build . -t clio_ci --progress=plain --platform=${{ matrix.target_platform }} - for tag in "$GITHUB_SHA" "latest" ; do - docker tag clio_ci ${DOCKERHUB_REPO}/clio_ci:${tag} - # docker push ${DOCKERHUB_REPO}/clio_ci:${tag} - done + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ${{ github.workspace }}/docker/ci + platforms: linux/amd64,linux/arm64 + push: false + tags: ${{ steps.meta.outputs.tags }} From e233b4af19edd2205524ccca74a7ba14fd54d36a Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 11 Dec 2023 15:10:40 +0000 Subject: [PATCH 3/4] Revert debug changes in dockerfile --- docker/ci/dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/ci/dockerfile b/docker/ci/dockerfile index e95fff064..4ed86de7c 100644 --- a/docker/ci/dockerfile +++ b/docker/ci/dockerfile @@ -10,13 +10,13 @@ ENV GCC_VERSION=11 \ GH_VERSION=2.40.0 # Add repositories -RUN apt-get -qq update -RUN apt-get -qq install -y --no-install-recommends --no-install-suggests gnupg wget curl software-properties-common -RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - -RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' -RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${LLVM_TOOLS_VERSION} main" >> /etc/apt/sources.list -RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends --no-install-suggests gnupg wget curl software-properties-common \ + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ + && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \ + && apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' \ + && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${LLVM_TOOLS_VERSION} main" >> /etc/apt/sources.list \ + && wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - # Install packages RUN apt update -qq \ From e01de6e5a0a74ea11186bd2babf0c04d2f43ef3f Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 11 Dec 2023 15:56:54 +0000 Subject: [PATCH 4/4] Turn on push to docker hub --- .github/workflows/update_docker_ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update_docker_ci.yml b/.github/workflows/update_docker_ci.yml index f5ebb9dd8..f9e895c31 100644 --- a/.github/workflows/update_docker_ci.yml +++ b/.github/workflows/update_docker_ci.yml @@ -6,22 +6,17 @@ on: - 'docker/ci/**' - .github/workflows/update_docker_ci.yml workflow_dispatch: - pull_request: - branches: [develop] - paths: - - 'docker/ci/**' - - .github/workflows/update_docker_ci.yml jobs: build_and_push: name: Build and push docker image runs-on: ubuntu-20.04 steps: - # - name: Login to DockerHub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USER }} - # password: ${{ secrets.DOCKERHUB_PW }} + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PW }} - uses: actions/checkout@v4 - uses: docker/setup-qemu-action@v3 @@ -39,6 +34,6 @@ jobs: with: context: ${{ github.workspace }}/docker/ci platforms: linux/amd64,linux/arm64 - push: false + push: true tags: ${{ steps.meta.outputs.tags }}