From 5797d736837b3cc4fc820030ba9119980b2ef1f0 Mon Sep 17 00:00:00 2001 From: rudy Date: Wed, 4 Jan 2023 14:45:31 +0100 Subject: [PATCH] fix(ci): docker build, use --ssh instead of -v --- .github/workflows/continuous-integration.yml | 9 ++------- builders/Dockerfile.concrete-compiler-env | 5 ++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8f6600dc4..410e265bb 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -689,16 +689,11 @@ jobs: - name: Login to Registry run: echo "${{ secrets.GHCR_PASSWORD }}" | docker login -u ${{ secrets.GHCR_LOGIN }} --password-stdin ghcr.io - - name: Set up ssh auth in docker - run: | - echo "SSH_AUTH_SOCK_DIR=$(dirname $SSH_AUTH_SOCK)" >> "${GITHUB_ENV}" - # label was initially a need from the frontend CI - name: Build Image run: | - docker image build --no-cache \ - -v ${{ env.SSH_AUTH_SOCK }}:/ssh.socket \ - -e SSH_AUTH_SOCK=/ssh.socket \ + DOCKER_BUILDKIT=1 docker build --no-cache \ + --ssh default=${{ env.SSH_AUTH_SOCK }} \ --label "commit-sha=${{ github.sha }}" -t ${{ matrix.image }} -f ${{ matrix.dockerfile }} . - name: Tag and Publish Image diff --git a/builders/Dockerfile.concrete-compiler-env b/builders/Dockerfile.concrete-compiler-env index b1fbf2b99..2636d32c6 100644 --- a/builders/Dockerfile.concrete-compiler-env +++ b/builders/Dockerfile.concrete-compiler-env @@ -5,6 +5,9 @@ FROM quay.io/pypa/manylinux_2_28_x86_64:2022-11-19-1b19e81 RUN dnf install -y epel-release RUN dnf update -y RUN dnf install -y ninja-build hwloc-devel ccache clang ncurses-devel +RUN dnf install -y openssh-clients +RUN dnf clean all +RUN mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts # setup ccache with an unlimited amount of files and storage RUN ccache -M 0 RUN ccache -F 0 @@ -38,7 +41,7 @@ COPY /llvm-project /llvm-project COPY /compiler /compiler WORKDIR /compiler RUN mkdir -p /build -RUN make DATAFLOW_EXECUTION_ENABLED=ON BUILD_DIR=/build CCACHE=ON \ +RUN --mount=type=ssh make DATAFLOW_EXECUTION_ENABLED=ON BUILD_DIR=/build CCACHE=ON \ Python3_EXECUTABLE=${PYTHON_EXEC} \ concretecompiler python-bindings rust-bindings ENV PYTHONPATH "$PYTHONPATH:/build/tools/concretelang/python_packages/concretelang_core"