Skip to content

Commit 8d1073b

Browse files
committed
Enable RPC support and build RPC server images
1 parent f3eeb5d commit 8d1073b

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

.devops/rpc-server.Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM scratch
2+
COPY --chown=0:0 --chmod=755 rpc-server /rpc-server
3+
ENV LC_ALL=C.utf8
4+
ENTRYPOINT ["/rpc-server"]

.github/workflows/build-oneapi.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ jobs:
4949
- name: CMake
5050
run: |
5151
. /opt/intel/oneapi/setvars.sh
52-
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
53-
cmake --build build --config Release --target llama-server -j ${{ steps.cpu-cores.outputs.count }}
54-
strip build/bin/llama-server
52+
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
53+
cmake --build build --config Release --target llama-server --target rpc-server -j ${{ steps.cpu-cores.outputs.count }}
54+
strip build/bin/*
5555
5656
- name: Upload build artifact
5757
uses: actions/upload-artifact@v4
5858
with:
5959
name: server-${{ matrix.ssl }}-oneapi
60-
path: build/bin/llama-server
60+
path: build/bin/*
6161
if-no-files-found: error
6262

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

74+
- name: Build and push rpc-server Docker image
75+
uses: macbre/push-to-ghcr@v13
76+
with:
77+
dockerfile: .devops/rpc-server.Dockerfile
78+
context: build/bin
79+
image_name: ${{ github.repository }}
80+
image_tag: rpc-server-${{ matrix.ssl }}-oneapi
81+
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
82+
docker_io_user: ${{ vars.DOCKER_IO_USER }}
83+
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}
84+

.github/workflows/build.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ jobs:
5858

5959
- name: CMake
6060
run: |
61-
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 }}
62-
cmake --build build --config Release --target llama-server -j ${{ steps.cpu-cores.outputs.count }}
63-
strip build/bin/llama-server
61+
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 }}
62+
cmake --build build --config Release --target llama-server --target rpc-server -j ${{ steps.cpu-cores.outputs.count }}
63+
strip build/bin/*
6464
shell: alpine.sh {0}
6565

6666
- name: Upload build artifact
6767
uses: actions/upload-artifact@v4
6868
with:
6969
name: server-${{ matrix.ssl }}-${{ matrix.avx }}
70-
path: build/bin/llama-server
70+
path: build/bin/*
7171
if-no-files-found: error
7272

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

84+
- name: Build and push rpc-server Docker image
85+
uses: macbre/push-to-ghcr@v14
86+
with:
87+
dockerfile: .devops/rpc-server.Dockerfile
88+
context: build/bin
89+
image_name: ${{ github.repository }}
90+
image_tag: rpc-server-${{ matrix.ssl }}-${{ matrix.avx }}
91+
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
92+
docker_io_user: ${{ vars.DOCKER_IO_USER }}
93+
docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }}
94+

0 commit comments

Comments
 (0)