forked from dingodb/dingo-store
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (120 loc) · 4.66 KB
/
ci_rocky8.yml
File metadata and controls
141 lines (120 loc) · 4.66 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: CMake_rocky8
on:
push:
branches: [ "main", "develop", "quickBI-v3.0.0" ]
pull_request:
branches: [ "main", "develop", "quickBI-v3.0.0" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Copy dingo-store repository
run: |
echo "Move dingo-store repository"
sudo cp -r /home/runner/work/dingo-store/dingo-store /mnt/
sudo chown $USER:$USER /mnt/dingo-store
- name: Configure Docker data-root
run: |
sudo systemctl stop docker
sudo systemctl stop docker.socket
sudo mkdir -p /mnt/docker
echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json
if [ -d /var/lib/docker ]; then
sudo mv /var/lib/docker /mnt/docker || true
fi
sudo systemctl start docker.socket
sudo systemctl start docker
docker info | grep "Docker Root Dir"
echo "check disk space"
df -h
- name: Pull dingo-store-rocky-8-dev:eureka
run: |
docker pull dingodatabase/dingo-store-rocky-8-dev:eureka-0be454e
- name: Init build script
run: |
cat <<EOF > /mnt/dingo-store/build.sh
#!/bin/bash
set -x
set -e
cd /opt/dingo-store/
git config --global --add safe.directory /opt/dingo-store
git submodule sync --recursive && git submodule update --init --recursive --progress
source /opt/intel/oneapi/setvars.sh
cmake -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTHIRD_PARTY_BUILD_TYPE=RelWithDebInfo -DWITH_DISKANN=ON -DWITH_MKL=ON -DDISKANN_DEPEND_ON_SYSTEM=OFF -DBUILD_UNIT_TESTS=OFF -DBRPC_ENABLE_CPU_PROFILER=OFF -DDINGO_BUILD_STATIC=OFF -DLINK_TCMALLOC=ON -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build ./build
# check if the build is successful
if [ $? -ne 0 ]
then
echo "build failed"
exit -1
fi
tar -czvf dingo-store.tar.gz scripts build/bin/dingodb* conf/
echo "dingo-store Build finished"
echo "check server disk size"
df -h
EOF
chmod +x /mnt/dingo-store/build.sh
- name: Record event type
run: |
branchName=$(echo "${{ github.ref_name }}")
echo "branch name is: $branchName"
echo "$branchName" > branch_name.txt
commitId="${{ github.sha }}"
shortCommitId=${commitId:0:7}
echo "commit id is: $shortCommitId"
echo "$shortCommitId" > commit_id.txt
echo "hello dingofs" > event.txt
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "pull_request" > event.txt
elif [ "${{ github.event_name }}" == "push" ]; then
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "tag" > event.txt
tagInfo=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
echo "$tagInfo" > tag_name.txt
echo "TAG_NAME=$tagInfo" >> $GITHUB_ENV
else
echo "push" > event.txt
echo "TAG_NAME=latest" >> $GITHUB_ENV
fi
fi
- name: Save event type info
uses: actions/upload-artifact@v4
with:
name: event
path: event.txt
compression-level: 0
- name: Save tag name info
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: tag_name
path: tag_name.txt
compression-level: 0
- name: Save branch name info
uses: actions/upload-artifact@v4
with:
name: branch_name
path: branch_name.txt
compression-level: 0
- name: Save commit id info
uses: actions/upload-artifact@v4
with:
name: commit_id
path: commit_id.txt
compression-level: 0
- name: Build dingo-store
run: |
echo "Build dingo-store"
docker run --name release-dingo-store --rm -v /mnt/dingo-store:/opt/dingo-store/ dingodatabase/dingo-store-rocky-8-dev:eureka-0be454e /opt/dingo-store/build.sh
- name: copy artifactory to another workflow
uses: actions/upload-artifact@v4
with:
name: dingo-store.tar.gz
path: /mnt/dingo-store/dingo-store.tar.gz