Skip to content

RED-191626 , RED-191854 - modules modernization - #15253

Merged
sundb merged 82 commits into
redis:unstablefrom
TalBarYakar:tal.ba/feat/add_redis_docker_files
Jul 8, 2026
Merged

sundb merged 82 commits into
redis:unstablefrom
TalBarYakar:tal.ba/feat/add_redis_docker_files

Conversation

@TalBarYakar

@TalBarYakar TalBarYakar commented May 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Redis core and the external modules (Search, JSON, Bloom, TimeSeries) are currently built and released through separate flows, forcing anyone assembling a full distribution to juggle multiple repos, refs, build commands, and config files.

This PR collapses that into one Redis-owned workflow:

make modules-update    # clone/refresh modules from modules/modules.yaml
make bootstrap         # install per-module build/test deps
make build             # build Redis core + selected modules
make run               # start redis-server with modules loaded
make test all          # run module test suites
make tarball TAG=...   # build a reproducible source bundle

What This Adds

1. Manifest-driven modules — modules/modules.yaml is the single source of truth for bundled modules. Each entry pins repo/ref and defines its build artifact and runtime loadmodule path. Refs resolve dynamically (tag → branch → SHA, else fail).

Current pins: RedisBloom v8.9.81, RediSearch v8.9.82, RedisJSON v8.9.81, RedisTimeSeries v8.9.82.

2. Central manifest parser — scripts/lib/manifest.sh is the only YAML reader, usable both as a shell library and a CLI helper (via modules/manifest.mk).

3. Per-module stub Makefiles removed — The modules/redis*/Makefile stubs are deleted; their data moves to modules.yaml and shared behavior to modules/common.mk.

Make Workflow

The root Makefile is now a thin dispatch layer over scripts in scripts/:

Target Script Purpose
make build [args] scripts/build.sh Build Redis core plus selected modules
make bootstrap [args] scripts/bootstrap.sh Install per-module build/test prerequisites
make setup [args] scripts/setup.sh Run module update plus bootstrap
make run [args] scripts/run.sh Start Redis with selected modules loaded
make test [args] scripts/test.sh Run Redis or module tests
make clean [args] scripts/clean.sh Clean Redis and/or module outputs
make deploy [args] scripts/deploy.sh Install Redis and module artifacts
make modules-update [args] scripts/modules-update.sh Clone/refresh module sources from the manifest
make modules-shallow [args] scripts/modules-shallow.sh Re-clone selected modules with shallow history
make sync-redis-conf [args] scripts/sync-redis-conf.sh Regenerate managed module config
make tarball TAG=... scripts/tarball.sh Create a reproducible Redis + modules source tarball

All accept module selectors:

make build all              # core + all modules
make build redisjson        # core + one module
make run none               # core only, no modules
make test redisearch TEST='some:test:name'

Runtime Configuration

Removes the hand-maintained redis-full.conf (which could drift from upstream). Config is now generated: sync-redis-conf.sh produces a managed Modules block appended to verbatim redis.conf, with loadmodule lines (active when built or ASSUME_BUILT=1) plus each module's module.conf. The generated file is git-ignored.

Docker & Release

  • docker/Dockerfile.noble — Ubuntu 24.04 build env for core + modules (amd64/arm64).
  • scripts/tarball.sh — reproducible source bundle: archives core at TAG, clones modules at pinned refs, strips .git/build artifacts, generates config, and produces a deterministic gzip. utils/releasetools/01_create_tarball.sh now delegates to it.
  • post-release-automation.yml — builds the bundle on published releases, uploads it as artifact + release asset, and reports SHA256.

Docs

modules/MODULES.md (operator guide), modules/README.md, and README.md cover the manifest schema, Make targets, tarball flow, Docker env, and troubleshooting.

Compatibility Notes

  • BUILD_WITH_MODULES=yes is replaced by make build [redis|core|none|all|<module>...].
  • redis-full.conf is now generated and git-ignored.
  • Module clones live under modules/<name>/src/ (git-ignored).
  • vector-sets is omitted — it already lives in-tree.
  • RediSearch builds with LTO=1 REDISEARCH_GENERATE_HEADERS=0 INLINE_LSE_ATOMICS=0.

