Skip to content

Commit 91f17f5

Browse files
author
thuongtruong109
committed
fix(configs): dockerfile tarball build cluster benchmark
1 parent deb7447 commit 91f17f5

File tree

6 files changed

+41
-34
lines changed

6 files changed

+41
-34
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
- name: 🏗️ Build & Push Cluster Benchmark Image
5959
run: |
6060
docker compose -f docker-compose.cluster.yml build --progress=plain
61+
# docker build -f configs/cluster/Dockerfile.bench -t $(CLT_BENCH_IMAGE) .
6162
6263
docker tag thuongtruong1009/${{ env.IMAGE_NAME }}:latest \
6364
${{ env.REGISTRY }}/${{ github.repository }}-bench:latest

.github/workflows/ci.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ jobs:
9595
replica-performance-tests:
9696
runs-on: ubuntu-latest
9797
needs: [replica-integration-tests]
98-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
9998
steps:
10099
- name: Checkout code
101100
uses: actions/checkout@v4
@@ -236,6 +235,7 @@ jobs:
236235
with:
237236
name: redis-rollback-logs
238237
path: /tmp/redis_cluster_rollback.log
238+
compression-level: 9
239239

240240
cluster-integration-tests:
241241
runs-on: ubuntu-latest
@@ -273,7 +273,6 @@ jobs:
273273
cluster-performance-tests:
274274
runs-on: ubuntu-latest
275275
needs: [cluster-integration-tests]
276-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
277276
env:
278277
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
279278
steps:
@@ -296,6 +295,7 @@ jobs:
296295
with:
297296
name: redis-benchmark-results
298297
path: ./benchmark-results
298+
compression-level: 9
299299

300300
- name: Shutdown cluster services
301301
if: always()
@@ -322,23 +322,3 @@ jobs:
322322
- name: Notify on failure
323323
if: ${{ contains(needs.*.result, 'failure') }}
324324
run: echo "❌ One or more jobs failed! Check the logs for details."
325-
326-
# - name: Notify on success
327-
# if: ${{ needs.replica-integration-tests.result != 'failure' &&
328-
# needs.replica-performance-tests.result != 'failure' &&
329-
# needs.replica-security-scan.result != 'failure' &&
330-
# needs.cluster-health-check.result != 'failure' &&
331-
# needs.cluster-integration-tests.result != 'failure' &&
332-
# needs.cluster-performance-tests.result != 'failure' &&
333-
# needs.cluster-security-scan.result != 'failure' }}
334-
# run: echo "✅ All jobs passed! Redis cluster and replica are healthy."
335-
336-
# - name: Notify on failure
337-
# if: ${{ needs.replica-integration-tests.result == 'failure' ||
338-
# needs.replica-performance-tests.result == 'failure' ||
339-
# needs.replica-security-scan.result == 'failure' ||
340-
# needs.cluster-health-check.result == 'failure' ||
341-
# needs.cluster-integration-tests.result == 'failure' ||
342-
# needs.cluster-performance-tests.result == 'failure' ||
343-
# needs.cluster-security-scan.result == 'failure' }}
344-
# run: echo "❌ One or more jobs failed! Check the logs for details."

.github/workflows/toolchain.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
sarif_file: hadolint-results.sarif
6363
wait-for-processing: true
6464

65-
docker-build-and-scan:
65+
vulnerability-scan:
6666
runs-on: ubuntu-latest
6767
steps:
6868
- name: Checkout code
@@ -71,14 +71,31 @@ jobs:
7171
- name: Set up Docker Buildx
7272
uses: docker/setup-buildx-action@v3
7373

74+
- name: Cache Trivy database
75+
uses: actions/cache@v4
76+
with:
77+
path: ~/.cache/trivy
78+
key: ${{ runner.os }}-trivy
79+
7480
- name: Build Docker image
7581
run: |
76-
docker build -t thuongtruong1009/reluster-bench -f configs/cluster/Dockerfile.bench .
82+
docker build -f configs/cluster/Dockerfile -t reluster .
83+
docker build -f configs/cluster/Dockerfile.bench -t reluster-bench .
7784
78-
- name: Run Trivy vulnerability scanner
79-
uses: aquasecurity/trivy-action@0.20.0
85+
- name: Run Trivy scan for reluster
86+
uses: aquasecurity/trivy-action@0.28.0
8087
with:
81-
image-ref: thuongtruong1009/reluster-bench
88+
image-ref: reluster
89+
format: table
90+
exit-code: "1"
91+
ignore-unfixed: true
92+
vuln-type: "os,library"
93+
severity: "CRITICAL,HIGH"
94+
95+
- name: Run Trivy scan for reluster-bench
96+
uses: aquasecurity/[email protected]
97+
with:
98+
image-ref: reluster-bench
8299
format: table
83100
exit-code: "1"
84101
ignore-unfixed: true
@@ -117,6 +134,10 @@ jobs:
117134
runs-on: ubuntu-latest
118135
steps:
119136
- uses: actions/checkout@v4
137+
138+
# - name: Run TruffleHog
139+
# run: trufflehog filesystem --directory . --json --redact > trufflehog-results.json
140+
120141
- name: Run TruffleHog
121142
uses: trufflesecurity/[email protected]
122143
with:
@@ -129,3 +150,4 @@ jobs:
129150
with:
130151
name: trufflehog-results
131152
path: trufflehog-results.json
153+
compression-level: 9

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ clean:
143143
ci:
144144
act -W .github/workflows/ci.yml --rm --pull=false --secret DOCKER_USERNAME= --secret DOCKER_PASSWORD=
145145

146-
147146
demo-ping:
148147
# docker compose -f docker-compose.cluster.dev.yml up -d --build --force-recreate node-1 node-2 node-3 node-4 node-5 node-6
149148
# docker exec -it node-1 redis-cli -a $(REDIS_PASSWORD) --cluster create 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384 --cluster-replicas 1 --cluster-yes

configs/cluster/Dockerfile.bench

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ FROM ubuntu:22.04@sha256:4e0171b9275e12d375863f2b3ae9ce00a4c53ddda176bd55868df97
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
5+
ca-certificates \
56
redis-tools bc build-essential autoconf automake \
6-
libpcre3-dev libevent-dev pkg-config zlib1g-dev git libssl-dev wget unzip && \
7+
libpcre3-dev libevent-dev pkg-config zlib1g-dev libssl-dev wget unzip && \
8+
update-ca-certificates && \
79
rm -rf /var/lib/apt/lists/*
810

911
WORKDIR /tmp
10-
RUN git clone https://github.com/RedisLabs/memtier_benchmark.git /memtier_benchmark && \
11-
cd /memtier_benchmark && \
12+
ENV MEMTIER_VERSION=2.1.0
13+
RUN wget -q https://github.com/RedisLabs/memtier_benchmark/archive/refs/tags/${MEMTIER_VERSION}.tar.gz -O memtier.tar.gz && \
14+
tar -xzf memtier.tar.gz && \
15+
cd memtier_benchmark-${MEMTIER_VERSION} && \
1216
autoreconf -ivf && \
1317
./configure && \
1418
make && \
1519
make install && \
16-
rm -rf /memtier_benchmark
20+
cd / && rm -rf /tmp/*
1721

1822
RUN groupadd -r bench && useradd -r -g bench bench
1923
WORKDIR /app

docker-compose.cluster.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ services:
8383
context: .
8484
dockerfile: ./configs/cluster/Dockerfile.bench
8585
environment:
86-
- CLUSTER_PASS=${REDIS_PASSWORD}
86+
- REDIS_PASSWORD=${REDIS_PASSWORD}
8787
- REDIS_HOST=node-1
8888
networks:
8989
- redisnet
9090
volumes:
91-
- ./benchmark-results:/benchmark-results
91+
- ./benchmark-results:/results
92+
restart: "no"
9293
depends_on:
9394
- node-1
9495
- node-2

0 commit comments

Comments
 (0)