From f00c3c50e42de1142ada8387cfd81bd87f50169b Mon Sep 17 00:00:00 2001 From: Veenious Geevarghese Date: Fri, 14 Aug 2026 16:02:08 +0530 Subject: [PATCH 1/5] buildscript patch and dcokerfile added for redis 8.8.0 --- .../Dockerfiles/8.8.0_ubi_9.8/Dockerfile | 483 ++++++++++++++ .../Dockerfiles/8.8.0_ubi_9.8/README.md | 309 +++++++++ r/redis-bv/build_info.json | 12 +- r/redis-bv/redis-bv_8.8.0.patch | 79 +++ r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh | 598 ++++++++++++++++++ 5 files changed, 1477 insertions(+), 4 deletions(-) create mode 100644 r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile create mode 100644 r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/README.md create mode 100644 r/redis-bv/redis-bv_8.8.0.patch create mode 100644 r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile new file mode 100644 index 0000000000..7a964a3b69 --- /dev/null +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile @@ -0,0 +1,483 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +# Stage 1: Build utilities from source using secure Go version (resolves stdlib CVEs) +FROM registry.access.redhat.com/ubi9/ubi:9.8 AS setupbuilder + +ARG REDIS_VERSION=8.8.0 +ARG BITNAMI_COMMIT=731e897 +ARG GO_VERSION=1.26.5 + +# Install build dependencies and update system packages +RUN yum update -y && yum install -y git wget tar gcc && yum clean all + +# Install secure Go version to fix stdlib CVEs (CVE-2025-68121, CVE-2025-58183, etc.) +RUN wget -q https://go.dev/dl/go${GO_VERSION}.linux-ppc64le.tar.gz && \ + tar -C /usr/local -xzf go${GO_VERSION}.linux-ppc64le.tar.gz && \ + rm go${GO_VERSION}.linux-ppc64le.tar.gz + +ENV PATH="/usr/local/go/bin:$PATH" + +# Build wait-for-port from source +RUN git clone https://github.com/bitnami/wait-for-port /build/wait-for-port && \ + cd /build/wait-for-port && \ + git checkout v1.0.10 && \ + go build . + +# Build gosu from source with secure Go version (fixes 8 stdlib CVEs in pre-compiled binary) +RUN cd /build && \ + git clone https://github.com/tianon/gosu && \ + cd gosu && \ + git checkout 1.19 && \ + CGO_ENABLED=0 go build -o gosu . + +# Assemble prebuildfs from Bitnami containers repo (commit 731e897 = 8.8.0-debian-12-r3) +RUN git clone https://github.com/bitnami/containers /build/containers && \ + cd /build/containers && \ + git checkout ${BITNAMI_COMMIT} + +RUN cd /build/containers/bitnami/redis/8.8/debian-12 && \ + wget https://downloads.bitnami.com/files/stacksmith/redis-${REDIS_VERSION}-0-linux-amd64-debian-12.tar.gz && \ + tar -xvf redis-${REDIS_VERSION}-0-linux-amd64-debian-12.tar.gz && \ + mkdir -p prebuildfs/opt/bitnami/redis/etc && \ + cp redis-${REDIS_VERSION}-linux-amd64-debian-12/files/redis/etc/redis-default.conf \ + prebuildfs/opt/bitnami/redis/etc/ + +# ---------------------------------------------------------------------------- +# Stage 2: Build Redis 8.8.0 with all 4 modules for ppc64le +# ---------------------------------------------------------------------------- +FROM registry.access.redhat.com/ubi9/ubi:9.8 AS redisbuilder + +WORKDIR /build + +RUN yum update -y && \ + yum install -y \ + git \ + gcc \ + gcc-c++ \ + make \ + autoconf \ + automake \ + libtool \ + diffutils \ + tcl \ + procps-ng \ + libstdc++-devel \ + patch \ + cmake \ + python3 \ + python3-devel \ + openssl-devel \ + rust \ + cargo \ + clang-devel \ + util-linux \ + llvm-devel \ + lld && \ + yum update -y python3 python3-libs openssh openssh-clients vim-minimal libarchive libcap && \ + yum clean all && \ + rm -rf /var/cache/yum + +# Ensure python is available under all expected names +RUN mkdir -p /usr/local/bin && \ + ln -sf /usr/bin/python3 /usr/local/bin/python3 && \ + ln -sf /usr/bin/python3 /usr/local/bin/python && \ + ln -sf /usr/bin/python3 /usr/bin/python && \ + python3 --version + +COPY redis-bv_8.8.0.patch /build/ + +# Clone Redis 8.8.0 and apply ppc64le patch +RUN git clone https://github.com/redis/redis /build/redis && \ + cd /build/redis && \ + git checkout 8.8.0 && \ + git apply /build/redis-bv_8.8.0.patch + +# Fix modules/Makefile - add ppc64le Rust toolchain case +RUN cd /build/redis && python3 << 'EOF' +content = open('modules/Makefile').read() +old = "\t\t\tfi ;; \\\n\t\t*) echo" +new = "\t\t\tfi ;; \\\n\t\t'ppc64le') \\\n\t\t\tRUST_INSTALLER=\"rust-$${RUST_VERSION}-powerpc64le-unknown-linux-gnu\"; \\\n\t\t\tRUST_SHA256=\"\"; \\\n\t\t\t;; \\\n\t\t*) echo" +assert old in content, "NO MATCH - modules/Makefile" +open('modules/Makefile', 'w').write(content.replace(old, new)) +print("OK") +EOF + +# Fix modules/common.mk - add ppc64le arch map entry +RUN cd /build/redis && python3 << 'EOF' +content = open('modules/common.mk').read() +old = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8" +new = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8\nARCH_MAP_ppc64le := ppc64le" +assert old in content, "NO MATCH - common.mk" +open('modules/common.mk', 'w').write(content.replace(old, new)) +print("OK") +EOF + +# First build pass - clones all module sources (redisjson, redistimeseries, +# redisbloom, redisearch). Expected to fail on ppc64le arch guards; that is OK. +RUN cd /build/redis && \ + EXTRA_CFLAGS="" && \ + if [[ $(uname -m) == "ppc64le" ]]; then \ + if grep -iq "POWER10" /proc/cpuinfo || lscpu | grep -iq "POWER10"; then \ + echo "Power10 CPU detected - applying P10 optimisation flags" && \ + EXTRA_CFLAGS="-mcpu=power10 -mtune=power10"; \ + fi \ + fi && \ + export BUILD_WITH_MODULES=yes && \ + export DISABLE_WERRORS=yes && \ + export IGNORE_MISSING_DEPS=1 && \ + unset INSTALL_RUST_TOOLCHAIN && \ + make MALLOC=libc EXTRA_CFLAGS="$EXTRA_CFLAGS" -j "$(nproc)" all IGNORE_MISSING_DEPS=1 || true + +# Fix RedisTimeSeries - remove ppc64le architecture restriction +RUN find /build/redis/modules/redistimeseries -name "Makefile" \ + | xargs grep -l "only supports 64-bit\|arm64v8" 2>/dev/null \ + | while read mk; do \ + sed -i '/only supports 64-bit/{ N; d }' "$mk" || true; \ + sed -i '/^ifneq.*ARCH.*arm64v8/,/^endif/d' "$mk" || true; \ + done; true + +# Fix RedisBloom - remove ppc64le architecture restriction +RUN find /build/redis/modules/redisbloom -name "Makefile" \ + | xargs grep -l "only supports 64-bit\|arm64v8" 2>/dev/null \ + | while read mk; do \ + sed -i '/only supports 64-bit/{ N; d }' "$mk" || true; \ + sed -i '/^ifneq.*ARCH.*arm64v8/,/^endif/d' "$mk" || true; \ + done; true + +# Fix RediSearch - disable SVS (x86-only ScalableVectorSearch) via cmake flag +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-maxdepth', '1', '-name', 'build.sh'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found RediSearch build.sh candidates: {files}") +for path in files: + content = open(path).read() + old = 'CMAKE_BASIC_ARGS="$CMAKE_BASIC_ARGS -DSVS_SHARED_LIB=OFF"' + new = 'CMAKE_BASIC_ARGS="$CMAKE_BASIC_ARGS -DSVS_SHARED_LIB=OFF -DUSE_SVS=OFF"' + if '-DUSE_SVS=OFF' in content: + print(f"SKIP - already has -DUSE_SVS=OFF: {path}") + elif old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - added -DUSE_SVS=OFF in {path}") + else: + print(f"WARN - anchor not found in {path}") +EOF + +# Fix RediSearch Rust - RS_FIELDMASK_ALL: u128::MAX -> u64::MAX in ffi/src/lib.rs +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/ffi/src/lib.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found ffi/src/lib.rs: {files}") +for path in files: + content = open(path).read() + old = "pub const RS_FIELDMASK_ALL: FieldMask = u128::MAX;" + new = "pub const RS_FIELDMASK_ALL: FieldMask = u64::MAX;" + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - {path}") + elif new in content: + print(f"SKIP - already patched: {path}") + else: + print(f"WARN - pattern not found in {path}") +EOF + +# Fix RediSearch Rust - blocklist RS_FIELDMASK_ALL in ffi/build.rs (prevents +# bindgen emitting a conflicting i32 from the C macro "#define RS_FIELDMASK_ALL -1") +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/ffi/build.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found ffi/build.rs: {files}") +for path in files: + content = open(path).read() + anchors = [ + ('.blocklist_type("QueryProcessingCtx")', + '.blocklist_item("RS_FIELDMASK_ALL")\n .blocklist_type("QueryProcessingCtx")'), + ('.allowlist_recursively(true)', + '.allowlist_recursively(true)\n .blocklist_item("RS_FIELDMASK_ALL")'), + ] + patched = False + for old, new in anchors: + if '.blocklist_item("RS_FIELDMASK_ALL")' in content: + print(f"SKIP - already patched: {path}"); patched = True; break + if old in content: + open(path, 'w').write(content.replace(old, new, 1)) + print(f"OK - {path}"); patched = True; break + if not patched: + print(f"WARN - no anchor found in {path}") +EOF + +# Fix RediSearch Rust - u128::read_as_varint -> u64::read_as_varint in fields_only.rs +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-name', 'fields_only.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found fields_only.rs: {files}") +for path in files: + content = open(path).read() + old = "let field_mask = u128::read_as_varint(cursor)?;" + new = "let field_mask = u64::read_as_varint(cursor)?;" + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - {path}") + elif new in content: + print(f"SKIP - already patched: {path}") + else: + print(f"WARN - pattern not found in {path}") +EOF + +# Fix RediSearch Rust - explicit cast in index_result source files +# (index_result is a directory/module in 8.8.0, not a single file) +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-name', '*.rs', '-path', '*/index_result*'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found index_result source files: {files}") +patched = 0 +for path in files: + content = open(path).read() + if "field_mask: RS_FIELDMASK_ALL," in content: + count = content.count("field_mask: RS_FIELDMASK_ALL,") + open(path, 'w').write( + content.replace("field_mask: RS_FIELDMASK_ALL,", + "field_mask: RS_FIELDMASK_ALL as t_fieldMask,") + ) + print(f"OK - replaced {count} occurrence(s) in {path}") + patched += count +if patched == 0: + print("WARN - pattern not found in any index_result source file") +EOF + +# Fix VectorSimilarity - guard all SVS includes/code behind #if HAVE_SVS +# - tiered_factory.h: guard svs_tiered.h include +# - svs_factory.cpp: wrap entire file (CMakeLists.txt compiles it unconditionally) +# - vec_sim.cpp: guard svs_utils.h include and stub SVS-only functions +RUN cd /build/redis && python3 << 'EOF' +import subprocess + +# 1. tiered_factory.h +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/index_factories/tiered_factory.h'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + content = open(path).read() + old = '#include "VecSim/algorithms/svs/svs_tiered.h"' + new = '#if HAVE_SVS\n#include "VecSim/algorithms/svs/svs_tiered.h"\n#endif' + if new in content: + print(f"SKIP tiered_factory.h") + elif old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - tiered_factory.h: {path}") + else: + print(f"WARN - svs_tiered.h include not found in {path}") + +# 2. svs_factory.cpp - wrap entire file +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/index_factories/svs_factory.cpp'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + content = open(path).read() + if '#if HAVE_SVS' in content: + print(f"SKIP svs_factory.cpp") + continue + open(path, 'w').write('#if HAVE_SVS\n' + content + '\n#endif // HAVE_SVS\n') + print(f"OK - svs_factory.cpp wrapped: {path}") + +# 3. vec_sim.cpp - per-line guards +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/VecSim/vec_sim.cpp'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + lines = open(path).read().splitlines(keepends=True) + if any('#if HAVE_SVS' in l for l in lines): + print(f"SKIP vec_sim.cpp") + continue + out = [] + i = 0 + p_inc = p_resize = p_shared = False + while i < len(lines): + line = lines[i] + if '#include "VecSim/algorithms/svs/svs_utils.h"' in line and not p_inc: + out += ['#if HAVE_SVS\n', line, '#endif\n'] + p_inc = True; i += 1; continue + if 'VecSimSVSThreadPool::resize(' in line and not p_resize: + out += ['#if HAVE_SVS\n', line, '#endif\n'] + p_resize = True; i += 1; continue + if 'VecSimSVSThreadPool::getSharedAllocationSize()' in line and not p_shared: + out += ['#if HAVE_SVS\n', line, '#else\n return 0;\n#endif\n'] + p_shared = True; i += 1; continue + out.append(line); i += 1 + open(path, 'w').write(''.join(out)) + summary = [s for s, f in [('svs_utils.h',p_inc),('resize',p_resize),('getSharedAllocationSize',p_shared)] if f] + print(f"OK - vec_sim.cpp: guarded {', '.join(summary) or 'nothing (WARN)'}") +EOF + +# Fix VectorSimilarity - add ppc64le CPU features support in spaces.h +RUN cd /build/redis && python3 << 'EOF' +import subprocess +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/spaces/spaces.h'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found spaces.h: {files}") +old = """#if defined(CPU_FEATURES_ARCH_AARCH64) + using FeaturesType = cpu_features::Aarch64Features; + constexpr auto getFeatures = cpu_features::GetAarch64Info; +#else + using FeaturesType = cpu_features::X86Features; // Fallback + constexpr auto getFeatures = cpu_features::GetX86Info; +#endif + return arch_opt ? *static_cast(arch_opt) : getFeatures().features;""" +new = """#if defined(CPU_FEATURES_ARCH_AARCH64) + using FeaturesType = cpu_features::Aarch64Features; + constexpr auto getFeatures = cpu_features::GetAarch64Info; + return arch_opt ? *static_cast(arch_opt) : getFeatures().features; +#elif defined(__powerpc64__) + struct EmptyFeatures {}; + return EmptyFeatures{}; +#else + using FeaturesType = cpu_features::X86Features; // Fallback + constexpr auto getFeatures = cpu_features::GetX86Info; + return arch_opt ? *static_cast(arch_opt) : getFeatures().features; +#endif""" +patched = False +for path in files: + try: + content = open(path).read() + except OSError: + continue + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - {path}"); patched = True; break +if not patched: + print("WARN - spaces.h pattern not found") +EOF + +# Wipe CMake and Rust build caches so all patched sources recompile cleanly +RUN rm -rf /build/redis/modules/redisearch/src/bin/linux-ppc64le-release/ \ + /build/redis/modules/redisearch/src/bin/redisearch_rs/ + +# Final build pass with all fixes applied +RUN cd /build/redis && \ + EXTRA_CFLAGS="" && \ + if [[ $(uname -m) == "ppc64le" ]]; then \ + if grep -iq "POWER10" /proc/cpuinfo || lscpu | grep -iq "POWER10"; then \ + echo "Power10 CPU detected - applying P10 optimisation flags" && \ + EXTRA_CFLAGS="-mcpu=power10 -mtune=power10"; \ + fi \ + fi && \ + export BUILD_WITH_MODULES=yes && \ + export DISABLE_WERRORS=yes && \ + export IGNORE_MISSING_DEPS=1 && \ + export PATH="/usr/bin:/usr/local/bin:$PATH" && \ + export PYTHON3=/usr/bin/python3 && \ + export PYTHON=/usr/bin/python3 && \ + unset INSTALL_RUST_TOOLCHAIN && \ + which python3 && python3 --version && \ + make MALLOC=libc EXTRA_CFLAGS="$EXTRA_CFLAGS" -j "$(nproc)" all IGNORE_MISSING_DEPS=1 + +# Collect Redis binaries and all 4 module .so files +RUN mkdir -p /root/redis/bin /root/redis/modules && \ + find /build/redis/src -maxdepth 1 -type f -executable -name "redis-*" \ + -exec cp {} /root/redis/bin/ \; && \ + cp /build/redis/modules/redisbloom/redisbloom.so /root/redis/modules/ && \ + cp /build/redis/modules/redisearch/redisearch.so /root/redis/modules/ && \ + cp /build/redis/modules/redisjson/rejson.so /root/redis/modules/ && \ + cp /build/redis/modules/redistimeseries/redistimeseries.so /root/redis/modules/ && \ + ls -lh /root/redis/bin/ /root/redis/modules/ + +# Remove build-only packages to reduce layer size +RUN yum clean all && \ + rm -rf /var/cache/yum && \ + rpm -e --nodeps python3 python3-devel python3-libs 2>/dev/null || true + +# ---------------------------------------------------------------------------- +# Stage 3: Final runtime image +# ---------------------------------------------------------------------------- +FROM registry.access.redhat.com/ubi9/ubi:9.8 + +LABEL org.opencontainers.image.title="redis" \ + org.opencontainers.image.version="8.8.0" \ + org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/redis" \ + org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/redis/README.md" + +ENV HOME="/" \ + OS_ARCH="ppc64le" \ + OS_FLAVOUR="rhel9" \ + OS_NAME="linux" + +# Copy Bitnami prebuildfs (scripts, config, directory skeleton) +COPY --from=setupbuilder /build/containers/bitnami/redis/8.8/debian-12/prebuildfs / +COPY --from=setupbuilder /build/containers/bitnami/redis/8.8/debian-12/rootfs / + +# Install runtime dependencies and apply all security updates +RUN yum update -y && \ + yum install -y \ + acl \ + ca-certificates \ + curl-minimal \ + gzip \ + glibc \ + openssl \ + procps \ + tar \ + libgcc \ + libgomp \ + libstdc++ && \ + yum upgrade -y --allowerasing && \ + yum clean all && \ + rm -rf /var/cache/yum /var/tmp/* && \ + rpm -e --nodeps python3 python3-libs 2>/dev/null || true + +RUN chmod g+rwX /opt/bitnami +RUN ln -s /opt/bitnami/scripts/redis/entrypoint.sh /entrypoint.sh +RUN ln -s /opt/bitnami/scripts/redis/run.sh /run.sh +RUN /opt/bitnami/scripts/redis/postunpack.sh +RUN mkdir -p /opt/bitnami/common/bin && chmod g+rwX /opt/bitnami + +# Copy utilities built with secure Go (fixes gosu stdlib CVEs) +COPY --from=setupbuilder /build/wait-for-port/wait-for-port /opt/bitnami/common/bin/wait-for-port +COPY --from=setupbuilder /build/gosu/gosu /opt/bitnami/common/bin/gosu + +# Copy Redis binaries and modules built for ppc64le +COPY --from=redisbuilder /root/redis/bin /opt/bitnami/redis/bin +COPY --from=redisbuilder /root/redis/modules /opt/bitnami/redis/modules + +# Create module path expected by Bitnami Helm chart +# (chart uses /opt/bitnami/redis/lib/redis/modules/ in loadmodule directives) +RUN mkdir -p /opt/bitnami/redis/lib/redis/modules && \ + cp /opt/bitnami/redis/modules/*.so /opt/bitnami/redis/lib/redis/modules/ && \ + ls -lh /opt/bitnami/redis/lib/redis/modules/ + +RUN chmod +x /opt/bitnami/common/bin/gosu /opt/bitnami/common/bin/wait-for-port + +ENV APP_VERSION="8.8.0" \ + BITNAMI_APP_NAME="redis" \ + IMAGE_REVISION="0" \ + PATH="/opt/bitnami/common/bin:/opt/bitnami/redis/bin:$PATH" + +EXPOSE 6379 +USER 1001 +ENTRYPOINT [ "/opt/bitnami/scripts/redis/entrypoint.sh" ] +CMD [ "/opt/bitnami/scripts/redis/run.sh" ] diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/README.md b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/README.md new file mode 100644 index 0000000000..855b02340e --- /dev/null +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/README.md @@ -0,0 +1,309 @@ +# Redis 8.8.0 with Modules for ppc64le (Power Architecture) + +This repository contains the build configuration for Redis 8.8.0 with four essential modules compiled for ppc64le architecture and deployed on OpenShift. + +## Overview + +Custom Redis 8.8.0 image with the following modules: +- **RedisBloom** (v8.8.0) — Probabilistic data structures +- **RediSearch** (v8.8.0) — Full-text search and indexing +- **RedisJSON** (v8.8.0) — Native JSON data type +- **RedisTimeSeries** (v8.8.0) — Time-series data structures + +## Architecture + +- **Target Platform**: ppc64le (IBM POWER) +- **Base Image**: Red Hat UBI 9.8 +- **Redis Version**: 8.8.0 +- **Bitnami Containers Commit**: `731e897` (release 8.8.0-debian-12-r3) +- **Deployment**: OpenShift with Bitnami Helm Chart v24.1.8 + +## Files + +| File | Description | +|---|---| +| `Dockerfile` | Multi-stage build for Redis 8.8.0 on ppc64le | +| `redis-bv_8.8.0.patch` | ppc64le fixes applied to the Redis source tree | + +### Dockerfile + +Three-stage build: +1. **`setupbuilder`** — Builds `gosu` and `wait-for-port` with a secure Go version; assembles the Bitnami `prebuildfs` and `rootfs` from the upstream containers repo +2. **`redisbuilder`** — Compiles Redis 8.8.0 from source with all 4 modules on UBI 9.8 +3. **Final image** — UBI 9.8 runtime with only the necessary libraries; binaries and modules copied from builder stages + +**Key features:** +- All ppc64le architecture fixes applied at source level +- SVS (ScalableVectorSearch) disabled — x86-only component, not applicable to ppc64le +- Power10 CPU optimisations applied automatically when detected +- Security updates for all system packages +- `gosu` and `wait-for-port` compiled from source with latest Go (fixes stdlib CVEs) +- Module paths compatible with Bitnami Helm chart + +### redis-bv_8.8.0.patch + +Applied to the Redis 8.8.0 source tree via `git apply`. Contains: +- `src/debug.c` — ppc64le register dump for crash diagnostics (`logRegisters`) +- `tests/support/util.tcl` — disables backtrace tests on ppc64le (unreliable on this arch) + +### values.yaml (Helm) + +```yaml +global: + security: + allowInsecureImages: true + +architecture: standalone +fullnameOverride: "hcl-commerce-redis" + +replica: + replicaCount: 1 + +image: + registry: image-registry.openshift-image-registry.svc:5000 + repository: redislatest/bit-redis + tag: 8.8.0 + +auth: + enabled: false + +commonConfiguration: |- + appendonly no + save "" + maxmemory 1000mb + maxmemory-policy volatile-lru + loadmodule /opt/bitnami/redis/lib/redis/modules/redisbloom.so + loadmodule /opt/bitnami/redis/lib/redis/modules/redisearch.so + loadmodule /opt/bitnami/redis/lib/redis/modules/rejson.so + loadmodule /opt/bitnami/redis/lib/redis/modules/redistimeseries.so + +master: + disableCommands: [] + persistence: + enabled: false + resources: + limits: + cpu: 2000m + memory: 4Gi + requests: + cpu: 500m + memory: 2Gi +``` + +## Building the Image + +```bash +# Both files must be in the same directory +podman build -t redis-ppc64le:8.8.0-bv -f Dockerfile . + +# Tag for OpenShift internal registry +podman tag redis-ppc64le:8.8.0-bv \ + image-registry.openshift-image-registry.svc:5000/your-namespace/bit-redis:8.8.0 + +# Push to OpenShift +podman push \ + image-registry.openshift-image-registry.svc:5000/your-namespace/bit-redis:8.8.0 +``` + +## Deploying to OpenShift + +### Prerequisites +1. OpenShift cluster with internal registry enabled +2. Helm 3.x installed +3. Bitnami Redis Helm chart repository added + +### Deployment Steps + +```bash +# Add Bitnami Helm repository +helm repo add bitnami https://charts.bitnami.com/bitnami +helm repo update + +# Create namespace +oc new-project redis-namespace + +# Create service account +oc create serviceaccount hcl-commerce-redis -n redis-namespace + +# Grant privileged SCC (if required) +oc adm policy add-scc-to-user privileged -z hcl-commerce-redis -n redis-namespace + +# Install Redis with Helm +helm install redis-deployment bitnami/redis \ + -n redis-namespace \ + -f values.yaml \ + --version 24.1.8 +``` + +### Verify Deployment + +```bash +# Check pod status +oc get pods -n redis-namespace + +# Verify all 4 modules loaded +oc logs pod/hcl-commerce-redis-master-0 -n redis-namespace | grep "Module.*loaded" + +# Expected output: +# Module 'bf' loaded from /opt/bitnami/redis/lib/redis/modules/redisbloom.so +# Module 'search' loaded from /opt/bitnami/redis/lib/redis/modules/redisearch.so +# Module 'ReJSON' loaded from /opt/bitnami/redis/lib/redis/modules/rejson.so +# Module 'timeseries' loaded from /opt/bitnami/redis/lib/redis/modules/redistimeseries.so +``` + +## Testing Modules + +```bash +# Connect to Redis CLI +oc exec -it pod/hcl-commerce-redis-master-0 -n redis-namespace -- redis-cli + +# Test RedisBloom +BF.ADD mybloom item1 +BF.EXISTS mybloom item1 + +# Test RediSearch +FT.CREATE myindex ON HASH PREFIX 1 doc: SCHEMA title TEXT +HSET doc:1 title "Hello World" +FT.SEARCH myindex "hello" + +# Test RedisJSON +JSON.SET myjson $ '{"name":"Redis","version":"8.8.0"}' +JSON.GET myjson + +# Test RedisTimeSeries +TS.CREATE temperature RETENTION 86400000 LABELS sensor_id 1 location room +TS.ADD temperature * 23.5 +TS.RANGE temperature - + +``` + +## Configuration Details + +### Module Paths +Modules are installed at two locations for compatibility: +- `/opt/bitnami/redis/modules/` — Build output location +- `/opt/bitnami/redis/lib/redis/modules/` — Bitnami Helm chart expected location + +### Important Notes + +1. **Parameter Name**: Use `commonConfiguration:` (not `configuration:`) in values.yaml +2. **Module Paths**: Must use `/opt/bitnami/redis/lib/redis/modules/` prefix in `loadmodule` directives +3. **Image Size**: Final image is approximately 500 MB with all modules +4. **Security**: All system packages updated; Go utilities built from source with latest Go + +## Troubleshooting + +### Modules Not Loading + +**Symptom**: Only some modules (e.g. redisearch, rejson) load instead of all 4 + +**Solution**: Ensure `values.yaml` uses `commonConfiguration:` with all 4 `loadmodule` directives: + +```yaml +commonConfiguration: |- + loadmodule /opt/bitnami/redis/lib/redis/modules/redisbloom.so + loadmodule /opt/bitnami/redis/lib/redis/modules/redisearch.so + loadmodule /opt/bitnami/redis/lib/redis/modules/rejson.so + loadmodule /opt/bitnami/redis/lib/redis/modules/redistimeseries.so +``` + +### Pod CrashLoopBackOff + +**Check logs**: +```bash +oc logs pod/hcl-commerce-redis-master-0 -n redis-namespace +``` + +**Common causes**: +- Missing module `.so` files +- Incorrect module paths in `commonConfiguration` +- Insufficient permissions (check SCC assignment) + +### Build Failures + +**ppc64le-specific issues**: +- Confirm `lld` package is installed in `redisbuilder` stage (required by RediSearch Rust linker) +- Verify all inline Python source patches printed `OK` in build output +- Check that `IGNORE_MISSING_DEPS=1` is set for the first (priming) build pass + +## Architecture-Specific Fixes + +### Rust Support for ppc64le +- `modules/Makefile` — adds `ppc64le` case to Rust installer `case` block +- `modules/common.mk` — adds `ARCH_MAP_ppc64le := ppc64le` arch mapping + +### SVS (ScalableVectorSearch) Disabled +SVS is x86-only (uses `yield` CPU instruction). Three files are patched: +- `build.sh` — passes `-DUSE_SVS=OFF` to cmake (sets `HAVE_SVS=0`) +- `index_factories/svs_factory.cpp` — entire file wrapped with `#if HAVE_SVS` +- `index_factories/tiered_factory.h` — `svs_tiered.h` include guarded +- `VecSim/vec_sim.cpp` — SVS-specific calls and include guarded + +### VectorSimilarity CPU Features +`spaces.h` gains a `#elif defined(__powerpc64__)` branch returning `EmptyFeatures{}` so ppc64le does not fall through to the x86 code path. + +### RediSearch Rust Type Fixes +On ppc64le `t_fieldMask = uint64_t` (not `uint128_t`): +- `ffi/src/lib.rs` — `RS_FIELDMASK_ALL: u128::MAX` → `u64::MAX` +- `ffi/build.rs` — `.blocklist_item("RS_FIELDMASK_ALL")` prevents bindgen emitting a conflicting `i32` +- `inverted_index/.../fields_only.rs` — `u128::read_as_varint` → `u64::read_as_varint` +- `inverted_index/.../index_result/` — explicit `as t_fieldMask` cast added + +### RedisTimeSeries / RedisBloom +Architecture guards (`arm64v8`-only restrictions) removed from module `Makefile`s. + +## Performance + +### Power10 Optimisations +When running on Power10 CPUs the build automatically applies: +- `-mcpu=power10` compiler flag +- `-mtune=power10` optimisation + +### Resource Recommendations +- **CPU**: 500m request, 2000m limit +- **Memory**: 2Gi request, 4Gi limit +- **Storage**: Persistence disabled by default (configure as needed) + +## Security + +- Base image: Red Hat UBI 9.8 (regularly updated) +- Go 1.26.5 for utilities (fixes stdlib CVEs) +- All system packages updated during build +- Non-root user (UID 1001) +- Minimal runtime dependencies in final image + +## License + +This configuration is provided as-is for building Redis with modules. Please refer to individual component licenses: +- Redis: BSD 3-Clause +- RedisBloom: Redis Source Available License +- RediSearch: Redis Source Available License +- RedisJSON: Redis Source Available License +- RedisTimeSeries: Redis Source Available License + +## Support + +For issues specific to this build configuration, please check: +1. Module compatibility with Redis 8.8.0 +2. ppc64le architecture requirements +3. OpenShift/Kubernetes deployment constraints + +## Version History + +- **v8.8.0** — Redis 8.8.0 with all 4 modules for ppc64le on UBI 9.8 + - RedisBloom v8.8.0 + - RediSearch v8.8.0 + - RedisJSON v8.8.0 + - RedisTimeSeries v8.8.0 + - Base image upgraded from UBI 9.7 → UBI 9.8 + - Bitnami containers commit `731e897` (8.8.0-debian-12-r3) + - SVS (ScalableVectorSearch) disabled — new in 8.8.0, x86-only + - `svs_factory.cpp` guarded with `#if HAVE_SVS` — CMakeLists.txt compiles it unconditionally + - `lld` linker added as build dependency + - `index_result` patched as directory module (restructured in 8.8.0) + - `ffi/build.rs` blocklist added for `RS_FIELDMASK_ALL` + +- **v8.4.1** — Initial release with all 4 modules for ppc64le on UBI 9.7 + - RedisBloom v8.4.2 + - RediSearch v8.4.5 + - RedisJSON v8.4.2 + - RedisTimeSeries v8.4.7 diff --git a/r/redis-bv/build_info.json b/r/redis-bv/build_info.json index 435b069eb1..bc914d9aba 100644 --- a/r/redis-bv/build_info.json +++ b/r/redis-bv/build_info.json @@ -1,12 +1,12 @@ { - "maintainer": "Prachi.Gaonkar@ibm.com", + "maintainer": "veenious.geevarghese@ibm.com", "package_name": "redis-bv", "github_url": "https://github.com/redis/redis", - "version": "8.4.2", + "version": "8.8.0", "default_branch": "unstable", "package_dir": "r/redis-bv/", "docker_cmd": "docker build -t ${package_name}:$PACKAGE_VERSION ${dir}", - "build_script": "redis-bv_8.4.2_ubi_9.7.sh", + "build_script": "redis-bv_8.8.0_ubi_9.8.sh", "use_non_root_user": false, "docker_build": true, "8.4.1": { @@ -17,7 +17,11 @@ "dir": "8.4.2_ubi_9.7", "build_script": "redis-bv_8.4.2_ubi_9.7.sh" }, + "8.8.0": { + "dir": "8.8.0_ubi_9.8", + "build_script": "redis-bv_8.8.0_ubi_9.8.sh" + }, "*.*.*": { - "dir": "8.4.2_ubi_9.7" + "dir": "8.8.0_ubi_9.8" } } \ No newline at end of file diff --git a/r/redis-bv/redis-bv_8.8.0.patch b/r/redis-bv/redis-bv_8.8.0.patch new file mode 100644 index 0000000000..dc251e3642 --- /dev/null +++ b/r/redis-bv/redis-bv_8.8.0.patch @@ -0,0 +1,79 @@ +diff --git a/src/debug.c b/src/debug.c +index e14f2a5..9646ef7 100644 +--- a/src/debug.c ++++ b/src/debug.c +@@ -1781,6 +1781,59 @@ void logRegisters(ucontext_t *uc) { + (unsigned long) uc->uc_mcontext.fault_address + ); + logStackContent((void**)uc->uc_mcontext.arm_sp); ++ #elif defined(__powerpc64__) /* Linux ppc64le */ ++ serverLog(LL_WARNING, ++ "\n" ++ "NIP :%016lx MSR :%016lx CTR :%016lx\n" ++ "LR :%016lx XER :%016lx CCR :%016lx\n" ++ "R0 :%016lx R1 :%016lx R2 :%016lx R3 :%016lx\n" ++ "R4 :%016lx R5 :%016lx R6 :%016lx R7 :%016lx\n" ++ "R8 :%016lx R9 :%016lx R10 :%016lx R11 :%016lx\n" ++ "R12 :%016lx R13 :%016lx R14 :%016lx R15 :%016lx\n" ++ "R16 :%016lx R17 :%016lx R18 :%016lx R19 :%016lx\n" ++ "R20 :%016lx R21 :%016lx R22 :%016lx R23 :%016lx\n" ++ "R24 :%016lx R25 :%016lx R26 :%016lx R27 :%016lx\n" ++ "R28 :%016lx R29 :%016lx R30 :%016lx R31 :%016lx\n", ++ (unsigned long) uc->uc_mcontext.gp_regs[32], /* NIP */ ++ (unsigned long) uc->uc_mcontext.gp_regs[33], /* MSR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[35], /* CTR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[36], /* LR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[37], /* XER */ ++ (unsigned long) uc->uc_mcontext.gp_regs[38], /* CCR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[0], ++ (unsigned long) uc->uc_mcontext.gp_regs[1], ++ (unsigned long) uc->uc_mcontext.gp_regs[2], ++ (unsigned long) uc->uc_mcontext.gp_regs[3], ++ (unsigned long) uc->uc_mcontext.gp_regs[4], ++ (unsigned long) uc->uc_mcontext.gp_regs[5], ++ (unsigned long) uc->uc_mcontext.gp_regs[6], ++ (unsigned long) uc->uc_mcontext.gp_regs[7], ++ (unsigned long) uc->uc_mcontext.gp_regs[8], ++ (unsigned long) uc->uc_mcontext.gp_regs[9], ++ (unsigned long) uc->uc_mcontext.gp_regs[10], ++ (unsigned long) uc->uc_mcontext.gp_regs[11], ++ (unsigned long) uc->uc_mcontext.gp_regs[12], ++ (unsigned long) uc->uc_mcontext.gp_regs[13], ++ (unsigned long) uc->uc_mcontext.gp_regs[14], ++ (unsigned long) uc->uc_mcontext.gp_regs[15], ++ (unsigned long) uc->uc_mcontext.gp_regs[16], ++ (unsigned long) uc->uc_mcontext.gp_regs[17], ++ (unsigned long) uc->uc_mcontext.gp_regs[18], ++ (unsigned long) uc->uc_mcontext.gp_regs[19], ++ (unsigned long) uc->uc_mcontext.gp_regs[20], ++ (unsigned long) uc->uc_mcontext.gp_regs[21], ++ (unsigned long) uc->uc_mcontext.gp_regs[22], ++ (unsigned long) uc->uc_mcontext.gp_regs[23], ++ (unsigned long) uc->uc_mcontext.gp_regs[24], ++ (unsigned long) uc->uc_mcontext.gp_regs[25], ++ (unsigned long) uc->uc_mcontext.gp_regs[26], ++ (unsigned long) uc->uc_mcontext.gp_regs[27], ++ (unsigned long) uc->uc_mcontext.gp_regs[28], ++ (unsigned long) uc->uc_mcontext.gp_regs[29], ++ (unsigned long) uc->uc_mcontext.gp_regs[30], ++ (unsigned long) uc->uc_mcontext.gp_regs[31] ++ ); ++ logStackContent((void **)uc->uc_mcontext.gp_regs[1]); /* R1 = stack pointer */ + #else + NOT_SUPPORTED(); + #endif +diff --git a/tests/support/util.tcl b/tests/support/util.tcl +index e46da15..abe86cb 100644 +--- a/tests/support/util.tcl ++++ b/tests/support/util.tcl +@@ -1320,6 +1320,10 @@ proc system_backtrace_supported {} { + } elseif {$system_name ne {linux}} { + return 0 + } ++ # ppc64le backtrace() does not reliably capture full stack traces ++ if {[exec uname -m] eq {ppc64le}} { ++ return 0 ++ } + + # libmusl does not support backtrace. Also return 0 on + # static binaries (ldd exit code 1) where we can't detect libmusl diff --git a/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh b/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh new file mode 100644 index 0000000000..98a5a394cd --- /dev/null +++ b/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh @@ -0,0 +1,598 @@ +#!/bin/bash -ex +# ---------------------------------------------------------------------------- +# +# Package : redis +# Version : 8.8.0 +# Source repo : https://github.com/redis/redis.git +# Tested on : UBI:9.8 +# Language : c,c++,rust +# Ci-Check : True +# Script License: Apache License Version 2.0 +# Maintainer : Veenious D Geevarghese +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# ---------------------------------------------------------------------------- + +PACKAGE_NAME=redis +SCRIPT_PACKAGE_VERSION=8.8.0 +PACKAGE_VERSION=${1:-${SCRIPT_PACKAGE_VERSION}} +PACKAGE_URL=https://github.com/redis/redis.git + +# Bitnami containers repo commit for redis/8.8/debian-12 +BITNAMI_COMMIT=${BITNAMI_COMMIT:-731e897} +GO_VERSION=${GO_VERSION:-1.24.3} + +BUILD_HOME=$(pwd) +SCRIPT_PATH=$(dirname "$(realpath "$0")") +OS_NAME=$(grep ^PRETTY_NAME /etc/os-release | cut -d= -f2) + +# ---------------------------------------------------------------------------- +# Install system dependencies +# ---------------------------------------------------------------------------- +yum update -y +yum install -y \ + git wget tar gcc gcc-c++ make \ + autoconf automake libtool diffutils \ + tcl procps-ng libstdc++-devel patch cmake \ + python3 python3-devel openssl-devel \ + rust cargo clang-devel util-linux llvm-devel lld \ + acl ca-certificates curl-minimal gzip glibc \ + libgcc libgomp xz unzip zip findutils which +yum update -y python3 python3-libs openssh openssh-clients vim-minimal libarchive libcap +yum clean all + +# Ensure python is available as both 'python3' and 'python' +mkdir -p /usr/local/bin +ln -sf /usr/bin/python3 /usr/local/bin/python3 +ln -sf /usr/bin/python3 /usr/local/bin/python +ln -sf /usr/bin/python3 /usr/bin/python +python3 --version + +# ---------------------------------------------------------------------------- +# Install Go (fixes stdlib CVEs: CVE-2025-68121, CVE-2025-58183, etc.) +# ---------------------------------------------------------------------------- +wget -q "https://go.dev/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" +tar -C /usr/local -xzf "go${GO_VERSION}.linux-ppc64le.tar.gz" +rm "go${GO_VERSION}.linux-ppc64le.tar.gz" +export PATH="/usr/local/go/bin:$PATH" +go version + +# ---------------------------------------------------------------------------- +# Build wait-for-port from source +# ---------------------------------------------------------------------------- +git clone https://github.com/bitnami/wait-for-port "$BUILD_HOME/wait-for-port" +cd "$BUILD_HOME/wait-for-port" +git checkout v1.0.10 +go build . + +# ---------------------------------------------------------------------------- +# Build gosu from source (fixes 8 stdlib CVEs in pre-compiled binary) +# ---------------------------------------------------------------------------- +git clone https://github.com/tianon/gosu "$BUILD_HOME/gosu" +cd "$BUILD_HOME/gosu" +git checkout 1.19 +CGO_ENABLED=0 go build -o gosu . + +# ---------------------------------------------------------------------------- +# Assemble Bitnami prebuildfs +# ---------------------------------------------------------------------------- +git clone https://github.com/bitnami/containers "$BUILD_HOME/containers" +cd "$BUILD_HOME/containers" +git checkout "$BITNAMI_COMMIT" + +cd "$BUILD_HOME/containers/bitnami/redis/8.8/debian-12" +wget "https://downloads.bitnami.com/files/stacksmith/redis-${PACKAGE_VERSION}-0-linux-amd64-debian-12.tar.gz" +tar -xvf "redis-${PACKAGE_VERSION}-0-linux-amd64-debian-12.tar.gz" +mkdir -p prebuildfs/opt/bitnami/redis/etc +cp "redis-${PACKAGE_VERSION}-linux-amd64-debian-12/files/redis/etc/redis-default.conf" \ + prebuildfs/opt/bitnami/redis/etc/ + +# Copy prebuildfs and rootfs into place +cp -r prebuildfs/. / +cp -r rootfs/. / + +# ---------------------------------------------------------------------------- +# Clone Redis +# ---------------------------------------------------------------------------- +cd "$BUILD_HOME" +if ! git clone "$PACKAGE_URL" "$BUILD_HOME/redis"; then + echo "------------------$PACKAGE_NAME:clone_fails---------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Clone_Fails" + exit 0 +fi + +cd "$BUILD_HOME/redis" +git checkout "$PACKAGE_VERSION" + +# ---------------------------------------------------------------------------- +# Apply ppc64le patch +# ---------------------------------------------------------------------------- +PATCH_FILE="redis-bv_${SCRIPT_PACKAGE_VERSION}.patch" +if [ -f "$SCRIPT_PATH/$PATCH_FILE" ]; then + echo "Applying patch $SCRIPT_PATH/$PATCH_FILE" + if ! git apply "$SCRIPT_PATH/$PATCH_FILE"; then + echo "------------------$PACKAGE_NAME:patch_fails---------------------------------------" + exit 1 + fi +else + echo "Patch file $SCRIPT_PATH/$PATCH_FILE not found" + exit 1 +fi + +# ---------------------------------------------------------------------------- +# Patch modules/Makefile - add ppc64le Rust toolchain support +# +# The modules/Makefile has a case block that selects the right Rust installer +# tarball URL per architecture. ppc64le is not listed by default. We add it +# so that the Rust toolchain install step succeeds on ppc64le. +# Note: RUST_SHA256 is intentionally left blank; the script skips checksum +# verification when empty. +# ---------------------------------------------------------------------------- +python3 << 'EOF' +content = open('modules/Makefile').read() +old = "\t\t\tfi ;; \\\n\t\t*) echo" +new = ( + "\t\t\tfi ;; \\\n" + "\t\t'ppc64le') \\\n" + "\t\t\tRUST_INSTALLER=\"rust-$${RUST_VERSION}-powerpc64le-unknown-linux-gnu\"; \\\n" + "\t\t\tRUST_SHA256=\"\"; \\\n" + "\t\t\t;; \\\n" + "\t\t*) echo" +) +assert old in content, "NO MATCH - modules/Makefile" +open('modules/Makefile', 'w').write(content.replace(old, new)) +print("OK") +EOF + +# ---------------------------------------------------------------------------- +# Patch modules/common.mk - add ppc64le arch map entry +# +# common.mk maps uname -m output to Docker arch tag names. +# Without ppc64le in ARCH_MAP, module builds fail looking up the arch string. +# ---------------------------------------------------------------------------- +python3 << 'EOF' +content = open('modules/common.mk').read() +old = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8" +new = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8\nARCH_MAP_ppc64le := ppc64le" +assert old in content, "NO MATCH - common.mk" +open('modules/common.mk', 'w').write(content.replace(old, new)) +print("OK") +EOF + +# ---------------------------------------------------------------------------- +# First build pass (may fail; needed to clone all module sources) +# This pass clones redisjson, redistimeseries, redisbloom, redisearch sources +# via 'get_source'. It will fail because ppc64le arch guards block the build, +# but that is expected - we patch sources afterwards and do a second pass. +# ---------------------------------------------------------------------------- +EXTRA_CFLAGS="" +if [[ "$(uname -m)" == "ppc64le" ]]; then + if grep -iq "POWER10" /proc/cpuinfo || lscpu | grep -iq "POWER10"; then + echo "Power10 CPU detected - applying P10 optimisation flags" + EXTRA_CFLAGS="-mcpu=power10 -mtune=power10" + fi +fi + +export BUILD_WITH_MODULES=yes +export DISABLE_WERRORS=yes +export IGNORE_MISSING_DEPS=1 +unset INSTALL_RUST_TOOLCHAIN || true + +make MALLOC=libc EXTRA_CFLAGS="$EXTRA_CFLAGS" -j "$(nproc)" all IGNORE_MISSING_DEPS=1 || true + +# ---------------------------------------------------------------------------- +# Patch RedisTimeSeries - remove ppc64le architecture restriction +# (modules/redistimeseries/src is cloned by the first build pass) +# ---------------------------------------------------------------------------- +find "$BUILD_HOME/redis/modules/redistimeseries" -name "Makefile" \ + | xargs grep -l "only supports 64-bit\|arm64v8" 2>/dev/null \ + | while read mk; do + echo "Patching $mk" + sed -i '/only supports 64-bit/{ N; d }' "$mk" || true + sed -i '/^ifneq.*ARCH.*arm64v8/,/^endif/d' "$mk" || true + echo "Done patching $mk" + done + +# ---------------------------------------------------------------------------- +# Patch RedisBloom - remove ppc64le architecture restriction +# ---------------------------------------------------------------------------- +find "$BUILD_HOME/redis/modules/redisbloom" -name "Makefile" \ + | xargs grep -l "only supports 64-bit\|arm64v8" 2>/dev/null \ + | while read mk; do + echo "Patching $mk" + sed -i '/only supports 64-bit/{ N; d }' "$mk" || true + sed -i '/^ifneq.*ARCH.*arm64v8/,/^endif/d' "$mk" || true + echo "Done patching $mk" + done + +# ---------------------------------------------------------------------------- +# Patch RediSearch - disable SVS (ScalableVectorSearch) on ppc64le +# +# SVS contains x86-only inline assembly. With -DUSE_SVS=OFF cmake sets +# HAVE_SVS=0. Additionally svs_factory.cpp is compiled unconditionally by +# CMakeLists.txt, so it must be wrapped with #if HAVE_SVS at source level. +# ---------------------------------------------------------------------------- +python3 << 'EOF' +import subprocess + +# In 8.8.0 the Makefile is a thin wrapper - the cmake invocation lives in build.sh +result = subprocess.run( + ['find', 'modules/redisearch/src', '-maxdepth', '1', '-name', 'build.sh'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found RediSearch build.sh candidates: {files}") + +for path in files: + content = open(path).read() + old = 'CMAKE_BASIC_ARGS="$CMAKE_BASIC_ARGS -DSVS_SHARED_LIB=OFF"' + new = 'CMAKE_BASIC_ARGS="$CMAKE_BASIC_ARGS -DSVS_SHARED_LIB=OFF -DUSE_SVS=OFF"' + if '-DUSE_SVS=OFF' in content: + print(f"SKIP - already has -DUSE_SVS=OFF: {path}") + elif old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - added -DUSE_SVS=OFF to cmake invocation in {path}") + else: + print(f"WARN - anchor not found in {path}") +EOF + +# ---------------------------------------------------------------------------- +# Patch RediSearch Rust sources for ppc64le +# +# On ppc64le, t_fieldMask = uint64_t. Fixes: +# 1. ffi/src/lib.rs: RS_FIELDMASK_ALL u128::MAX -> u64::MAX +# 2. ffi/build.rs: blocklist RS_FIELDMASK_ALL to avoid duplicate from bindgen +# 3. fields_only.rs: u128::read_as_varint -> u64::read_as_varint +# 4. index_result: add explicit "as t_fieldMask" cast +# ---------------------------------------------------------------------------- + +# Fix 1: Change RS_FIELDMASK_ALL from u128::MAX to u64::MAX in ffi/src/lib.rs +python3 << 'EOF' +import subprocess + +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/ffi/src/lib.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found ffi/src/lib.rs candidates: {files}") + +for path in files: + content = open(path).read() + old = "pub const RS_FIELDMASK_ALL: FieldMask = u128::MAX;" + new = "pub const RS_FIELDMASK_ALL: FieldMask = u64::MAX;" + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - changed RS_FIELDMASK_ALL to u64::MAX in {path}") + elif new in content: + print(f"SKIP - already patched: {path}") + else: + print(f"WARN - RS_FIELDMASK_ALL u128::MAX pattern not found in {path}") +EOF + +# Fix 2: Blocklist RS_FIELDMASK_ALL in ffi/build.rs +python3 << 'EOF' +import subprocess + +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/ffi/build.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found ffi/build.rs candidates: {files}") + +for path in files: + content = open(path).read() + anchors = [ + ('.blocklist_type("QueryProcessingCtx")', + '.blocklist_item("RS_FIELDMASK_ALL")\n .blocklist_type("QueryProcessingCtx")'), + ('.allowlist_recursively(true)', + '.allowlist_recursively(true)\n .blocklist_item("RS_FIELDMASK_ALL")'), + ] + patched = False + for old, new in anchors: + if '.blocklist_item("RS_FIELDMASK_ALL")' in content: + print(f"SKIP - already has blocklist_item in {path}") + patched = True + break + if old in content: + open(path, 'w').write(content.replace(old, new, 1)) + print(f"OK - added blocklist_item(RS_FIELDMASK_ALL) in {path}") + patched = True + break + if not patched: + print(f"WARN - no suitable anchor found in {path}; RS_FIELDMASK_ALL may be emitted by bindgen") +EOF + +# Fix 3: Change u128::read_as_varint -> u64::read_as_varint in fields_only.rs +python3 << 'EOF' +import subprocess + +result = subprocess.run( + ['find', 'modules/redisearch/src', '-name', 'fields_only.rs'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found fields_only.rs candidates: {files}") + +for path in files: + content = open(path).read() + old = "let field_mask = u128::read_as_varint(cursor)?;" + new = "let field_mask = u64::read_as_varint(cursor)?;" + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - patched fields_only.rs at {path}") + elif new in content: + print(f"SKIP - already patched: {path}") + else: + print(f"WARN - u128::read_as_varint not found in {path}") +EOF + +# Fix 4: Add explicit cast in index_result source files +python3 << 'EOF' +import subprocess + +result = subprocess.run( + ['find', 'modules/redisearch/src', '-name', '*.rs', '-path', '*/index_result*'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found index_result source files: {files}") + +patched = 0 +for path in files: + content = open(path).read() + if "field_mask: RS_FIELDMASK_ALL," in content: + count = content.count("field_mask: RS_FIELDMASK_ALL,") + open(path, 'w').write( + content.replace("field_mask: RS_FIELDMASK_ALL,", + "field_mask: RS_FIELDMASK_ALL as t_fieldMask,") + ) + print(f"OK - replaced {count} occurrence(s) in {path}") + patched += count + +if patched == 0: + print("WARN - 'field_mask: RS_FIELDMASK_ALL,' not found in any index_result source file") +EOF + +# ---------------------------------------------------------------------------- +# Patch VectorSimilarity - guard all SVS includes/code behind HAVE_SVS +# +# With -DUSE_SVS=OFF, HAVE_SVS=0 and SVS submodule headers are absent. +# CMakeLists.txt compiles svs_factory.cpp unconditionally, so we wrap its +# entire content with #if HAVE_SVS. tiered_factory.h and vec_sim.cpp also +# need individual guards for their SVS-specific lines. +# ---------------------------------------------------------------------------- +python3 << 'EOF' +import subprocess + +# 1. tiered_factory.h - includes svs_tiered.h unconditionally +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/index_factories/tiered_factory.h'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + content = open(path).read() + old = '#include "VecSim/algorithms/svs/svs_tiered.h"' + new = '#if HAVE_SVS\n#include "VecSim/algorithms/svs/svs_tiered.h"\n#endif' + if new in content: + print(f"SKIP tiered_factory.h - already patched") + elif old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - guarded svs_tiered.h include in {path}") + else: + print(f"WARN - svs_tiered.h include not found in {path}") + +# 2. svs_factory.cpp - entire file is SVS-only; wrap with #if HAVE_SVS +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/index_factories/svs_factory.cpp'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + content = open(path).read() + if '#if HAVE_SVS' in content: + print(f"SKIP svs_factory.cpp - already patched: {path}") + continue + open(path, 'w').write('#if HAVE_SVS\n' + content + '\n#endif // HAVE_SVS\n') + print(f"OK - wrapped svs_factory.cpp with #if HAVE_SVS in {path}") + +# 3. vec_sim.cpp - guard svs_utils.h include and stub SVS-only function bodies +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/VecSim/vec_sim.cpp'], + capture_output=True, text=True +) +for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()]: + lines = open(path).read().splitlines(keepends=True) + if any('#if HAVE_SVS' in l for l in lines): + print(f"SKIP vec_sim.cpp - already patched") + continue + + out = [] + i = 0 + patched_include = False + patched_resize = False + patched_shared = False + + while i < len(lines): + line = lines[i] + + if '#include "VecSim/algorithms/svs/svs_utils.h"' in line and not patched_include: + out.append('#if HAVE_SVS\n') + out.append(line) + out.append('#endif\n') + patched_include = True + i += 1 + continue + + if 'VecSimSVSThreadPool::resize(' in line and not patched_resize: + out.append('#if HAVE_SVS\n') + out.append(line) + out.append('#endif\n') + patched_resize = True + i += 1 + continue + + if 'VecSimSVSThreadPool::getSharedAllocationSize()' in line and not patched_shared: + out.append('#if HAVE_SVS\n') + out.append(line) + out.append('#else\n return 0;\n#endif\n') + patched_shared = True + i += 1 + continue + + out.append(line) + i += 1 + + open(path, 'w').write(''.join(out)) + summary = [] + if patched_include: summary.append('guarded svs_utils.h include') + if patched_resize: summary.append('guarded SVS pool resize') + if patched_shared: summary.append('stubbed getSharedAllocationSize') + if summary: + print(f"OK - {', '.join(summary)} in {path}") + else: + print(f"WARN - no SVS patterns found in {path}") +EOF + +# ---------------------------------------------------------------------------- +# Patch VectorSimilarity - add ppc64le CPU features support +# ---------------------------------------------------------------------------- +python3 << 'EOF' +import subprocess + +result = subprocess.run( + ['find', 'modules/redisearch/src', '-path', '*/spaces/spaces.h'], + capture_output=True, text=True +) +files = [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] +print(f"Found spaces.h candidates: {files}") + +old = """#if defined(CPU_FEATURES_ARCH_AARCH64) + using FeaturesType = cpu_features::Aarch64Features; + constexpr auto getFeatures = cpu_features::GetAarch64Info; +#else + using FeaturesType = cpu_features::X86Features; // Fallback + constexpr auto getFeatures = cpu_features::GetX86Info; +#endif + return arch_opt ? *static_cast(arch_opt) : getFeatures().features;""" + +new = """#if defined(CPU_FEATURES_ARCH_AARCH64) + using FeaturesType = cpu_features::Aarch64Features; + constexpr auto getFeatures = cpu_features::GetAarch64Info; + return arch_opt ? *static_cast(arch_opt) : getFeatures().features; +#elif defined(__powerpc64__) + struct EmptyFeatures {}; + return EmptyFeatures{}; +#else + using FeaturesType = cpu_features::X86Features; // Fallback + constexpr auto getFeatures = cpu_features::GetX86Info; + return arch_opt ? *static_cast(arch_opt) : getFeatures().features; +#endif""" + +patched = False +for path in files: + try: + content = open(path).read() + except OSError: + continue + if old in content: + open(path, 'w').write(content.replace(old, new)) + print(f"OK - patched {path}") + patched = True + break + +if not patched: + print("WARN - spaces.h pattern not found; VectorSimilarity may need manual review") +EOF + +# Wipe RediSearch CMake and Rust build caches so all patched sources recompile +echo "Wiping RediSearch CMake and Rust build caches..." +rm -rf modules/redisearch/src/bin/linux-ppc64le-release/ +rm -rf modules/redisearch/src/bin/redisearch_rs/ +echo "Caches wiped." + +# ---------------------------------------------------------------------------- +# Final build pass +# ---------------------------------------------------------------------------- +export PATH="/usr/bin:/usr/local/bin:$PATH" +export PYTHON3=/usr/bin/python3 +export PYTHON=/usr/bin/python3 +which python3 && python3 --version + +if ! make MALLOC=libc EXTRA_CFLAGS="$EXTRA_CFLAGS" -j "$(nproc)" all IGNORE_MISSING_DEPS=1; then + echo "------------------$PACKAGE_NAME:build_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Build_Fails" + exit 1 +fi + +# ---------------------------------------------------------------------------- +# Collect Redis binaries and modules +# ---------------------------------------------------------------------------- +mkdir -p /root/redis/bin /root/redis/modules + +find "$BUILD_HOME/redis/src" -maxdepth 1 -type f -executable -name "redis-*" \ + -exec cp {} /root/redis/bin/ \; + +cp "$BUILD_HOME/redis/modules/redisbloom/redisbloom.so" /root/redis/modules/ +cp "$BUILD_HOME/redis/modules/redisearch/redisearch.so" /root/redis/modules/ +cp "$BUILD_HOME/redis/modules/redisjson/rejson.so" /root/redis/modules/ +cp "$BUILD_HOME/redis/modules/redistimeseries/redistimeseries.so" /root/redis/modules/ + +ls -lh /root/redis/bin/ /root/redis/modules/ + +# ---------------------------------------------------------------------------- +# Install runtime layout under /opt/bitnami +# ---------------------------------------------------------------------------- +chmod g+rwX /opt/bitnami +ln -sf /opt/bitnami/scripts/redis/entrypoint.sh /entrypoint.sh +ln -sf /opt/bitnami/scripts/redis/run.sh /run.sh +/opt/bitnami/scripts/redis/postunpack.sh +mkdir -p /opt/bitnami/common/bin +chmod g+rwX /opt/bitnami + +cp "$BUILD_HOME/wait-for-port/wait-for-port" /opt/bitnami/common/bin/wait-for-port +cp "$BUILD_HOME/gosu/gosu" /opt/bitnami/common/bin/gosu +chmod +x /opt/bitnami/common/bin/gosu /opt/bitnami/common/bin/wait-for-port + +cp -r /root/redis/bin/. /opt/bitnami/redis/bin/ +cp -r /root/redis/modules/. /opt/bitnami/redis/modules/ + +# Create symlinks for Bitnami Helm chart compatibility +# (chart expects modules at /opt/bitnami/redis/lib/redis/modules/) +mkdir -p /opt/bitnami/redis/lib/redis/modules +cp /opt/bitnami/redis/modules/*.so /opt/bitnami/redis/lib/redis/modules/ +ls -lh /opt/bitnami/redis/lib/redis/modules/ + +# ---------------------------------------------------------------------------- +# Cleanup +# ---------------------------------------------------------------------------- +yum clean all +rm -rf /var/cache/yum /var/tmp/* + +# ---------------------------------------------------------------------------- +# Run tests +# ---------------------------------------------------------------------------- +cd "$BUILD_HOME/redis" + +cat <<'EOF' > skipfile +*unit/introspection* +EOF + +if ! ./runtest --skipfile skipfile; then + echo "------------------$PACKAGE_NAME:install_success_but_test_fails---------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Install_success_but_test_Fails" + exit 2 +else + echo "------------------$PACKAGE_NAME:install_&_test_both_success-------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Pass | Both_Install_and_Test_Success" + exit 0 +fi From 811d4f99493b83e5ad59df9cd603b7f4e2a33660 Mon Sep 17 00:00:00 2001 From: Veenious Geevarghese Date: Fri, 14 Aug 2026 16:24:10 +0530 Subject: [PATCH 2/5] script header updated --- r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh b/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh index 98a5a394cd..a059bdb8fb 100644 --- a/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh +++ b/r/redis-bv/redis-bv_8.8.0_ubi_9.8.sh @@ -4,7 +4,7 @@ # Package : redis # Version : 8.8.0 # Source repo : https://github.com/redis/redis.git -# Tested on : UBI:9.8 +# Tested on : UBI 9.8 # Language : c,c++,rust # Ci-Check : True # Script License: Apache License Version 2.0 From b4ba628d4a8f405cf34bfb82c0c4504ec26b021b Mon Sep 17 00:00:00 2001 From: Veenious Geevarghese Date: Fri, 14 Aug 2026 17:58:09 +0530 Subject: [PATCH 3/5] fix: add BuildKit syntax directive to enable heredoc in Dockerfile --- r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile index 7a964a3b69..e8187cc030 100644 --- a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + # Copyright Broadcom, Inc. All Rights Reserved. # SPDX-License-Identifier: APACHE-2.0 From a83c5334668bc85a3e3b93493168902c4d02f6b4 Mon Sep 17 00:00:00 2001 From: Veenious Geevarghese Date: Mon, 17 Aug 2026 12:10:37 +0530 Subject: [PATCH 4/5] fix: wget patch from ppc64le master + COPY --from=setupbuilder (no build context) --- .../Dockerfiles/8.8.0_ubi_9.8/Dockerfile | 140 +++++++++--------- 1 file changed, 67 insertions(+), 73 deletions(-) diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile index e8187cc030..ae0e63ff96 100644 --- a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile @@ -1,18 +1,21 @@ # syntax=docker/dockerfile:1 - # Copyright Broadcom, Inc. All Rights Reserved. # SPDX-License-Identifier: APACHE-2.0 # Stage 1: Build utilities from source using secure Go version (resolves stdlib CVEs) FROM registry.access.redhat.com/ubi9/ubi:9.8 AS setupbuilder -ARG REDIS_VERSION=8.8.0 +ARG PACKAGE_VERSION=8.8.0 ARG BITNAMI_COMMIT=731e897 ARG GO_VERSION=1.26.5 +ENV REDIS_PATCH=https://raw.githubusercontent.com/ppc64le/build-scripts/master/r/redis-bv/redis-bv_${PACKAGE_VERSION}.patch # Install build dependencies and update system packages RUN yum update -y && yum install -y git wget tar gcc && yum clean all +# Download the ppc64le patch for Redis 8.8.0 +RUN wget $REDIS_PATCH + # Install secure Go version to fix stdlib CVEs (CVE-2025-68121, CVE-2025-58183, etc.) RUN wget -q https://go.dev/dl/go${GO_VERSION}.linux-ppc64le.tar.gz && \ tar -C /usr/local -xzf go${GO_VERSION}.linux-ppc64le.tar.gz && \ @@ -39,10 +42,10 @@ RUN git clone https://github.com/bitnami/containers /build/containers && \ git checkout ${BITNAMI_COMMIT} RUN cd /build/containers/bitnami/redis/8.8/debian-12 && \ - wget https://downloads.bitnami.com/files/stacksmith/redis-${REDIS_VERSION}-0-linux-amd64-debian-12.tar.gz && \ - tar -xvf redis-${REDIS_VERSION}-0-linux-amd64-debian-12.tar.gz && \ + wget https://downloads.bitnami.com/files/stacksmith/redis-${PACKAGE_VERSION}-0-linux-amd64-debian-12.tar.gz && \ + tar -xvf redis-${PACKAGE_VERSION}-0-linux-amd64-debian-12.tar.gz && \ mkdir -p prebuildfs/opt/bitnami/redis/etc && \ - cp redis-${REDIS_VERSION}-linux-amd64-debian-12/files/redis/etc/redis-default.conf \ + cp redis-${PACKAGE_VERSION}-linux-amd64-debian-12/files/redis/etc/redis-default.conf \ prebuildfs/opt/bitnami/redis/etc/ # ---------------------------------------------------------------------------- @@ -51,52 +54,57 @@ RUN cd /build/containers/bitnami/redis/8.8/debian-12 && \ FROM registry.access.redhat.com/ubi9/ubi:9.8 AS redisbuilder WORKDIR /build +ARG PACKAGE_VERSION=8.8.0 RUN yum update -y && \ yum install -y \ - git \ - gcc \ - gcc-c++ \ - make \ - autoconf \ - automake \ - libtool \ - diffutils \ - tcl \ - procps-ng \ - libstdc++-devel \ - patch \ - cmake \ - python3 \ - python3-devel \ - openssl-devel \ - rust \ - cargo \ - clang-devel \ - util-linux \ - llvm-devel \ - lld && \ + git \ + gcc \ + gcc-c++ \ + make \ + autoconf \ + automake \ + libtool \ + diffutils \ + tcl \ + procps-ng \ + libstdc++-devel \ + patch \ + cmake \ + python3 \ + python3-devel \ + openssl-devel \ + rust \ + cargo \ + clang-devel \ + util-linux \ + llvm-devel \ + lld && \ yum update -y python3 python3-libs openssh openssh-clients vim-minimal libarchive libcap && \ yum clean all && \ rm -rf /var/cache/yum # Ensure python is available under all expected names -RUN mkdir -p /usr/local/bin && \ +RUN which python3 && python3 --version && \ + mkdir -p /usr/local/bin && \ ln -sf /usr/bin/python3 /usr/local/bin/python3 && \ ln -sf /usr/bin/python3 /usr/local/bin/python && \ ln -sf /usr/bin/python3 /usr/bin/python && \ - python3 --version + which python3 && which python && \ + python3 --version && python --version -COPY redis-bv_8.8.0.patch /build/ +# Copy patch downloaded in setupbuilder stage (avoids build-context dependency) +COPY --from=setupbuilder /redis-bv_${PACKAGE_VERSION}.patch /build/ # Clone Redis 8.8.0 and apply ppc64le patch -RUN git clone https://github.com/redis/redis /build/redis && \ - cd /build/redis && \ - git checkout 8.8.0 && \ - git apply /build/redis-bv_8.8.0.patch +RUN cd /build && \ + git clone https://github.com/redis/redis && \ + cd redis && \ + git checkout ${PACKAGE_VERSION} && \ + patch -p1 < /build/redis-bv_${PACKAGE_VERSION}.patch # Fix modules/Makefile - add ppc64le Rust toolchain case -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' content = open('modules/Makefile').read() old = "\t\t\tfi ;; \\\n\t\t*) echo" new = "\t\t\tfi ;; \\\n\t\t'ppc64le') \\\n\t\t\tRUST_INSTALLER=\"rust-$${RUST_VERSION}-powerpc64le-unknown-linux-gnu\"; \\\n\t\t\tRUST_SHA256=\"\"; \\\n\t\t\t;; \\\n\t\t*) echo" @@ -106,7 +114,7 @@ print("OK") EOF # Fix modules/common.mk - add ppc64le arch map entry -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' content = open('modules/common.mk').read() old = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8" new = "ARCH_MAP_aarch64 := arm64v8\nARCH_MAP_arm64 := arm64v8\nARCH_MAP_ppc64le := ppc64le" @@ -148,7 +156,7 @@ RUN find /build/redis/modules/redisbloom -name "Makefile" \ done; true # Fix RediSearch - disable SVS (x86-only ScalableVectorSearch) via cmake flag -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-maxdepth', '1', '-name', 'build.sh'], @@ -170,7 +178,7 @@ for path in files: EOF # Fix RediSearch Rust - RS_FIELDMASK_ALL: u128::MAX -> u64::MAX in ffi/src/lib.rs -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-path', '*/ffi/src/lib.rs'], @@ -191,9 +199,8 @@ for path in files: print(f"WARN - pattern not found in {path}") EOF -# Fix RediSearch Rust - blocklist RS_FIELDMASK_ALL in ffi/build.rs (prevents -# bindgen emitting a conflicting i32 from the C macro "#define RS_FIELDMASK_ALL -1") -RUN cd /build/redis && python3 << 'EOF' +# Fix RediSearch Rust - blocklist RS_FIELDMASK_ALL in ffi/build.rs +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-path', '*/ffi/build.rs'], @@ -221,7 +228,7 @@ for path in files: EOF # Fix RediSearch Rust - u128::read_as_varint -> u64::read_as_varint in fields_only.rs -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-name', 'fields_only.rs'], @@ -243,8 +250,7 @@ for path in files: EOF # Fix RediSearch Rust - explicit cast in index_result source files -# (index_result is a directory/module in 8.8.0, not a single file) -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-name', '*.rs', '-path', '*/index_result*'], @@ -267,11 +273,8 @@ if patched == 0: print("WARN - pattern not found in any index_result source file") EOF -# Fix VectorSimilarity - guard all SVS includes/code behind #if HAVE_SVS -# - tiered_factory.h: guard svs_tiered.h include -# - svs_factory.cpp: wrap entire file (CMakeLists.txt compiles it unconditionally) -# - vec_sim.cpp: guard svs_utils.h include and stub SVS-only functions -RUN cd /build/redis && python3 << 'EOF' +# Fix VectorSimilarity - guard SVS includes behind #if HAVE_SVS +RUN cd /build/redis && python3 <<'EOF' import subprocess # 1. tiered_factory.h @@ -335,7 +338,7 @@ for path in [f.strip() for f in result.stdout.strip().splitlines() if f.strip()] EOF # Fix VectorSimilarity - add ppc64le CPU features support in spaces.h -RUN cd /build/redis && python3 << 'EOF' +RUN cd /build/redis && python3 <<'EOF' import subprocess result = subprocess.run( ['find', 'modules/redisearch/src', '-path', '*/spaces/spaces.h'], @@ -397,10 +400,12 @@ RUN cd /build/redis && \ export PYTHON=/usr/bin/python3 && \ unset INSTALL_RUST_TOOLCHAIN && \ which python3 && python3 --version && \ + python3 -c "import sys; print(sys.executable)" && \ make MALLOC=libc EXTRA_CFLAGS="$EXTRA_CFLAGS" -j "$(nproc)" all IGNORE_MISSING_DEPS=1 # Collect Redis binaries and all 4 module .so files -RUN mkdir -p /root/redis/bin /root/redis/modules && \ +RUN find /build/redis/modules -maxdepth 2 -name "*.so" | grep -v "deps\|src/bin\|target" && \ + mkdir -p /root/redis/bin /root/redis/modules && \ find /build/redis/src -maxdepth 1 -type f -executable -name "redis-*" \ -exec cp {} /root/redis/bin/ \; && \ cp /build/redis/modules/redisbloom/redisbloom.so /root/redis/modules/ && \ @@ -409,20 +414,21 @@ RUN mkdir -p /root/redis/bin /root/redis/modules && \ cp /build/redis/modules/redistimeseries/redistimeseries.so /root/redis/modules/ && \ ls -lh /root/redis/bin/ /root/redis/modules/ -# Remove build-only packages to reduce layer size +# Erase Python RPM packages after build is complete (not needed in final image) RUN yum clean all && \ rm -rf /var/cache/yum && \ - rpm -e --nodeps python3 python3-devel python3-libs 2>/dev/null || true + rpm -e --nodeps python3 python3-devel python3-libs # ---------------------------------------------------------------------------- # Stage 3: Final runtime image # ---------------------------------------------------------------------------- FROM registry.access.redhat.com/ubi9/ubi:9.8 -LABEL org.opencontainers.image.title="redis" \ - org.opencontainers.image.version="8.8.0" \ +LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ + org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/redis/README.md" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/redis" \ - org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/redis/README.md" + org.opencontainers.image.title="redis" \ + org.opencontainers.image.version="8.8.0" ENV HOME="/" \ OS_ARCH="ppc64le" \ @@ -435,18 +441,7 @@ COPY --from=setupbuilder /build/containers/bitnami/redis/8.8/debian-12/rootfs / # Install runtime dependencies and apply all security updates RUN yum update -y && \ - yum install -y \ - acl \ - ca-certificates \ - curl-minimal \ - gzip \ - glibc \ - openssl \ - procps \ - tar \ - libgcc \ - libgomp \ - libstdc++ && \ + yum install -y acl ca-certificates curl-minimal gzip glibc openssl procps tar libgcc libgomp libstdc++ && \ yum upgrade -y --allowerasing && \ yum clean all && \ rm -rf /var/cache/yum /var/tmp/* && \ @@ -456,15 +451,14 @@ RUN chmod g+rwX /opt/bitnami RUN ln -s /opt/bitnami/scripts/redis/entrypoint.sh /entrypoint.sh RUN ln -s /opt/bitnami/scripts/redis/run.sh /run.sh RUN /opt/bitnami/scripts/redis/postunpack.sh -RUN mkdir -p /opt/bitnami/common/bin && chmod g+rwX /opt/bitnami +RUN mkdir -p /opt/bitnami/common/bin +RUN chmod g+rwX /opt/bitnami # Copy utilities built with secure Go (fixes gosu stdlib CVEs) COPY --from=setupbuilder /build/wait-for-port/wait-for-port /opt/bitnami/common/bin/wait-for-port COPY --from=setupbuilder /build/gosu/gosu /opt/bitnami/common/bin/gosu - -# Copy Redis binaries and modules built for ppc64le -COPY --from=redisbuilder /root/redis/bin /opt/bitnami/redis/bin -COPY --from=redisbuilder /root/redis/modules /opt/bitnami/redis/modules +COPY --from=redisbuilder /root/redis/bin /opt/bitnami/redis/bin +COPY --from=redisbuilder /root/redis/modules /opt/bitnami/redis/modules # Create module path expected by Bitnami Helm chart # (chart uses /opt/bitnami/redis/lib/redis/modules/ in loadmodule directives) From 3791b991c111af1aa0e02212fe952462fa471a8f Mon Sep 17 00:00:00 2001 From: Veenious Geevarghese Date: Mon, 17 Aug 2026 12:32:05 +0530 Subject: [PATCH 5/5] fix: add patch to build context, use plain COPY (no wget 404) --- .../Dockerfiles/8.8.0_ubi_9.8/Dockerfile | 8 +- .../8.8.0_ubi_9.8/redis-bv_8.8.0.patch | 79 +++++++++++++++++++ 2 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/redis-bv_8.8.0.patch diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile index ae0e63ff96..1e642c88dd 100644 --- a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/Dockerfile @@ -8,14 +8,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.8 AS setupbuilder ARG PACKAGE_VERSION=8.8.0 ARG BITNAMI_COMMIT=731e897 ARG GO_VERSION=1.26.5 -ENV REDIS_PATCH=https://raw.githubusercontent.com/ppc64le/build-scripts/master/r/redis-bv/redis-bv_${PACKAGE_VERSION}.patch # Install build dependencies and update system packages RUN yum update -y && yum install -y git wget tar gcc && yum clean all -# Download the ppc64le patch for Redis 8.8.0 -RUN wget $REDIS_PATCH - # Install secure Go version to fix stdlib CVEs (CVE-2025-68121, CVE-2025-58183, etc.) RUN wget -q https://go.dev/dl/go${GO_VERSION}.linux-ppc64le.tar.gz && \ tar -C /usr/local -xzf go${GO_VERSION}.linux-ppc64le.tar.gz && \ @@ -93,8 +89,8 @@ RUN which python3 && python3 --version && \ which python3 && which python && \ python3 --version && python --version -# Copy patch downloaded in setupbuilder stage (avoids build-context dependency) -COPY --from=setupbuilder /redis-bv_${PACKAGE_VERSION}.patch /build/ +# Patch is in the Dockerfile directory (build context) - copy it directly +COPY redis-bv_8.8.0.patch /build/ # Clone Redis 8.8.0 and apply ppc64le patch RUN cd /build && \ diff --git a/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/redis-bv_8.8.0.patch b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/redis-bv_8.8.0.patch new file mode 100644 index 0000000000..dc251e3642 --- /dev/null +++ b/r/redis-bv/Dockerfiles/8.8.0_ubi_9.8/redis-bv_8.8.0.patch @@ -0,0 +1,79 @@ +diff --git a/src/debug.c b/src/debug.c +index e14f2a5..9646ef7 100644 +--- a/src/debug.c ++++ b/src/debug.c +@@ -1781,6 +1781,59 @@ void logRegisters(ucontext_t *uc) { + (unsigned long) uc->uc_mcontext.fault_address + ); + logStackContent((void**)uc->uc_mcontext.arm_sp); ++ #elif defined(__powerpc64__) /* Linux ppc64le */ ++ serverLog(LL_WARNING, ++ "\n" ++ "NIP :%016lx MSR :%016lx CTR :%016lx\n" ++ "LR :%016lx XER :%016lx CCR :%016lx\n" ++ "R0 :%016lx R1 :%016lx R2 :%016lx R3 :%016lx\n" ++ "R4 :%016lx R5 :%016lx R6 :%016lx R7 :%016lx\n" ++ "R8 :%016lx R9 :%016lx R10 :%016lx R11 :%016lx\n" ++ "R12 :%016lx R13 :%016lx R14 :%016lx R15 :%016lx\n" ++ "R16 :%016lx R17 :%016lx R18 :%016lx R19 :%016lx\n" ++ "R20 :%016lx R21 :%016lx R22 :%016lx R23 :%016lx\n" ++ "R24 :%016lx R25 :%016lx R26 :%016lx R27 :%016lx\n" ++ "R28 :%016lx R29 :%016lx R30 :%016lx R31 :%016lx\n", ++ (unsigned long) uc->uc_mcontext.gp_regs[32], /* NIP */ ++ (unsigned long) uc->uc_mcontext.gp_regs[33], /* MSR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[35], /* CTR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[36], /* LR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[37], /* XER */ ++ (unsigned long) uc->uc_mcontext.gp_regs[38], /* CCR */ ++ (unsigned long) uc->uc_mcontext.gp_regs[0], ++ (unsigned long) uc->uc_mcontext.gp_regs[1], ++ (unsigned long) uc->uc_mcontext.gp_regs[2], ++ (unsigned long) uc->uc_mcontext.gp_regs[3], ++ (unsigned long) uc->uc_mcontext.gp_regs[4], ++ (unsigned long) uc->uc_mcontext.gp_regs[5], ++ (unsigned long) uc->uc_mcontext.gp_regs[6], ++ (unsigned long) uc->uc_mcontext.gp_regs[7], ++ (unsigned long) uc->uc_mcontext.gp_regs[8], ++ (unsigned long) uc->uc_mcontext.gp_regs[9], ++ (unsigned long) uc->uc_mcontext.gp_regs[10], ++ (unsigned long) uc->uc_mcontext.gp_regs[11], ++ (unsigned long) uc->uc_mcontext.gp_regs[12], ++ (unsigned long) uc->uc_mcontext.gp_regs[13], ++ (unsigned long) uc->uc_mcontext.gp_regs[14], ++ (unsigned long) uc->uc_mcontext.gp_regs[15], ++ (unsigned long) uc->uc_mcontext.gp_regs[16], ++ (unsigned long) uc->uc_mcontext.gp_regs[17], ++ (unsigned long) uc->uc_mcontext.gp_regs[18], ++ (unsigned long) uc->uc_mcontext.gp_regs[19], ++ (unsigned long) uc->uc_mcontext.gp_regs[20], ++ (unsigned long) uc->uc_mcontext.gp_regs[21], ++ (unsigned long) uc->uc_mcontext.gp_regs[22], ++ (unsigned long) uc->uc_mcontext.gp_regs[23], ++ (unsigned long) uc->uc_mcontext.gp_regs[24], ++ (unsigned long) uc->uc_mcontext.gp_regs[25], ++ (unsigned long) uc->uc_mcontext.gp_regs[26], ++ (unsigned long) uc->uc_mcontext.gp_regs[27], ++ (unsigned long) uc->uc_mcontext.gp_regs[28], ++ (unsigned long) uc->uc_mcontext.gp_regs[29], ++ (unsigned long) uc->uc_mcontext.gp_regs[30], ++ (unsigned long) uc->uc_mcontext.gp_regs[31] ++ ); ++ logStackContent((void **)uc->uc_mcontext.gp_regs[1]); /* R1 = stack pointer */ + #else + NOT_SUPPORTED(); + #endif +diff --git a/tests/support/util.tcl b/tests/support/util.tcl +index e46da15..abe86cb 100644 +--- a/tests/support/util.tcl ++++ b/tests/support/util.tcl +@@ -1320,6 +1320,10 @@ proc system_backtrace_supported {} { + } elseif {$system_name ne {linux}} { + return 0 + } ++ # ppc64le backtrace() does not reliably capture full stack traces ++ if {[exec uname -m] eq {ppc64le}} { ++ return 0 ++ } + + # libmusl does not support backtrace. Also return 0 on + # static binaries (ldd exit code 1) where we can't detect libmusl