Note

Medium Risk
Large change to default build/release paths and published release artifacts; mistakes could ship wrong module pins or broken tarballs, but scope is build/packaging rather than runtime security or data handling.

Overview
Replaces the old BUILD_WITH_MODULES=yes gate with a unified, Redis-owned flow: modules/modules.yaml pins upstream repos/refs and artifact paths, scripts/lib/manifest.sh + modules/manifest.mk parse it, and the root Makefile dispatches to thin scripts/*.sh for modules-update, bootstrap, build, run, test, clean, deploy, sync-redis-conf, and tarball.

Build layout changes: per-module modules/*/Makefile stubs are removed in favor of shared modules/common.mk (manifest-driven clone fallback, build_env, Darwin→macos paths). redis-full.conf is no longer tracked—it’s regenerated (and git-ignored) from redis.conf + module loadmodule/module.conf blocks; release tarballs bake that into redis.conf via apply-redis-conf.sh.

Release & DX: utils/releasetools/01_create_tarball.sh now execs scripts/tarball.sh (reproducible bundle with embedded module sources). New Post-Release Automation workflow builds redis-full.tar.gz on release: published, checks size, uploads artifact + release asset, and prints SHA256. docker/Dockerfile.noble + .dockerignore add an Ubuntu 24.04 build image that installs core deps and runs bundled module install scripts from the manifest.

Docs (README.md, modules/MODULES.md, modules/README.md) and .gitignore are updated for make modules-update, generated config, and ignored modules/<name>/src/ clones.

Reviewed by Cursor Bugbot for commit a48ee08. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread README.md Resolved
Comment thread scripts/sync-redis-conf.sh Resolved
Comment thread scripts/tarball.sh Resolved
@gabsow

gabsow commented May 26, 2026

Copy link
Copy Markdown
Collaborator
  1. add readme for every module in the module folder to pint the web user to the target repo

@gabsow

gabsow commented May 26, 2026

Copy link
Copy Markdown
Collaborator
  1. lets tack about moving repos to redis org

@gabsow

gabsow commented May 26, 2026

Copy link
Copy Markdown
Collaborator
  1. redis conf in the tar file needs to be good for destrbutions lets tack about it with @dariaguy @kalinstaykov

Comment thread Makefile Resolved
Comment thread modules/common.mk Resolved
Comment thread scripts/build.sh Resolved
Comment thread modules/Makefile
Comment on lines 94 to 106
handle-werrors: get_source
ifeq ($(DISABLE_WERRORS),yes)
@echo "Disabling -Werror for all modules"
@for dir in $(SUBDIRS); do \
echo "Processing $$dir"; \
find $$dir/src -type f \
\( -name "Makefile" \
-o -name "*.mk" \
-o -name "CMakeLists.txt" \) \
-exec sed -i 's/-Werror//g' {} +; \
-exec sed -i.werrors_bak 's/-Werror//g' {} +; \
find $$dir/src -type f -name '*.werrors_bak' -delete; \
done
endif

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note, handle-werrors target is obsolete and was removed in https://github.com/redis/redis/pull/15257/changes as it is not longer required and leads to errors.

Comment thread modules/Makefile
Comment on lines +19 to +22
for dir in $(SUBDIRS); do \
mkdir -p "$$dir"; \
$(MAKE) -C "$$dir" -f "$(COMMON_MK)" $(1); \
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is a known problem with this loop: it hides failures for all modules except for the last one. E.g., if first one fails it just continues the build.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe this section should be removed. We should use the new flow with the make build command instead.
WDY @Peter-Sh ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@TalBarYakar
I'm not sure I understand what do you mean by the new flow, maybe I missed something in the PR, could you please provide an example?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@TalBarYakar I think that maybe since this error was not introduced by your PR the issue with error handling should also be eventually addressed in different PR after this is merged, to not over-complicate the changes .

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with @Peter-Sh that build error in this loops should not be silently ignored.
Maybe add set -e; \ after define submake and before the for loop?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread modules/Makefile Resolved
Comment thread modules/README.md Outdated
`redisjson`).

