-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (96 loc) · 3.52 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
workflow_dispatch: # allows manual triggering
inputs:
create_release:
description: 'Create new release'
required: true
type: boolean
push:
branches:
- main
jobs:
release-ubuntu-1804:
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- build: 'openblas'
defines: '-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS'
- build: 'cublas'
defines: '-DLLAMA_CUBLAS=ON'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v1
- name: Dependencies
id: depends
run: |
sudo apt-get update
sudo apt-get install -y build-essential gcc-8 g++-8 python3.8 libpython3.8-dev python3-pip
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
python3.8 -m pip install -U pip
python3.8 -m pip install cmake
python3.8 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python3.8 -m pip install transformers tiktoken pyinstaller
- name: Dependencies
id: depends_openblas
if: ${{ matrix.build == 'openblas' }}
run: |
sudo apt-get install -y libopenblas-dev
- uses: Jimver/[email protected]
id: cuda-toolkit
if: ${{ matrix.build == 'cublas' }}
with:
cuda: '11.8.0'
- name: Build backend server
id: cmake_build_backend_server
run: |
cmake -B build_backend_server -S . -DLLAMA_NATIVE=OFF ${{ matrix.defines }}
cmake --build build_backend_server --config Release
- name: Build lsp server
id: pyinstaller_build_lsp_server
run: |
pyinstaller flatline_lsp.py \
--copy-metadata tqdm \
--copy-metadata regex \
--copy-metadata requests \
--copy-metadata packaging \
--copy-metadata filelock \
--copy-metadata numpy \
--copy-metadata tokenizers \
--copy-metadata huggingface-hub \
--copy-metadata safetensors \
--copy-metadata pyyaml \
--copy-metadata torch \
--hidden-import=tiktoken_ext.openai_public \
--hidden-import=tiktoken_ext \
--add-binary build_backend_server/bin/flatline-server:flatline/backend_server \
;
mkdir -p ./dist/flatline_lsp/license
find build_backend_server/bin -name \*.LICENSE.txt | xargs -I{} cp {} ./dist/flatline_lsp/license/
cd dist
zip -r flatline_lsp_${{ matrix.build }}.zip flatline_lsp
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Release test
draft: true
prerelease: true
- name: Upload release asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/flatline_lsp_${{ matrix.build }}.zip
asset_name: flatline_lsp_${{ matrix.build }}.zip
asset_content_type: application/zip