@@ -12,203 +12,75 @@ concurrency:
1212 cancel-in-progress : true
1313
1414jobs :
15- pre-commit :
16- runs-on : ubuntu-latest
17- steps :
18- - uses : actions/checkout@v4
19- with :
20- fetch-depth : 2
21- - uses : actions/setup-python@v5
22- with :
23- python-version : ' 3.x'
24- check-latest : true
25- - name : Install dependencies
26- run : |
27- python -m venv venv
28- source venv/bin/activate
29- python -m pip install pre-commit
30- lsblk -l
31- echo "sda rotational = $(cat /sys/block/sda/queue/rotational)"
32- echo "sdb rotational = $(cat /sys/block/sdb/queue/rotational)"
33- - name : Run pre-commit checks
34- run : |
35- source venv/bin/activate
36- pre-commit run --show-diff-on-failure --color=always --from-ref HEAD^ --to-ref HEAD
37- shell : bash
3815 build :
3916 strategy :
4017 matrix :
4118 # Test of these containers
42- container : ["ubuntu-dev:20", "alpine-dev:latest"]
43- build-type : [Debug, Release]
44- compiler : [{ cxx: g++, c: gcc }]
45- # -no-pie to disable address randomization so we could symbolize stacktraces
46- cxx_flags : ["-Werror -no-pie"]
47- sanitizers : ["NoSanitizers"]
48- include :
49- - container : " alpine-dev:latest"
50- build-type : Debug
51- compiler : { cxx: clang++, c: clang }
52- cxx_flags : " "
53- sanitizers : " NoSanitizers"
54- - container : " ubuntu-dev:24"
55- build-type : Debug
56- compiler : { cxx: clang++, c: clang }
57- # https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt)
58- cxx_flags : " -Wno-error=unused-command-line-argument"
59- sanitizers : " Sanitizers"
19+ container : ["ubuntu-dev:20"]
20+ proactor : [Uring]
21+ build-type : [Debug]
22+ runner : [ubuntu-latest]
23+
24+ runs-on : ${{ matrix.runner }}
6025
61- runs-on : ubuntu-latest
6226 container :
6327 image : ghcr.io/romange/${{ matrix.container }}
64- # Seems that docker by default prohibits running iouring syscalls
6528 options : --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
6629 volumes :
67- - /:/hostroot
68- - /mnt:/mnt
69- credentials :
70- username : ${{ github.repository_owner }}
71- password : ${{ secrets.GITHUB_TOKEN }}
30+ - /var/crash:/var/crash
7231
7332 steps :
7433 - uses : actions/checkout@v4
7534 with :
7635 submodules : true
7736
78- - name : Prepare Environment
79- run : |
80- uname -a
81- cmake --version
82- mkdir -p ${GITHUB_WORKSPACE}/build
83- mount
84-
85- echo "===================Before freeing up space ============================================"
86- df -h
87- rm -rf /hostroot/usr/share/dotnet
88- rm -rf /hostroot/usr/local/share/boost
89- rm -rf /hostroot/usr/local/lib/android
90- rm -rf /hostroot/opt/ghc
91- echo "===================After freeing up space ============================================"
92- df -h
93- touch /mnt/foo
94- ls -la /mnt/foo
95-
96- - name : Configure CMake
97- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
98- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
99- run : |
100- echo "ulimit is"
101- ulimit -s
102- echo "-----------------------------"
103- echo "disk space is:"
104- df -h
105- echo "-----------------------------"
106-
107- export ASAN="OFF"
108- export USAN="OFF"
109-
110- if [ '${{matrix.sanitizers}}' = 'Sanitizers' ]; then
111- echo "ASAN/USAN"
112- export ASAN="ON"
113- export USAN="ON"
114- fi
115-
116- cmake -B ${GITHUB_WORKSPACE}/build \
117- -DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
118- -GNinja \
119- -DCMAKE_C_COMPILER="${{matrix.compiler.c}}" \
120- -DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \
121- -DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}}" -DWITH_AWS:BOOL=OFF \
122- -DWITH_ASAN="${ASAN}" \
123- -DWITH_USAN="${USAN}" \
124- -L
125-
126- cd ${GITHUB_WORKSPACE}/build && pwd
127- du -hcs _deps/
128-
129- - name : Build
130- run : |
131- cd ${GITHUB_WORKSPACE}/build
132- ninja search_family_test
133- df -h
134- echo "-----------------------------"
135- ninja src/all
136-
137- - name : PostFail
138- if : failure()
37+ - name : Print environment info
13938 run : |
140- echo "disk space is:"
141- df -h
39+ cat /proc/cpuinfo
40+ ulimit -a
41+ env
14242
143- - name : C++ Unit Tests - IoUring
43+ - name : Configure & Build
14444 run : |
145- cd ${GITHUB_WORKSPACE}/build
146- echo Run ctest -V -L DFLY
147-
148- GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1,op_manager=1,op_manager_test=1 \
149- FLAGS_fiber_safety_margin=4096 timeout 20m ctest -V -L DFLY -E allocation_tracker_test
150-
151- # Run allocation tracker test separately without alsologtostderr because it generates a TON of logs.
152- FLAGS_fiber_safety_margin=4096 timeout 5m ./allocation_tracker_test
45+ # -no-pie to disable address randomization so we could symbolize stacktraces
46+ cmake -B ${GITHUB_WORKSPACE}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -GNinja \
47+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DPRINT_STACKTRACES_ON_SIGNAL=ON \
48+ -DCMAKE_CXX_FLAGS=-no-pie -DHELIO_STACK_CHECK:STRING=4096
15349
154- timeout 5m ./dragonfly_test
155- timeout 5m ./json_family_test --jsonpathv2=false
156- timeout 5m ./tiered_storage_test --vmodule=db_slice=2 --logtostderr
157-
158-
159- - name : C++ Unit Tests - Epoll
160- run : |
161- cd ${GITHUB_WORKSPACE}/build
162-
163- # Create a rule that automatically prints stacktrace upon segfault
164- cat > ./init.gdb <<EOF
165- catch signal SIGSEGV
166- command
167- bt
168- end
169- EOF
170-
171- gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
172- FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 timeout 20m ctest -V -L DFLY -E allocation_tracker_test
173-
174- FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true timeout 5m ./allocation_tracker_test
175-
176- - name : C++ Unit Tests - IoUring with cluster mode
177- run : |
178- FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated timeout 20m ctest -V -L DFLY
50+ cd ${GITHUB_WORKSPACE}/build && ninja dragonfly
51+ pwd
52+ ls -l ..
17953
180- - name : C++ Unit Tests - IoUring with cluster mode and FLAGS_lock_on_hashtags
181- run : |
182- FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true timeout 20m ctest -V -L DFLY
183-
184- - name : Upload unit logs on failure
185- if : failure()
186- uses : actions/upload-artifact@v4
187- with :
188- name : unit_logs
189- path : /tmp/*INFO*
190-
191- - name : Run regression tests
192- if : matrix.container == 'ubuntu-dev:20'
54+ - name : Run regression tests action
19355 uses : ./.github/actions/regression-tests
19456 with :
19557 dfly-executable : dragonfly
196- run-only-on-ubuntu-latest : true
58+ gspace-secret : ${{ secrets.GSPACES_BOT_DF_BUILD }}
19759 build-folder-name : build
198- # Non-release build will not run tests marked as slow or opt_only
199- # "not empty" string is needed for release build because pytest command can not get empty string for filter
200- filter : ${{ matrix.build-type == 'Release' && 'not empty' || '(not slow) and (not opt_only)' }}
60+ filter : ${{ matrix.build-type == 'Release' && 'not empty' || 'not opt_only' }}
61+ aws-access-key-id : ${{ secrets.AWS_S3_ACCESS_KEY }}
62+ aws-secret-access-key : ${{ secrets.AWS_S3_ACCESS_SECRET }}
63+ s3-bucket : ${{ secrets.S3_REGTEST_BUCKET }}
20164
202- - name : Upload regression logs on failure
65+ - name : Upload logs on failure
20366 if : failure()
20467 uses : actions/upload-artifact@v4
20568 with :
206- name : regression_logs
69+ name : logs
20770 path : /tmp/failed/*
20871
72+ - name : Copy binary on a self hosted runner
73+ if : failure()
74+ run : |
75+ # We must use sh syntax.
76+ if [ "$RUNNER_ENVIRONMENT" = "self-hosted" ]; then
77+ cd ${GITHUB_WORKSPACE}/build
78+ timestamp=$(date +%Y-%m-%d_%H:%M:%S)
79+ mv ./dragonfly /var/crash/dragonfy_${timestamp}
80+ fi
81+
20982 lint-test-chart :
21083 runs-on : ubuntu-latest
211- needs : [build]
21284 steps :
21385 - uses : actions/checkout@v4
21486 - uses : ./.github/actions/lint-test-chart
0 commit comments