```bash
make setup # all modules

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let suggested the modules update, I thought we removed the setup

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@TalBarYakar
TalBarYakar requested a review from Peter-Sh May 28, 2026 17:43
Comment thread scripts/bootstrap.sh Resolved
Comment thread Makefile Resolved
Comment thread modules/README.md Resolved
Comment thread README.md Resolved
… banner.

  It is now identical to upstream/unstable; nothing in the normal flow edits it.
- sync-redis-conf.sh: emit redis.conf verbatim, then append the generated
  Modules block (loadmodule lines + per-module config, diagnostics inside the
  block). Regeneration strips any previously-appended block first, so it stays
  idempotent without core markers.
    * strip_modules_block: strict marker validation on redis.conf — fail loudly
      on unbalanced/mis-ordered markers instead of silently truncating, since
      the output can be baked into redis.conf. [codex P2]
    * strip_private_block: prefix-match + lenient — strips a module.conf's
      redis-gen-conf:private block whether it ends "<<<" or ">>>" (modules ship
      both), and a marker typo never aborts the build.
- apply-redis-conf.sh: apply-only (revert removed); invoked only by
  `make tarball` to bake module config into the packaged redis.conf.
- Makefile: drop the apply-redis-conf target + arg-capture/glue; fix the stale
  deploy comment (deploy rewrites loadmodule paths directly). [codex P3]
- docs (README, modules/README, MODULES.md): flow described via
  make modules-update / sync-redis-conf / tarball only — no apply-redis-conf
  target, no core markers, no revert.

Verified for each module individually, in combinations, and all: core copied
verbatim, private stripped, correct loadmodule lines, and redis-server boots
with every module loaded and its commands working.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 5 total unresolved issues (including 4 from previous reviews).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit fb51afe. Configure here.

Comment thread scripts/tarball.sh
if [ "${TARBALL_SKIP_MODULES_UPDATE:-}" != "1" ]; then
echo "==> [tarball] pre-step: modules-update all (shallow)"
MODULES_UPDATE_SHALLOW=1 "$SCRIPT_DIR/modules-update.sh" all
echo

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tarball step mutates workspace

Medium Severity

By default, make tarball runs a full shallow modules-update in the current repository before staging. That refreshes every local modules/*/src checkout and regenerates redis-full.conf, even though the release artifact is assembled separately via git archive and fresh clones under the staging directory.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb51afe. Configure here.

@gabsow

gabsow commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bumps the pinned module versions for RedisTimeSeries, RedisJSON, and RedisBloom.

Module | From | To -- | -- | -- RedisTimeSeries | v8.9.81 | v8.9.82 RedisJSON | v8.9.80 | v8.9.81 RedisBloom | v8.9.80 | v8.9.81

RedisTimeSeries

Bumps the pinned MODULE_VERSION for RedisTimeSeries from v8.9.81 to v8.9.82.

Module changes (v8.9.81 → v8.9.82)

  • MOD-14615 — run valgrind test suite serially to avoid CPU oversubscription (#2083)
  • MOD-14615 — skip test_asm migration-query test on macos-15-intel (#2084)
  • MOD-16299 — NRANGE support multiple aggregations (#2079)
  • MOD-16514 — fix bootstrap & build for all os (#2082)
  • MOD-16653 — Prevent more heap overflow + other rdb load assertions (#2086)

RedisJSON

Bumps the pinned MODULE_VERSION for RedisJSON from v8.9.80 to v8.9.81.

Module changes (v8.9.80 → v8.9.81)

  • Remove #[cfg(not(feature = "as-library"))] from sync_hide_user_data_from_log (#1613)
  • MOD-16366 — add flow tests to check llapi c api (#1614)
  • MOD-16514 — fix bootstrap & build for all os (#1612)
  • MOD-16300 — perf(json_path): materialize filter literals once per query (#1615)

RedisBloom

Bumps the pinned MODULE_VERSION for RedisBloom from v8.9.80 to v8.9.81.

Note: the v8.9.80...v8.9.81 ancestry diff contains 2 commits and both are genuinely new. The v8.9.80 release side only contains a version bump after the merge base, so there are no already-merged commits to exclude.

Module changes (v8.9.80 → v8.9.81)

  • MOD-16514 — fix the bootstrap and build (#1028)
  • try another method (#1030)

Summary
Bumps the pinned module versions for RedisTimeSeries, RedisJSON, and RedisBloom.

Module From To
RedisTimeSeries v8.9.81 v8.9.82
RedisJSON v8.9.80 v8.9.81
RedisBloom v8.9.80 v8.9.81
RedisTimeSeries
Bumps the pinned MODULE_VERSION for RedisTimeSeries from v8.9.81 to v8.9.82.

Module changes (v8.9.81 → v8.9.82)
MOD-14615 — run valgrind test suite serially to avoid CPU oversubscription (RedisTimeSeries/RedisTimeSeries#2083)
MOD-14615 — skip test_asm migration-query test on macos-15-intel (RedisTimeSeries/RedisTimeSeries#2084)
MOD-16299 — NRANGE support multiple aggregations (RedisTimeSeries/RedisTimeSeries#2079)
MOD-16514 — fix bootstrap & build for all os (RedisTimeSeries/RedisTimeSeries#2082)
MOD-16653 — Prevent more heap overflow + other rdb load assertions (RedisTimeSeries/RedisTimeSeries#2086)
RedisJSON
Bumps the pinned MODULE_VERSION for RedisJSON from v8.9.80 to v8.9.81.

Module changes (v8.9.80 → v8.9.81)
Remove #[cfg(not(feature = "as-library"))] from sync_hide_user_data_from_log (RedisJSON/RedisJSON#1613)
MOD-16366 — add flow tests to check llapi c api (RedisJSON/RedisJSON#1614)
MOD-16514 — fix bootstrap & build for all os (RedisJSON/RedisJSON#1612)
MOD-16300 — perf(json_path): materialize filter literals once per query (RedisJSON/RedisJSON#1615)
RedisBloom
Bumps the pinned MODULE_VERSION for RedisBloom from v8.9.80 to v8.9.81.

Note: the v8.9.80...v8.9.81 ancestry diff contains 2 commits and both are genuinely new. The v8.9.80 release side only contains a version bump after the merge base, so there are no already-merged commits to exclude.

Module changes (v8.9.80 → v8.9.81)
MOD-16514 — fix the bootstrap and build (RedisBloom/RedisBloom#1028)
try another method (RedisBloom/RedisBloom#1030)

skaslev added a commit that referenced this pull request Jul 14, 2026
After #15253 parallel builds started to warn:

```
  ~/..../redis$ make -j
  ==> Building main Redis (src/)
  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  make[1]: Entering directory '~/..../redis/src'
      CC Makefile.dep
  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  ....
