From 13b0ccc706b3ef8ddd7b261674db54e5b865ce1c Mon Sep 17 00:00:00 2001 From: Jamon Date: Wed, 9 Oct 2024 17:29:34 -0400 Subject: [PATCH] Add redis-valkey pipelines Signed-off-by: Jamon --- pkg/build/pipelines/redis-valkey/make.yaml | 23 +++++++++++ .../redis-valkey/subpackage-benchmark.yaml | 17 ++++++++ .../redis-valkey/subpackage-cli.yaml | 17 ++++++++ pkg/build/pipelines/redis-valkey/tests.yaml | 40 +++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 pkg/build/pipelines/redis-valkey/make.yaml create mode 100644 pkg/build/pipelines/redis-valkey/subpackage-benchmark.yaml create mode 100644 pkg/build/pipelines/redis-valkey/subpackage-cli.yaml create mode 100644 pkg/build/pipelines/redis-valkey/tests.yaml diff --git a/pkg/build/pipelines/redis-valkey/make.yaml b/pkg/build/pipelines/redis-valkey/make.yaml new file mode 100644 index 000000000..b318736d8 --- /dev/null +++ b/pkg/build/pipelines/redis-valkey/make.yaml @@ -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" diff --git a/pkg/build/pipelines/redis-valkey/subpackage-benchmark.yaml b/pkg/build/pipelines/redis-valkey/subpackage-benchmark.yaml new file mode 100644 index 000000000..9150934ec --- /dev/null +++ b/pkg/build/pipelines/redis-valkey/subpackage-benchmark.yaml @@ -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}} diff --git a/pkg/build/pipelines/redis-valkey/subpackage-cli.yaml b/pkg/build/pipelines/redis-valkey/subpackage-cli.yaml new file mode 100644 index 000000000..c301c2211 --- /dev/null +++ b/pkg/build/pipelines/redis-valkey/subpackage-cli.yaml @@ -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}} diff --git a/pkg/build/pipelines/redis-valkey/tests.yaml b/pkg/build/pipelines/redis-valkey/tests.yaml new file mode 100644 index 000000000..9e14f2ba5 --- /dev/null +++ b/pkg/build/pipelines/redis-valkey/tests.yaml @@ -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 <> /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