Skip to content

Commit 01748ae

Browse files
authored
Add GitHub actions to 0.6 (#348)
1 parent 4e065d8 commit 01748ae

File tree

141 files changed

+4053
-2982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+4053
-2982
lines changed

.circleci/config.yml

Lines changed: 0 additions & 449 deletions
This file was deleted.

.devcontainer/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/wordlist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ tox
2323
valgrind
2424
virtualenv
2525
whl
26+
datasets
27+
runtime
28+
RedisAI
29+
dataset

.github/workflows/arm.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: arm flow
2+
3+
on: workflow_call # TODO: add pull_request-labeled with "arm" label when specifying a label is supported
4+
5+
jobs:
6+
start-runner:
7+
name: Start self-hosted EC2 runner
8+
runs-on: ubuntu-latest
9+
outputs:
10+
label: ${{ steps.start-ec2-runner.outputs.label }}
11+
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
12+
steps:
13+
- name: Configure AWS credentials
14+
uses: aws-actions/configure-aws-credentials@v2
15+
with:
16+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
17+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18+
aws-region: ${{ secrets.AWS_REGION }}
19+
- name: Start EC2 runner
20+
id: start-ec2-runner
21+
uses: machulav/ec2-github-runner@v2
22+
with:
23+
mode: start
24+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
25+
# Ubuntu 22.04 region AMI for ARM
26+
ec2-image-id: ami-062b37d89f25c958f
27+
ec2-instance-type: t4g.small
28+
subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }}
29+
security-group-id: ${{ secrets.AWS_EC2_SG_ID }}
30+
31+
arm:
32+
needs: start-runner # required to start the main job when the runner is ready
33+
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
34+
steps:
35+
- name: checkout
36+
uses: actions/checkout@v3
37+
- name: install dependencies
38+
run: sudo .install/install_script.sh
39+
- name: unit tests
40+
run: make unit_test
41+
42+
stop-runner:
43+
name: Stop self-hosted EC2 runner
44+
needs:
45+
- start-runner # required to get output from the start-runner job
46+
- arm # required to wait when the main job is done
47+
runs-on: ubuntu-latest
48+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
49+
steps:
50+
- name: Configure AWS credentials
51+
uses: aws-actions/configure-aws-credentials@v2
52+
with:
53+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
54+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
55+
aws-region: ${{ secrets.AWS_REGION }}
56+
- name: Stop EC2 runner
57+
uses: machulav/ec2-github-runner@v2
58+
with:
59+
mode: stop
60+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
61+
label: ${{ needs.start-runner.outputs.label }}
62+
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: benchmark (labeled)
2+
3+
on: # TODO: delete this file when specifying a label is supported
4+
pull_request:
5+
types:
6+
- labeled
7+
branches-ignore:
8+
- '*docs'
9+
- '*noci'
10+
11+
jobs:
12+
check:
13+
name: check if label '${{ github.event.label.name }}' triggers benchmarks
14+
runs-on: ubuntu-latest
15+
steps:
16+
- id: print
17+
run: echo ${{ github.event.label.name }}
18+
bm_invoker:
19+
needs: check
20+
if: startsWith(github.event.label.name, 'bm') || startsWith(github.event.label.name, 'benchmarks')
21+
uses: ./.github/workflows/benchmark.yml
22+
secrets: inherit

.github/workflows/benchmark.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: benchmark
2+
3+
# TODO: add pull_request-labeled with "benchmark" label when specifying a label is supported
4+
on: workflow_call
5+
6+
jobs:
7+
start-runner:
8+
name: Start self-hosted EC2 runner
9+
runs-on: ubuntu-latest
10+
outputs:
11+
label: ${{ steps.start-ec2-runner.outputs.label }}
12+
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
13+
steps:
14+
- name: Configure AWS credentials
15+
uses: aws-actions/configure-aws-credentials@v2
16+
with:
17+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
18+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
19+
aws-region: ${{ secrets.AWS_REGION }}
20+
- name: Start EC2 runner
21+
id: start-ec2-runner
22+
uses: machulav/ec2-github-runner@v2
23+
with:
24+
mode: start
25+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
26+
# Ubuntu 22.04 128GB Storage AMI
27+
ec2-image-id: ami-0ba430d4b7b64de57
28+
ec2-instance-type: r6i.xlarge
29+
subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }}
30+
security-group-id: ${{ secrets.AWS_EC2_SG_ID }}
31+
32+
benchmark:
33+
name: Run the benchmarks on the runner
34+
needs: start-runner # required to start the main job when the runner is ready
35+
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
36+
steps:
37+
- name: checkout
38+
uses: actions/checkout@v3
39+
40+
- name: Print runner info
41+
run: |
42+
printf "Runner lscpu:\n$(lscpu)\n"
43+
printf "Runner lsmem:\n$(lsmem)\n"
44+
printf "Runner nproc:\n$(nproc)\n"
45+
printf "Runner uname:\n$(uname -a)\n"
46+
47+
- name: Install benchmark dependencies
48+
run: |
49+
sudo .install/install_script.sh
50+
sudo apt install python3-pip -y
51+
pip3 install --upgrade pip PyYAML setuptools redisbench-admin
52+
pip3 install -r requirements.txt
53+
54+
- name: stress test
55+
run: |
56+
sudo apt install stress-ng -qqy
57+
uptime
58+
stress-ng -c 1 --timeout 60s --metrics-brief
59+
uptime
60+
stress-ng --stream 1 -t 60 --metrics-brief
61+
uptime
62+
stress-ng --ipsec-mb=1 -t 60 --metrics-brief
63+
uptime
64+
65+
# TODO: remove "--no-check-certificate" when possible
66+
- name: Download pre-generated indices
67+
timeout-minutes: 20
68+
run: ./tests/benchmark/bm_files.sh ${{ github.event.label.name }}
69+
- name: Benchmark
70+
timeout-minutes: 120
71+
run: make benchmark BM_FILTER=${{ github.event.label.name }}
72+
73+
- name: Collect results
74+
run: |
75+
./tests/benchmark/benchmarks.sh ${{ github.event.label.name }} | xargs -I {} redisbench-admin export \
76+
--redistimeseries_host ${{ secrets.PERFORMANCE_RTS_HOST }} \
77+
--redistimeseries_port ${{ secrets.PERFORMANCE_RTS_PORT }} \
78+
--redistimeseries_user default \
79+
--redistimeseries_pass '${{ secrets.PERFORMANCE_RTS_AUTH }}' \
80+
--github_repo ${{ github.event.repository.name }} \
81+
--github_org ${{ github.repository_owner }} \
82+
--github_branch ${{ github.head_ref || github.ref_name }} \
83+
--github_actor ${{ github.triggering_actor }} \
84+
--results-format google.benchmark \
85+
--benchmark-result-file {}_results.json
86+
87+
stop-runner:
88+
name: Stop self-hosted EC2 runner
89+
needs:
90+
- start-runner # required to get output from the start-runner job
91+
- benchmark # required to wait when the main job is done
92+
runs-on: ubuntu-latest
93+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
94+
steps:
95+
- name: Configure AWS credentials
96+
uses: aws-actions/configure-aws-credentials@v2
97+
with:
98+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
99+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
100+
aws-region: ${{ secrets.AWS_REGION }}
101+
- name: Stop EC2 runner
102+
uses: machulav/ec2-github-runner@v2
103+
with:
104+
mode: stop
105+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
106+
label: ${{ needs.start-runner.outputs.label }}
107+
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}

.github/workflows/bionic.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: bionic flow
2+
3+
on: workflow_call # TODO: add pull_request-labeled with "bionic" label when specifying a label is supported
4+
5+
jobs:
6+
bionic:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: ubuntu:bionic
10+
steps:
11+
- name: checkout
12+
uses: actions/checkout@v3
13+
- name: install dependencies
14+
run: .install/install_script.sh
15+
- name: unit tests
16+
run: make unit_test
17+
- name: valgrind
18+
run: make valgrind
19+
- name: Archive valgrind tests reports
20+
uses: actions/upload-artifact@v3
21+
with:
22+
name: valgrind tests reports
23+
path: bin/Linux-x86_64-debug/unit_tests/Testing/Temporary/

.github/workflows/codeql-analysis.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@
1111
#
1212
name: "CodeQL"
1313

14-
on:
15-
push:
16-
branches: [ main ]
17-
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ main ]
20-
schedule:
21-
- cron: '29 4 * * 5'
14+
on: workflow_call
2215

2316
jobs:
2417
analyze:
18+
if: (!endsWith(github.head_ref, 'docs') && !endsWith(github.head_ref, 'noci'))
2519
name: Analyze
2620
runs-on: ubuntu-latest
2721
permissions:
@@ -38,11 +32,11 @@ jobs:
3832

3933
steps:
4034
- name: Checkout repository
41-
uses: actions/checkout@v2
35+
uses: actions/checkout@v3
4236

4337
# Initializes the CodeQL tools for scanning.
4438
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
39+
uses: github/codeql-action/init@v2
4640
with:
4741
languages: ${{ matrix.language }}
4842
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -52,8 +46,8 @@ jobs:
5246

5347
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5448
# If this step fails, then you should remove it and run the build manually (see below)
55-
# - name: Autobuild
56-
# uses: github/codeql-action/autobuild@v1
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v2
5751

5852
# ℹ️ Command-line programs to run using the OS shell.
5953
# 📚 https://git.io/JvXDl
@@ -62,13 +56,7 @@ jobs:
6256
# and modify them (or add more) to build your code if your project
6357
# uses a compiled language
6458

65-
- run: |
66-
mkdir -p deps
67-
cd deps
68-
git clone https://github.com/RedisLabsModules/readies.git
69-
cd ../
70-
sudo ./sbin/system-setup.py
71-
make
59+
# - run: make
7260

7361
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v1
62+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)