From 58bd2f76d0819c7147684cb10f994480545ee769 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 3 Oct 2022 23:09:25 +0000 Subject: [PATCH] Ensure protoc is installed for release CI (#3621) ## Issue Addressed The release CI is currently broken due to the addition of the `protoc` dependency. Here's a failure of the release flow running on my fork: https://github.com/michaelsproul/lighthouse/actions/runs/3155541478/jobs/5134317334 ## Proposed Changes - Install `protoc` on Windows and Mac so that it's available for `cargo install`. - Install an x86_64 binary in the Cross image for the aarch64 platform: we need a binary that runs on the host, _not_ on the target. - Fix `macos` local testnet CI by using the Github API key to dodge rate limiting (this issue: https://github.com/actions/runner-images/issues/602). --- .github/workflows/local-testnet.yml | 2 ++ .github/workflows/release.yml | 9 +++++++++ Cross.toml | 4 ++-- lcli/Dockerfile | 2 +- ..._64-unknown-linux-gnu.dockerfile => Dockerfile} | 0 scripts/cross/aarch64-unknown-linux-gnu.dockerfile | 14 -------------- 6 files changed, 14 insertions(+), 17 deletions(-) rename scripts/cross/{x86_64-unknown-linux-gnu.dockerfile => Dockerfile} (100%) delete mode 100644 scripts/cross/aarch64-unknown-linux-gnu.dockerfile diff --git a/.github/workflows/local-testnet.yml b/.github/workflows/local-testnet.yml index c688c0df3..170bd9e21 100644 --- a/.github/workflows/local-testnet.yml +++ b/.github/workflows/local-testnet.yml @@ -22,6 +22,8 @@ jobs: run: rustup update stable - name: Install Protoc uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install ganache run: npm install ganache@latest --global diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 158cbaa08..6edb1f76c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,15 @@ jobs: if: startsWith(matrix.arch, 'x86_64-windows') run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV + # ============================== + # Windows & Mac dependencies + # ============================== + - name: Install Protoc + if: contains(matrix.arch, 'darwin') || contains(matrix.arch, 'windows') + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # ============================== # Builds # ============================== diff --git a/Cross.toml b/Cross.toml index 963e22d0e..9c3e441cb 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,5 +1,5 @@ [target.x86_64-unknown-linux-gnu] -dockerfile = './scripts/cross/x86_64-unknown-linux-gnu.dockerfile' +dockerfile = './scripts/cross/Dockerfile' [target.aarch64-unknown-linux-gnu] -dockerfile = './scripts/cross/aarch64-unknown-linux-gnu.dockerfile' +dockerfile = './scripts/cross/Dockerfile' diff --git a/lcli/Dockerfile b/lcli/Dockerfile index 8fd3567cd..1129e710f 100644 --- a/lcli/Dockerfile +++ b/lcli/Dockerfile @@ -2,7 +2,7 @@ # - from the `lighthouse` dir with the command: `docker build -f ./lcli/Dockerflie .` # - from the current directory with the command: `docker build -f ./Dockerfile ../` FROM rust:1.62.1-bullseye AS builder -RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev +RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev protobuf-compiler COPY . lighthouse ARG PORTABLE ENV PORTABLE $PORTABLE diff --git a/scripts/cross/x86_64-unknown-linux-gnu.dockerfile b/scripts/cross/Dockerfile similarity index 100% rename from scripts/cross/x86_64-unknown-linux-gnu.dockerfile rename to scripts/cross/Dockerfile diff --git a/scripts/cross/aarch64-unknown-linux-gnu.dockerfile b/scripts/cross/aarch64-unknown-linux-gnu.dockerfile deleted file mode 100644 index 691639cd4..000000000 --- a/scripts/cross/aarch64-unknown-linux-gnu.dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG CROSS_BASE_IMAGE -FROM $CROSS_BASE_IMAGE - -RUN apt-get update -y && apt-get upgrade -y - -RUN apt-get install -y unzip && \ - PB_REL="https://github.com/protocolbuffers/protobuf/releases" && \ - curl -L $PB_REL/download/v3.15.8/protoc-3.15.8-linux-aarch_64.zip -o protoc.zip && \ - unzip protoc.zip -d /usr && \ - chmod +x /usr/bin/protoc - -RUN apt-get install -y cmake clang-3.9 - -ENV PROTOC=/usr/bin/protoc