Repository navigation
MOD-16514 - fix the bootstrap and build - #1028
Conversation
gabsow
left a comment
There was a problem hiding this comment.
Reviewed the bootstrap/build changes — two robustness notes inline, both non-blocking. Heads-up on cross-module consistency: this PR's bionic.sh diverges from the sibling RedisJSON #1612, which runs apt-get update first and hard-installs the prerequisites (gnupg wget curl ca-certificates) rather than soft-failing them. Worth keeping the three modules' bootstrap in sync. (cursor's GCC-alternative points look valid too.)
| echo 'debconf debconf/frontend select Noninteractive' | $SUDO debconf-set-selections 2>/dev/null || true | ||
| echo 'tzdata tzdata/Areas select Etc' | $SUDO debconf-set-selections 2>/dev/null || true | ||
| echo 'tzdata tzdata/Zones/Etc select UTC' | $SUDO debconf-set-selections 2>/dev/null || true | ||
| $SUDO apt-get install -y --no-install-recommends gnupg wget 2>/dev/null || true |
There was a problem hiding this comment.
gnupg/wget are installed here before any apt-get update has run. apt_install's deferred apt-get update (guarded by _pm_apt_updated) is first triggered later at apt_install software-properties-common ..., so on a clean bionic image — ubuntu:18.04 ships with empty /var/lib/apt/lists and no preinstalled gnupg/wget — this apt-get install finds nothing to resolve and, because it ends in 2>/dev/null || true, the failure is swallowed. With gpg then absent, the two wget ... | gpg --dearmor ... || true key-import lines below also silently no-op, so the toolchain-r keyrings are never written. The PPA .list gets added unsigned, and the later apt_install gcc-10 g++-10 (no || true) fails because apt won't install from the unsigned repo. Run apt-get update first and hard-install the prerequisites:
$SUDO apt-get update -qq
$SUDO apt-get install -y --no-install-recommends gnupg wget ca-certificates| arch=$(uname -m) | ||
| local url="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" | ||
| [ "$arch" = "aarch64" ] && url="https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" | ||
| curl "$url" -o /tmp/awscliv2.zip |
There was a problem hiding this comment.
curl "$url" -o /tmp/awscliv2.zip lacks -f: on an HTTP 4xx/5xx, curl exits 0 and writes the error body into the file. The next line's unzip then fails with a confusing "cannot find zipfile directory" and, under the script's set -euo pipefail, aborts the whole bootstrap pointing at unzip instead of the real download failure. Use curl -fSL --retry 3 "$url" -o /tmp/awscliv2.zip so a bad download fails loudly at the curl step (--retry also rides out transient network blips).
|
Cross-module consistency (non-blocking) — this is one of three sibling PRs applying the same CI bootstrap/build fix:
Their
None of this blocks — flagging so the three don't silently diverge. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b68c79. Configure here.
| try: | ||
| self.cmd('CF.INSERT', 'cf', 'ITEMS', *["1 "]*140000) | ||
| except ResponseError: | ||
| pass |
There was a problem hiding this comment.
Overflow test always passes
Low Severity
test_counter_overflow_with_large_number_of_items now wraps the large CF.INSERT in a bare try/except ResponseError that ignores every error. The test no longer checks successful insert or overflow behavior, so regressions in that path can pass CI without failing.
Reviewed by Cursor Bugbot for commit 4b68c79. Configure here.
gabsow
left a comment
There was a problem hiding this comment.
Re-reviewed after the fix commits — all blockers resolved:
- HIGH (GCC-10 never selected on Ubuntu): bionic/focal now
--setgcc/g++/cc to 10, sodebian_default_install's priority-100 pin no longer wins and the toolchain is consistently on gcc-10. ✅ - gnupg/wget before
apt-get update: now runsapt-get updatefirst and hard-installs the prerequisites (no more silent key-import no-op). ✅ - curl
-fon AWS CLI download, AL2 dangling devtoolset symlinks: resolved. ✅
One non-blocking nit remains (not gating approval): tests/flow/test_cuckoo.py:35 still wraps the large CF.INSERT in try/except ResponseError: pass, so the overflow test passes regardless of outcome — worth tightening in a follow-up so it can't mask a regression.
LGTM — approving.
* MOD-16514 - fix the bootstrap and build (#1028) * install aws if and only if it is not installed yet * add another build fixes * fix build for amazonlinux2 * fix(al2): add cc symlink to devtoolset-11 to fix LTO version mismatch * alma8 +rhel8+rhel9+bionic +focal passes * fix for bionic * fix * bump rltest * fix bionic bootstrap * fix azurelinux3 * bionic fix * fix for bullesye * fix focal ci * fix the test due to bump rltest version * fix for bionic and focal * fix * fix remarks * try another methood (#1030) * bump version 8.9.81
* MOD-16514 - fix the bootstrap and build (#1028) * install aws if and only if it is not installed yet * add another build fixes * fix build for amazonlinux2 * fix(al2): add cc symlink to devtoolset-11 to fix LTO version mismatch * alma8 +rhel8+rhel9+bionic +focal passes * fix for bionic * fix * bump rltest * fix bionic bootstrap * fix azurelinux3 * bionic fix * fix for bullesye * fix focal ci * fix the test due to bump rltest version * fix for bionic and focal * fix * fix remarks * try another methood (#1030) * bump version 8.9.81
* install aws if and only if it is not installed yet * add another build fixes * fix build for amazonlinux2 * fix(al2): add cc symlink to devtoolset-11 to fix LTO version mismatch * alma8 +rhel8+rhel9+bionic +focal passes * fix for bionic * fix * bump rltest * fix bionic bootstrap * fix azurelinux3 * bionic fix * fix for bullesye * fix focal ci * fix the test due to bump rltest version * fix for bionic and focal * fix * fix remarks
* MOD-16514 - fix the bootstrap and build (#1028) * install aws if and only if it is not installed yet * add another build fixes * fix build for amazonlinux2 * fix(al2): add cc symlink to devtoolset-11 to fix LTO version mismatch * alma8 +rhel8+rhel9+bionic +focal passes * fix for bionic * fix * bump rltest * fix bionic bootstrap * fix azurelinux3 * bionic fix * fix for bullesye * fix focal ci * fix the test due to bump rltest version * fix for bionic and focal * fix * fix remarks * try another methood (#1030) * MOD-16871: replicate in `cfInsertCommon` after `cfCreate` in case of errors (#1034) * MOD-16871: relicate in after * . * MOD-16306 - pull docker images from registry (#1036) * MOD-16306 - pull docker images from registry * cherry pick changes to bloom * MOD-13409 Harden RDB loading (#1038) * MOD-13409 Validate Bloom RDB bitset size on load (#126) * MOD-13409 Validate Bloom RDB bitset size on load Reject crafted module payloads where the loaded bloom bitset buffer length does not match the declared bits/n2, and add a flow regression test covering RESTORE with a corrupted DUMP payload. * MOD-13409 clang-format rebloom.c Run clang-format on rebloom.c to satisfy make lint formatting checks. * MOD-13409 Validate Bloom RDB bitset length on load Reject crafted module payloads where persisted bits do not match the loaded bitset buffer length, preventing OOB access after RESTORE. * Mod 13409 rdb hardening (#127) * MOD-13409 clang-format rebloom.c Run clang-format on rebloom.c to satisfy make lint formatting checks. * MOD-13409 Harden CF RDB load buffer validation Replace assert-only checks in CFRdbLoad with explicit validation of loaded sizes and ranges, and add a flow test that corrupts a CF DUMP payload to ensure RESTORE is rejected. * MOD-13409 Harden remaining RDB loaders (TDigest) TDigest RDB loading trusted attacker-controlled cap, which could desync the allocated centroid arrays from the loaded metadata and enable OOB access after RESTORE. Reject payloads where loaded cap differs from the allocated cap derived from compression, validate node counters, and add a flow regression that corrupts a TDigest DUMP payload and asserts RESTORE is rejected. With the earlier BF/CF fixes, this covers all remaining module data structures that load raw buffers from RDB/RESTORE (CMS/TopK already validate buffer sizes). * Revert "MOD-13409 clang-format rebloom.c" This reverts commit 456e53503f51b68c4d7a9df988e50a36adf2e61a. * MOD-13409 Add regression for published P88W exploit * MOD-13409 Share RDB corruption test helpers * Fix TDigest RDB load node count overflow check Avoid signed overflow when validating merged and unmerged node counts by widening the addition. * MOD-16952 - enhance bootstrap (add list and dry-run arg) (#1037) * add bootstrap dry-run and chrck-deps * remove dry-run * write list to afile * add optional deps * add another optional deps * add another optional deps * add versioning managment * rename command to list * renme to list * add dry run * fix colors * fix bloom missing deps only for dry run * fix missing * remove min cmake version * fix remarks * fix remarks * fix remarks * fix remarks * fix remarks * add _sh so we can have the full bootstrap output * always return to the workspace dir * make single copy paste install all * fix alma8 * fix bad dry-run print * gaurd tool-set version 11 * fix curl minimal * remove centos-release-scl for amazonlinux2 * fix macos env * fix(bootstrap): make sudo a no-op on root containers without a sudo binary The install scripts run privileged steps via literal `sudo` inside `_sh` command strings (e.g. `sudo ln -sf ...`, `| sudo tee`, `&& sudo make install`). On a slim Docker image that runs install_script.sh directly as root with no `sudo` package installed (e.g. RedisTimeSeries' amazonlinux2 CI), those steps fail with `sudo: command not found` (exit 127), aborting the whole bootstrap. Add a root-only pass-through in pm.sh/deps_lib.sh: when running as root and no real `sudo` binary exists, define `sudo()` to run its arguments directly. When not root, a missing sudo stays a genuine error and is left unmasked. * bump version to 8.10.0 --------- Co-authored-by: Aviv David <[email protected]> Co-authored-by: Tom Gabsow <[email protected]>





Note
Medium Risk
Changes affect multi-OS bootstrap scripts and compiler/python alternatives used by all CI builds; mistakes could break builds on specific distros but don’t touch runtime Redis module logic.
Overview
Hardens CI/bootstrap across distros so builds get a consistent compiler, Python, and AWS CLI without fighting shared containers or apt’s clang defaults.
Shared AWS CLI v2 is added via
install_aws_cli()(arch-aware, no-op ifawsexists) and replaces duplicated installers on Rocky/Mariner/Amazon Linux and pip-based install on Azure Linux 3.Toolchain pinning:
debian_default_installforcescc/gcc/g++to the newest system GCC so clang doesn’t win afterclangpackages install. EL8/EL9 (and Amazon Linux 2 devtoolset) symlink gcc-toolset binaries into/usr/local/bin; EL8 also installspython3.11-pipand pinspython3to 3.11. Ubuntu bionic gets noninteractive apt, manual toolchain PPA setup, only upgrades to gcc-10 when the active compiler is older than 10, and builds cmake 3.28 only when needed; focal uses the same conditional gcc-10 logic.Flow tests:
RLTestis bumped to 0.7.27 withnumpy<2; a cuckoo overflow test toleratesResponseErroron a hugeCF.INSERT.Reviewed by Cursor Bugbot for commit 4b68c79. Bugbot is set up for automated code reviews on this repo. Configure here.