From 83c41a246f6ceb71859515ca9a06c58e689c084d Mon Sep 17 00:00:00 2001 From: strasdat Date: Fri, 10 Nov 2023 23:33:28 +0000 Subject: [PATCH] exp: adding arm64 linux runner / release --- .github/workflows/ci.yml | 4 ++- .github/workflows/release.yml | 28 +++++++++++++++------ cmake/External_grpc.cmake | 2 +- scripts/build_venv/build_venv.sh | 2 +- scripts/download_release.sh | 9 ++++++- scripts/install_deps_ubuntu2204.sh | 40 ++++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 11 deletions(-) create mode 100755 scripts/install_deps_ubuntu2204.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42242687..9544a89a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,9 @@ jobs: with: submodules: "recursive" - name: ccache - uses: hendrikmuhs/ccache-action@v1 + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.compiler }} - ${{ matrix.os }} - asan_ ${{ matrix.asan }} - name: Install dependencies (Ubuntu) working-directory: ./scripts run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 798ca7db..58532102 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,28 +36,42 @@ jobs: build_assets: name: Build Release Assets needs: create_release - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.runner }} strategy: matrix: - os: [ubuntu-20.04] + include: + - runner: ubuntu-20.04 + os: ubuntu-20.04 + arch: amd64 + - runner: self-hosted + os: ubuntu-22.04 + arch: arm64 fail-fast: false steps: - uses: actions/checkout@v3 - - uses: hendrikmuhs/ccache-action@v1 + - uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.arch }} - ${{ matrix.os }} - - name: Install system dependencies (Ubuntu) + - name: Install system dependencies (Ubuntu 20.04) run: ./scripts/install_deps_ubuntu.sh if: matrix.os == 'ubuntu-20.04' + + - name: Install system dependencies (Ubuntu 22.04) + run: ./scripts/install_deps_ubuntu2204.sh + if: matrix.os == 'ubuntu-22.04' + + - name: Install venv dependencies run: ./scripts/build_venv/build_venv.sh - name: Create Archive For Release run: | ls - tar -czvf venv-${{ matrix.os }}.tar.gz scripts/build_venv/venv/prefix + tar -czvf venv-${{ matrix.os }}-${{ matrix.arch }}.tar.gz scripts/build_venv/venv/prefix - name: Upload release assets uses: actions/upload-release-asset@v1 @@ -65,6 +79,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: venv-${{ matrix.os }}.tar.gz - asset_path: venv-${{ matrix.os }}.tar.gz + asset_name: venv-${{ matrix.os }}-${{ matrix.arch }}.tar.gz + asset_path: venv-${{ matrix.os }}-${{ matrix.arch }}.tar.gz asset_content_type: application/x-tar diff --git a/cmake/External_grpc.cmake b/cmake/External_grpc.cmake index 6ba04a56..416e77c6 100644 --- a/cmake/External_grpc.cmake +++ b/cmake/External_grpc.cmake @@ -14,7 +14,7 @@ ExternalProject_Add(absl -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON - -DABSL_PROPAGATE_CXX_STD=ON + -DABSL_PROPAGATE_CXX_STD=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE ) diff --git a/scripts/build_venv/build_venv.sh b/scripts/build_venv/build_venv.sh index 6e7dfa5f..cfeb4933 100755 --- a/scripts/build_venv/build_venv.sh +++ b/scripts/build_venv/build_venv.sh @@ -13,4 +13,4 @@ cmake -B build.venv \ -G Ninja \ $DIR/. -cmake --build build.venv +cmake --build build.venv -- -j 3 diff --git a/scripts/download_release.sh b/scripts/download_release.sh index aa98ed2e..382f08ae 100755 --- a/scripts/download_release.sh +++ b/scripts/download_release.sh @@ -14,7 +14,14 @@ echo "RELEASE_SHA: $RELEASE_SHA" if [[ -z "${RELEASE_PLATFORM}" ]]; then if [[ "$OSTYPE" == "linux-gnu"* ]]; then . /etc/lsb-release - RELEASE_PLATFORM="${DISTRIB_ID,,}-${DISTRIB_RELEASE}" + + if [[ $(uname -m) == 'aarch64' ]]; then + ARCH="arm64" + else + ARCH="amd64" + fi + + RELEASE_PLATFORM="${DISTRIB_ID,,}-${DISTRIB_RELEASE}-${ARCH}" elif [[ "$OSTYPE" == "darwin"* ]]; then if [[ $(uname -m) == 'arm64' ]]; then RELEASE_PLATFORM="macos-arm64" diff --git a/scripts/install_deps_ubuntu2204.sh b/scripts/install_deps_ubuntu2204.sh new file mode 100755 index 00000000..9a8f36ba --- /dev/null +++ b/scripts/install_deps_ubuntu2204.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -x # echo on +set -e # exit on error + +cmake --version + +sudo apt-get -qq update +# Please keep this list sorted. +sudo apt-get -y install \ + build-essential \ + ccache \ + clang \ + clang-tidy \ + cmake \ + curl \ + gfortran \ + libassimp-dev \ + libatlas-base-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavformat-dev \ + libavutil-dev \ + libc++-dev \ + libcrypto++-dev \ + libegl1-mesa-dev \ + libglew-dev \ + libglm-dev \ + libgoogle-glog-dev \ + libgtest-dev \ + libopencv-dev \ + libssl-dev \ + libstdc++-10-dev \ + libsuitesparse-dev \ + libswscale-dev \ + libtiff-dev \ + ninja-build \ + python3-dev \ + python3.10-venv \ + && sudo apt-get clean