mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-21 13:37:51 +00:00
128694213f
* wip: llama.cpp c++ gRPC server Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * make it work, attach it to the build process Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * update deps Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix: add protobuf dep Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * try fix protobuf on cmake * cmake: workarounds Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * add packages * cmake: use fixed version of grpc Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * cmake(grpc): install locally * install grpc Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * install required deps for grpc on debian bullseye Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * debug * debug * Fixups * no need to install cmake manually Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * ci: fixup macOS * use brew whenever possible Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * macOS fixups * debug * fix container build Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * workaround * try mac https://stackoverflow.com/questions/23905661/on-mac-g-clang-fails-to-search-usr-local-include-and-usr-local-lib-by-def * Disable temp. arm64 docker image builds --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
99 lines
2.7 KiB
YAML
99 lines
2.7 KiB
YAML
name: Build and Release
|
|
|
|
on: push
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-linux:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build: 'avx2'
|
|
defines: ''
|
|
- build: 'avx'
|
|
defines: '-DLLAMA_AVX2=OFF'
|
|
- build: 'avx512'
|
|
defines: '-DLLAMA_AVX512=ON'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '>=1.21.0'
|
|
- name: Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install build-essential ffmpeg
|
|
|
|
git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \
|
|
cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \
|
|
-DgRPC_BUILD_TESTS=OFF \
|
|
../.. && sudo make -j12 install
|
|
|
|
- name: Build
|
|
id: build
|
|
env:
|
|
CMAKE_ARGS: "${{ matrix.defines }}"
|
|
BUILD_ID: "${{ matrix.build }}"
|
|
run: |
|
|
STATIC=true make dist
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.build }}
|
|
path: release/
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
release/*
|
|
|
|
build-macOS:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build: 'avx2'
|
|
defines: ''
|
|
- build: 'avx'
|
|
defines: '-DLLAMA_AVX2=OFF'
|
|
- build: 'avx512'
|
|
defines: '-DLLAMA_AVX512=ON'
|
|
runs-on: macOS-latest
|
|
steps:
|
|
- name: Clone
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '>=1.21.0'
|
|
- name: Dependencies
|
|
run: |
|
|
git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \
|
|
cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \
|
|
-DgRPC_BUILD_TESTS=OFF \
|
|
../.. && make -j12 install && rm -rf grpc
|
|
- name: Build
|
|
id: build
|
|
env:
|
|
CMAKE_ARGS: "${{ matrix.defines }}"
|
|
BUILD_ID: "${{ matrix.build }}"
|
|
run: |
|
|
export C_INCLUDE_PATH=/usr/local/include
|
|
export CPLUS_INCLUDE_PATH=/usr/local/include
|
|
make dist
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.build }}
|
|
path: release/
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
release/* |