```

and use only a single process when building, ignoring the `-j` flag.

Fix this by invoking build scripts with `+` prefix to let `make` know we
spawn sub-make, so it keeps the jobserver pipe fd open for the script.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit ca8c7c1. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
YaacovHazan pushed a commit that referenced this pull request Jul 14, 2026
#15454)

Followup #15253

Updates build-from-source documentation for Redis 8.10+: release flows
use redis-full.tar.gz, start the server with redis.conf (module config
baked into release tarballs), and document explicit Rust 1.94 and LLVM
21 / lld where RediSearch LTO needs them—instead of relying on
INSTALL_RUST_TOOLCHAIN=yes and make modules-update in those paths.
Ubuntu 20.04 instructions switch to GCC 11 (PPA) for C++20 libstdc++;
Alma/Rocky sections add lld/llvm, python3 alternatives on 8.10, and drop
make modules-update on Alma 10.

scripts/build.sh now runs modules install-rust when
INSTALL_RUST_TOOLCHAIN=yes, so make build matches the modules Makefile
behavior. The obsolete handle-werrors target has been removed from the
modules Makefile (matching #15257): it is no longer required
and was causing build errors, so DISABLE_WERRORS no longer strips
-Werror via this path.

Co-authored-by: Tom Gabsow <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
gabsow added a commit that referenced this pull request Jul 22, 2026
…ml changes (#15442)

Follow-up to #15253 (bundled data-type modules). Adds a GitHub Actions
workflow (`.github/workflows/modules-build-flow.yml`) that replays the
from-source flow documented in
[modules/README.md](https://github.com/redis/redis/blob/unstable/modules/README.md)
on **every OS the bundled modules support** — the same 15-OS list the
modules' own nightlies build against — across **x64 and arm64**, each in
a **clean stock container** (no Dockerfiles):

```
make modules-update          # clone each module pinned in modules.yaml
make bootstrap               # per-module build/test prereqs
make -j all BUILD_TLS=yes    # Redis + all modules (LTO=1 via redisearch build_env)
./src/redis-server redis-full.conf   +   redis-cli MODULE LIST   # smoke test
```

### When it runs
- **On pull requests that change `modules/modules.yaml`.** Bumping a
module's pinned `ref` is exactly when the from-source build/load can
break on some OS, so the whole matrix re-verifies then. On a PR it
checks out the PR merge ref, so it builds the **bumped pins**, not
`unstable` (works for fork PRs too).
- **`workflow_dispatch`** for manual runs, with `use_repo`/`use_git_ref`
inputs to point at any repo/branch.

It **builds and smoke-tests only** — starts the server and asserts
`MODULE LIST` contains `bf`/`search`/`ReJSON`/`timeseries`. It does
**not** run the per-module `make test all` suites; those live in each
module's own CI.

### Design
- **Clean containers, no Dockerfiles** — one matrix job per `arch ×
osnick`; every image is a stock multi-arch base
(ubuntu/debian/alma/rocky/amazonlinux/azurelinux/alpine).
- **Prereqs = only what the manual assumes present** before its first
command (git, make, CA certs; `gawk`/`findutils` on minimal rpm images;
`bash` on alpine; `openssl` + dev headers). Compilers and per-module
toolchains must come from `make bootstrap` — if they don't, the manual
is broken on that OS and this workflow catches exactly that.
- **`BUILD_TLS=yes`** — the README's documented full-build flag
(redisearch's TLS test env expects it).
- **No node-based actions inside containers** (plain `git clone`) — they
can't start on older-glibc images.

### Validation
Ran the full matrix on a fork against the upcoming module refs
(redisearch + redistimeseries at `master`, i.e. post-RediSearch#10372):
**30/30 jobs green** across all 15 OSes on both arches — build + `MODULE
LIST` smoke (fork Actions run `29747001924`). Once `modules.yaml` is
bumped to the retagged versions carrying the merged bootstrap/LTO fixes
(RediSearch
[#10372](RediSearch/RediSearch#10372) /
[#10373](RediSearch/RediSearch#10373),
RedisTimeSeries
[#2089](RedisTimeSeries/RedisTimeSeries#2089)),
the matrix is green with no per-module workarounds in the workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Adds CI-only automation with no changes to Redis runtime, auth, or
data paths.
> 
> **Overview**
> Adds **`.github/workflows/modules-build-flow.yml`**, a GitHub Actions
workflow that replays the documented from-source modules flow (`make
modules-update` → `make bootstrap` → `make all BUILD_TLS=yes`) inside
**stock** container images on **x64 and arm64** across **15 OS
variants** (Ubuntu, Debian, Alma/Rocky, Amazon Linux 2023, Azure Linux
3, Alpine).
> 
> It runs on **PRs that touch `modules/modules.yaml`** and on
**`workflow_dispatch`** (optional repo/ref). Each job installs only the
manual’s baseline packages (git, make, TLS/openssl tooling, etc.), uses
a **plain `git fetch` checkout** (including the PR merge ref on
path-filtered PRs) instead of `actions/checkout`, then **starts
`redis-server` with `redis-full.conf`** and asserts **`MODULE LIST`**
includes **bf**, **search**, **ReJSON**, and **timeseries**.
> 
> The workflow also encodes several container-specific fixes: pinned
**`PATH`** after bootstrap, job-level **`CXXFLAGS`** for GCC/clang
`-Werror` noise, **`rm /.dockerenv`** so module bootstrap installs test
Python envs, and **tdnf install retries** on Azure Linux.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
80d2e37. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: TalBarYakar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants