Skip to content

Commit

Permalink
Enable RPC support and build RPC server images
Browse files Browse the repository at this point in the history
  • Loading branch information
EZForever committed Sep 18, 2024
1 parent f3eeb5d commit 8d1073b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .devops/rpc-server.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
COPY --chown=0:0 --chmod=755 rpc-server /rpc-server
ENV LC_ALL=C.utf8
ENTRYPOINT ["/rpc-server"]
21 changes: 16 additions & 5 deletions .github/workflows/build-oneapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ jobs:
- name: CMake
run: |
. /opt/intel/oneapi/setvars.sh
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_CXX_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_EXE_LINKER_FLAGS="-static" -DGGML_NATIVE=OFF -DGGML_STATIC=ON -DGGML_OPENMP=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release --target llama-server -j ${{ steps.cpu-cores.outputs.count }}
strip build/bin/llama-server
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_CXX_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_EXE_LINKER_FLAGS="-static" -DGGML_NATIVE=OFF -DGGML_STATIC=ON -DGGML_RPC=ON -DGGML_OPENMP=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release --target llama-server --target rpc-server -j ${{ steps.cpu-cores.outputs.count }}
strip build/bin/*
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: server-${{ matrix.ssl }}-oneapi
path: build/bin/llama-server
path: build/bin/*
if-no-files-found: error

- name: Build and push Docker image
- name: Build and push llama-server Docker image
uses: macbre/push-to-ghcr@v13
with:
dockerfile: .devops/llama-server.Dockerfile
Expand All @@ -71,3 +71,14 @@ jobs:
docker_io_user: ${{ vars.DOCKER_IO_USER }}
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}

- name: Build and push rpc-server Docker image
uses: macbre/push-to-ghcr@v13
with:
dockerfile: .devops/rpc-server.Dockerfile
context: build/bin
image_name: ${{ github.repository }}
image_tag: rpc-server-${{ matrix.ssl }}-oneapi
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
docker_io_user: ${{ vars.DOCKER_IO_USER }}
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}

23 changes: 17 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ jobs:

- name: CMake
run: |
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static" -DGGML_NATIVE=OFF -DGGML_STATIC=ON -DGGML_OPENMP=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF ${{ matrix.ssl_defines }} ${{ matrix.avx_defines }}
cmake --build build --config Release --target llama-server -j ${{ steps.cpu-cores.outputs.count }}
strip build/bin/llama-server
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static" -DGGML_NATIVE=OFF -DGGML_STATIC=ON -DGGML_RPC=ON -DGGML_OPENMP=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF ${{ matrix.ssl_defines }} ${{ matrix.avx_defines }}
cmake --build build --config Release --target llama-server --target rpc-server -j ${{ steps.cpu-cores.outputs.count }}
strip build/bin/*
shell: alpine.sh {0}

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: server-${{ matrix.ssl }}-${{ matrix.avx }}
path: build/bin/llama-server
path: build/bin/*
if-no-files-found: error

- name: Build and push Docker image
uses: macbre/push-to-ghcr@v13
- name: Build and push llama-server Docker image
uses: macbre/push-to-ghcr@v14
with:
dockerfile: .devops/llama-server.Dockerfile
context: build/bin
Expand All @@ -81,3 +81,14 @@ jobs:
docker_io_user: ${{ vars.DOCKER_IO_USER }}
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}

- name: Build and push rpc-server Docker image
uses: macbre/push-to-ghcr@v14
with:
dockerfile: .devops/rpc-server.Dockerfile
context: build/bin
image_name: ${{ github.repository }}
image_tag: rpc-server-${{ matrix.ssl }}-${{ matrix.avx }}
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
docker_io_user: ${{ vars.DOCKER_IO_USER }}
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}

0 comments on commit 8d1073b

Please sign in to comment.