Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redis-valkey pipelines #1551

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pkg/build/pipelines/redis-valkey/make.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run make for redis/valkey

inputs:
dir:
description: |
The directory containing the codebase.
default: .
opts:
description: |
Options to pass to the make command.
default: ''

needs:
packages:
- make

pipeline:
- runs: |
export CFLAGS="$CFLAGS -DUSE_MALLOC_USABLE_SIZE ${{inputs.opts}}"
make \
BUILD_TLS=yes \
all -j$(nproc)
make install PREFIX=/usr INSTALL_BIN="${{targets.destdir}}/usr/bin"
17 changes: 17 additions & 0 deletions pkg/build/pipelines/redis-valkey/subpackage-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Create benchamark subpackage for redis/valkey

inputs:
project:
description: |
The project name (redis or valkey)
required: true

pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/bin
mv "${{targets.destdir}}"/usr/bin/${{inputs.project}}-benchmark "${{targets.subpkgdir}}"/usr/bin/${{inputs.project}}-benchmark

description: ${{inputs.project}}-benchmark utility that simulates running commands done by N clients while at the same time sending M total queries

provides:
- ${{inputs.project}}-benchmark=${{package.full-version}}
17 changes: 17 additions & 0 deletions pkg/build/pipelines/redis-valkey/subpackage-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Create cli subpackage for redis/valkey

inputs:
project:
description: |
The project name (redis or valkey)
required: true

pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/bin
mv "${{targets.destdir}}"/usr/bin/${{inputs.project}}-cli "${{targets.subpkgdir}}"/usr/bin/${{inputs.project}}-cli

description: ${{inputs.project}}-cli is the command line interface utility to talk with ${{inputs.project}}.

provides:
- ${{inputs.project}}-cli=${{package.full-version}}
Copy link
Contributor

@xnox xnox Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen such syntax before. Is there an example build of how this will be used? I.e. draft pr against wolfi with these pipelines added into ./pipelines/ directory to see this in action?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah @xnox I made a PR here that will use this pipeline once it is merged: wolfi-dev/os#30469

40 changes: 40 additions & 0 deletions pkg/build/pipelines/redis-valkey/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run tests for redis/valkey

needs:
packages:
- make

inputs:
project:
description: |
The project name (redis or valkey)
required: true

pipeline:
- runs: |
cat <<EOF >> /tmp/config
dbfilename dump.rdb
pidfile /tmp/6379.pid
dir /tmp/
EOF

${{inputs.project}}-server /tmp/config &
sleep 2 # wait for ${{inputs.project}} to start
${{inputs.project}}-cli SET bike:1 "Process 134" || exit 1
${{inputs.project}}-cli GET bike:1 | grep 'Process 134' || exit 1
${{inputs.project}}-cli exists bike:1 | grep 1 || exit 1
${{inputs.project}}-cli exists bike:2 | grep 0 || exit 1
${{inputs.project}}-cli save
# these are used in the case of symlinks in valkey packages
if [ "${{inputs.project}}" -eq "valkey" ]; then
redis-check-aof --version
redis-check-rdb --version
redis-sentinel --version
redis-server --version
fi
${{inputs.project}}-check-rdb /tmp/dump.rdb
${{inputs.project}}-sentinel --version
${{inputs.project}}-server --version

- runs: |
${{inputs.project}}-server --version | grep "jemalloc" || exit 1
Loading