diff --git a/.github/runners/actions-runner-ubuntu-2004-arm64.dockerfile b/.github/runners/actions-runner-ubuntu-2004-arm64.dockerfile new file mode 100644 index 0000000..78d65ef --- /dev/null +++ b/.github/runners/actions-runner-ubuntu-2004-arm64.dockerfile @@ -0,0 +1,91 @@ +# Use NVIDIA CUDA 12.0.0 development image with Ubuntu 18.04 as the base +FROM ubuntu:20.04 + +# Docker and Docker Compose arguments + +# Use 1001 and 121 for compatibility with GitHub-hosted runners +ARG RUNNER_UID=1000 +ARG DOCKER_GID=1001 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install necessary packages +RUN apt-get update -y \ + && apt-get install -y software-properties-common \ + && add-apt-repository -y ppa:git-core/ppa \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + ca-certificates \ + dnsutils \ + ftp \ + git \ + uuid-dev \ + iproute2 \ + iputils-ping \ + jq \ + libunwind8 \ + locales \ + netcat \ + openssh-client \ + parallel \ + python3-pip \ + rsync \ + shellcheck \ + sudo \ + telnet \ + time \ + tzdata \ + unzip \ + upx \ + wget \ + lsb-release \ + openssl \ + libssl-dev \ + manpages-dev \ + zip \ + zstd \ + pkg-config \ + ccache \ + gcc \ + g++ \ + && ln -sf /usr/bin/python3 /usr/bin/python \ + && ln -sf /usr/bin/pip3 /usr/bin/pip \ + && rm -rf /var/lib/apt/lists/* + +# Add Kitware's APT repository for CMake +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ + apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \ + apt-get update && \ + apt-get install -y cmake + +# Download latest git-lfs version +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ + apt-get install -y --no-install-recommends git-lfs + +ARG RUNNER_VERSION=2.321.0 + +RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \ + && groupadd docker --gid $DOCKER_GID \ + && usermod -aG sudo runner \ + && usermod -aG docker runner \ + && echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ + && echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers + +ENV HOME=/home/runner + +# cd into the user directory, download and unzip the github actions runner +RUN cd /home/runner && mkdir actions-runner && cd actions-runner \ + && curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz \ + && tar xzf ./actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz + +RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh + +ADD ./start.sh /home/runner/start.sh + +RUN chmod +x /home/runner/start.sh + +ENTRYPOINT ["/bin/bash", "/home/runner/start.sh"] + +USER runner \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6345568..9fee8fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,14 @@ jobs: fail-fast: false matrix: include: + - os: "linux" + name: "arm64" + runs-on: "ubuntu-2004-arm64" + cmake-flags: "-DCORTEXLLAMA_VERSION=${{needs.create-draft-release.outputs.version}} -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_COMMON=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja" + run-e2e: true + vulkan: false + ccache: true + ccache-dir: "/home/runner/.ccache" - os: "linux" name: "amd64-avx2" runs-on: "ubuntu-20-04" @@ -300,9 +308,10 @@ jobs: git apply ../patches/0001-Add-API-query-buffer-size.patch - name: use python for linux + continue-on-error: true uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install tools on Windows if: runner.os == 'Windows' @@ -314,6 +323,11 @@ jobs: run: | sudo apt-get install -y ninja-build python3 -m pip install awscli + + if [ "${{ matrix.os }}${{ matrix.name }}" == "linuxarm64" ]; then + sudo apt-get install -y ccache + exit 0 + fi cd /tmp wget https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz tar -xvf ccache-4.10.2-linux-x86_64.tar.xz diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index c0b32e8..9a64901 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -61,6 +61,14 @@ jobs: strategy: matrix: include: + - os: "linux" + name: "arm64" + runs-on: "ubuntu-2004-arm64" + cmake-flags: "-DCORTEXLLAMA_VERSION=${{needs.create-draft-release.outputs.version}} -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_COMMON=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja" + run-e2e: true + vulkan: false + ccache: true + ccache-dir: "/home/runner/.ccache" - os: "linux" name: "amd64-avx2" runs-on: "ubuntu-20-04" @@ -299,9 +307,10 @@ jobs: git apply ../patches/0001-Add-API-query-buffer-size.patch - name: use python for linux + continue-on-error: true uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install tools on Windows if: runner.os == 'Windows' @@ -313,6 +322,10 @@ jobs: run: | sudo apt-get install -y ninja-build python3 -m pip install awscli + if [ "${{ matrix.os }}${{ matrix.name }}" == "linuxarm64" ]; then + sudo apt-get install -y ccache + exit 0 + fi cd /tmp wget https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz tar -xvf ccache-4.10.2-linux-x86_64.tar.xz diff --git a/.github/workflows/template-e2e-weekend-test.yml b/.github/workflows/template-e2e-weekend-test.yml index 9dd965d..7161a74 100644 --- a/.github/workflows/template-e2e-weekend-test.yml +++ b/.github/workflows/template-e2e-weekend-test.yml @@ -30,6 +30,14 @@ jobs: fail-fast: false matrix: include: + - os: "linux" + name: "arm64" + runs-on: "ubuntu-2004-arm64" + cmake-flags: "-DCORTEXLLAMA_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_COMMON=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja" + run-e2e: true + vulkan: false + ccache: true + ccache-dir: "/home/runner/.ccache" - os: "linux" name: "amd64-avx2" runs-on: "ubuntu-20-04" diff --git a/.github/workflows/template-quality-gate-pr.yml b/.github/workflows/template-quality-gate-pr.yml index 80544cc..93e055d 100644 --- a/.github/workflows/template-quality-gate-pr.yml +++ b/.github/workflows/template-quality-gate-pr.yml @@ -28,6 +28,14 @@ jobs: fail-fast: false matrix: include: + - os: "linux" + name: "arm64" + runs-on: "ubuntu-2004-arm64" + cmake-flags: "-DCORTEXLLAMA_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_COMMON=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja" + run-e2e: true + vulkan: false + ccache: true + ccache-dir: "/home/runner/.ccache" - os: "linux" name: "amd64-avx2" runs-on: "ubuntu-20-04" @@ -266,9 +274,10 @@ jobs: git apply ../patches/0001-Add-API-query-buffer-size.patch - name: use python for linux + continue-on-error: true uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.10" - name: Install tools on Windows if: runner.os == 'Windows' @@ -280,6 +289,10 @@ jobs: run: | sudo apt-get install -y ninja-build python3 -m pip install awscli + if [ "${{ matrix.os }}${{ matrix.name }}" == "linuxarm64" ]; then + sudo apt-get install -y ccache + exit 0 + fi cd /tmp wget https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz tar -xvf ccache-4.10.2-linux-x86_64.tar.xz diff --git a/.github/workflows/template-quality-gate-submodule.yml b/.github/workflows/template-quality-gate-submodule.yml index e68e98b..8d7e45d 100644 --- a/.github/workflows/template-quality-gate-submodule.yml +++ b/.github/workflows/template-quality-gate-submodule.yml @@ -28,6 +28,14 @@ jobs: fail-fast: false matrix: include: + - os: "linux" + name: "arm64" + runs-on: "ubuntu-2004-arm64" + cmake-flags: "-DCORTEXLLAMA_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_COMMON=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja" + run-e2e: true + vulkan: false + ccache: true + ccache-dir: "/home/runner/.ccache" - os: "linux" name: "amd64-avx2" runs-on: "ubuntu-20-04" @@ -266,9 +274,10 @@ jobs: git apply ../patches/0001-Add-API-query-buffer-size.patch - name: use python for linux + continue-on-error: true uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install tools on Windows if: runner.os == 'Windows' @@ -279,6 +288,10 @@ jobs: run: | sudo apt-get install -y ninja-build python3 -m pip install awscli + if [ "${{ matrix.os }}${{ matrix.name }}" == "linuxarm64" ]; then + sudo apt-get install -y ccache + exit 0 + fi cd /tmp wget https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz tar -xvf ccache-4.10.2-linux-x86_64.tar.xz @@ -356,7 +369,7 @@ jobs: make package - name: Install Python - if: ${{matrix.run-e2e}} + continue-on-error: true uses: actions/setup-python@v4 with: python-version: '3.10'