Skip to content

Commit ba78ab0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into zipfian
2 parents 3fcfe42 + ec7a061 commit ba78ab0

Some content is hidden

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

50 files changed

+3299
-996
lines changed

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Dockerfile*
2+
**/Dockerfile*
3+
.gitignore
4+
**/.gitignore
5+
.gitattributes
6+
README*
7+
**/README*
8+
COPYING*
9+
**/COPYING*
10+
LICENSE*
11+
**/LICENSE*
12+
.github/*
13+
tests/*
14+
utils/*

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
* text eol=lf
3+
*.png binary

.github/workflows/ci.yml

Lines changed: 149 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,113 +3,190 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6+
smoketest-build-distros:
7+
runs-on: ubuntu-latest
8+
continue-on-error: true
9+
env:
10+
ARCH: amd64
11+
# required by ubuntu:bionic
12+
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
13+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14+
DEBIAN_FRONTEND: noninteractive
15+
strategy:
16+
matrix:
17+
image: ${{ fromJSON(vars.SMOKE_TEST_IMAGES) }}
18+
container: ${{ matrix.image }}
19+
name: Build ${{ matrix.image }}
20+
steps:
21+
- name: Checkout Code for ubuntu:bionic
22+
if: matrix.image == 'ubuntu:bionic'
23+
uses: actions/checkout@v3
24+
25+
- name: Checkout Code for other versions
26+
if: matrix.image != 'ubuntu:bionic'
27+
uses: actions/checkout@v4
28+
29+
- name: Install dependencies
30+
run: |
31+
apt-get -qq update -y
32+
apt-get install -y \
33+
build-essential autoconf automake libpcre3-dev libevent-dev \
34+
pkg-config zlib1g-dev libssl-dev libboost-all-dev cmake flex
35+
36+
- name: Build
37+
run: autoreconf -ivf && ./configure && make -j
38+
39+
build-notls:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Install dependencies
44+
run: |
45+
sudo apt-get -qq update
46+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
47+
48+
- name: Build
49+
run: autoreconf -ivf && ./configure --disable-tls && make -j
50+
51+
build-ubuntu-latest:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Install dependencies
56+
run: |
57+
sudo apt-get -qq update
58+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
59+
60+
- name: Build
61+
run: autoreconf -ivf && ./configure --disable-tls && make -j
62+
663
build-ubuntu:
764
strategy:
865
matrix:
9-
platform: [ubuntu-latest,ubuntu-16.04]
66+
platform: [ubuntu-22.04, ubuntu-20.04]
1067
runs-on: ${{ matrix.platform }}
1168
steps:
12-
- uses: actions/checkout@v2
69+
- uses: actions/checkout@v4
1370
- name: Install dependencies
1471
run: |
1572
sudo apt-get -qq update
16-
sudo apt-get install autoconf automake pkg-config libevent-dev libpcre3-dev libssl-dev
73+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev libssl-dev
74+
1775
- name: Build
18-
run: autoreconf -ivf && ./configure && make
76+
# for coverage reports we need to use Ubuntu 22.04 or lower
77+
# (given Ubuntu 24.04 uses lcov >= 2.0 which is not support on autoconf still)
78+
run: autoreconf -ivf && ./configure --enable-code-coverage && make -j
1979
- name: Setup Python
20-
uses: actions/setup-python@v1
80+
uses: actions/setup-python@v2
2181
with:
22-
python-version: '3.6'
82+
python-version: '3.10'
83+
architecture: x64
2384

24-
- name: Cache pip
25-
uses: actions/cache@v1
26-
with:
27-
path: ~/.cache/pip # This path is specific to Ubuntu
28-
# Look to see if there is a cache hit for the corresponding requirements file
29-
key: ${{ runner.os }}-pip-${{ hashFiles('tests/test_requirements.txt') }}
30-
restore-keys: |
31-
${{ runner.os }}-pip-
32-
${{ runner.os }}-
3385
- name: Install Python dependencies
34-
run: pip install -r tests/test_requirements.txt
86+
run: pip install -r ./tests/test_requirements.txt
3587

36-
- name: Cache Redis
37-
id: cache-redis
38-
uses: actions/cache@v1
39-
with:
40-
path: /home/runner/work/memtier_benchmark/memtier_benchmark/redis
41-
key: ${{ runner.os }}-redis
88+
- name: Install Redis
89+
run: |
90+
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
91+
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
92+
sudo apt-get -qq update
93+
sudo apt-get install redis
94+
sudo service redis-server stop
95+
96+
- name: Increase connection limit
97+
run: |
98+
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
99+
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
100+
ulimit -n 40960
42101
43-
- name: Install Redis Server test dependencies
44-
if: steps.cache-redis.outputs.cache-hit != 'true'
102+
- name: Generate TLS test certificates
103+
if: matrix.platform == 'ubuntu-latest'
45104
run: |
46-
git clone git://github.com/antirez/redis.git --branch unstable
47-
cd redis
48-
make BUILD_TLS=yes
49-
./utils/gen-test-certs.sh
50-
./src/redis-server --version
51-
cd ..
105+
./tests/gen-test-certs.sh
52106
53107
- name: Test OSS TCP
108+
timeout-minutes: 10
54109
run: |
55-
cd tests
56-
MEMTIER_BINARY=./../memtier_benchmark \
57-
python3 -m RLTest \
58-
--env oss -v --clear-logs \
59-
--oss-redis-path ../redis/src/redis-server
60-
cd ..
110+
./tests/run_tests.sh
61111
62112
- name: Test OSS TCP TLS
63113
if: matrix.platform == 'ubuntu-latest'
114+
timeout-minutes: 10
115+
run: |
116+
TLS=1 ./tests/run_tests.sh
117+
118+
- name: Test OSS TCP TLS v1.2
119+
if: matrix.platform == 'ubuntu-latest'
120+
timeout-minutes: 10
64121
run: |
65-
cd tests
66-
TLS_CERT=../redis/tests/tls/redis.crt \
67-
TLS_KEY=../redis/tests/tls/redis.key \
68-
TLS_CACERT=../redis/tests/tls/ca.crt \
69-
MEMTIER_BINARY=../memtier_benchmark \
70-
python3 -m RLTest \
71-
--env oss -v --clear-logs \
72-
--oss-redis-path ../redis/src/redis-server \
73-
--tls-cert-file ../redis/tests/tls/redis.crt \
74-
--tls-key-file ../redis/tests/tls/redis.key \
75-
--tls-ca-cert-file ../redis/tests/tls/ca.crt \
76-
--tls
77-
cd ..
122+
TLS_PROTOCOLS='TLSv1.2' VERBOSE=1 TLS=1 ./tests/run_tests.sh
123+
124+
- name: Test OSS TCP TLS v1.3
125+
if: matrix.platform == 'ubuntu-latest'
126+
timeout-minutes: 10
127+
run: |
128+
TLS_PROTOCOLS='TLSv1.3' VERBOSE=1 TLS=1 ./tests/run_tests.sh
78129
79130
- name: Test OSS-CLUSTER TCP
131+
timeout-minutes: 10
80132
run: |
81-
cd tests
82-
MEMTIER_BINARY=./../memtier_benchmark \
83-
python3 -m RLTest \
84-
--env oss-cluster -v --clear-logs --shards-count 3 \
85-
--oss-redis-path ../redis/src/redis-server
86-
cd ..
133+
OSS_STANDALONE=0 OSS_CLUSTER=1 VERBOSE=1 \
134+
./tests/run_tests.sh
87135
88136
- name: Test OSS-CLUSTER TCP TLS
137+
timeout-minutes: 10
89138
if: matrix.platform == 'ubuntu-latest'
90139
run: |
91-
cd tests
92-
TLS_CERT=../redis/tests/tls/redis.crt \
93-
TLS_KEY=../redis/tests/tls/redis.key \
94-
TLS_CACERT=../redis/tests/tls/ca.crt \
95-
MEMTIER_BINARY=../memtier_benchmark \
96-
python3 -m RLTest \
97-
--env oss-cluster --shards-count 3 -v --clear-logs \
98-
--oss-redis-path ../redis/src/redis-server \
99-
--tls-cert-file ../redis/tests/tls/redis.crt \
100-
--tls-key-file ../redis/tests/tls/redis.key \
101-
--tls-ca-cert-file ../redis/tests/tls/ca.crt \
102-
--tls
103-
cd ..
140+
OSS_STANDALONE=0 OSS_CLUSTER=1 TLS=1 VERBOSE=1 \
141+
./tests/run_tests.sh
142+
143+
- name: Capture code coverage
144+
timeout-minutes: 6
145+
if: matrix.platform == 'ubuntu-latest'
146+
run: |
147+
make code-coverage-capture
148+
bash <(curl -s https://codecov.io/bash) -f memtier_benchmark-*-coverage.info || echo "Codecov did not collect coverage reports"
104149
105150
build-macos:
106151
strategy:
107152
matrix:
108-
platform: [macos-latest]
153+
openssl: ["3.0"]
154+
runs-on: macos-latest
155+
continue-on-error: true
156+
steps:
157+
- uses: actions/checkout@v4
158+
- name: Install dependencies
159+
run: brew install autoconf automake libtool libevent openssl@${{ matrix.openssl }}
160+
- name: Build
161+
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@${{ matrix.openssl }}`/lib/pkgconfig ./configure && make
162+
163+
# According to https://github.com/actions/runner-images/blob/macos-14-arm64/20241119.509/images/macos/macos-14-arm64-Readme.md
164+
# [macOS] OpenSSL 1.1 will be removed and OpenSSL 3 will be the default for all macOS images from November 4, 2024
165+
# so use macos-13 which does not have the deprecation notice
166+
# macos-13 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
167+
build-macos-openssl-1-1:
168+
strategy:
169+
matrix:
170+
platform: [macos-13]
171+
runs-on: ${{ matrix.platform }}
172+
steps:
173+
- uses: actions/checkout@v4
174+
- name: Install dependencies
175+
run: brew install autoconf automake libtool libevent openssl@1.1
176+
- name: Build
177+
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@1.1`/lib/pkgconfig ./configure && make
178+
179+
180+
build-macos-openssl-1-0-2:
181+
strategy:
182+
matrix:
183+
platform: [macos-13]
109184
runs-on: ${{ matrix.platform }}
110185
steps:
111-
- uses: actions/checkout@v1
186+
- uses: actions/checkout@v4
112187
- name: Install dependencies
113-
run: brew install autoconf automake libtool libevent pkg-config openssl@1.1
188+
run: brew install autoconf automake libtool libevent pkg-config
189+
- name: Install openssl v1.0.2
190+
run: brew install rbenv/tap/openssl@1.0
114191
- name: Build
115-
run: autoreconf -ivf && PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig ./configure && make
192+
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@1.0`/lib/pkgconfig ./configure && make

.github/workflows/dockers.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
3+
name: Build dockers
4+
5+
on:
6+
7+
push:
8+
branches:
9+
- master
10+
11+
workflow_dispatch:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
17+
docker:
18+
name: Build dockers
19+
runs-on: ubuntu-latest
20+
if: (github.repository == 'redislabs/memtier_benchmark')
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- uses: docker/setup-qemu-action@v2
26+
- uses: docker/setup-buildx-action@v2
27+
with:
28+
install: true
29+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
30+
31+
- uses: docker/login-action@v2
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: build and push in master
37+
uses: docker/build-push-action@v4
38+
if: ${{ github.event.release.tag_name == '' }}
39+
with:
40+
push: true
41+
tags: ${{ vars.DOCKERHUB_REPO }}:edge
42+
context: .
43+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
44+
45+
- name: build and push on release
46+
uses: docker/build-push-action@v4
47+
if: ${{ github.event.release.tag_name != '' }}
48+
with:
49+
push: true
50+
tags: ${{ vars.DOCKERHUB_REPO }}:${{ github.event.release.tag_name }}
51+
context: .
52+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7

0 commit comments

Comments
 (0)