Skip to content

Update versions and smoke test for colab - #151

Merged
rbs333 merged 4 commits into
mainfrom
fix/redis8-colab-setup
Sep 28, 2026
Merged

rbs333 merged 4 commits into
mainfrom
fix/redis8-colab-setup

Conversation

@rbs333

@rbs333 rbs333 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Fix Colab setup + migrate notebooks to Redis 8

Problem

The Colab setup cell fails with E: Unable to locate package redis-stack-server.
Colab upgraded its base image to Ubuntu 24.04, so $(lsb_release -cs) now resolves
to noble — and packages.redis.io does not publish redis-stack-server for
noble
(it tops out at 7.4.0 on jammy/focal only). Every notebook's install cell
breaks, so the Colab "Open in Colab" workflow customers rely on is dead end-to-end.

Fix

Migrate the setup cells from redis-stack-server to Redis 8 (redis-server):

  • packages.redis.io ships redis-server up to 8.10.2 on both noble and jammy,
    and Redis 8 bundles the query engine + JSON into core (no separate module packages),
    so all FT.* / JSON.* commands the notebooks use keep working.
  • Keep the dynamic $(lsb_release -cs) — noble now resolves to a valid Redis 8
    package, so no codename pin is needed and the whole failure class goes away.
  • Docker fallback lines updated to docker run ... redis:8.

Why CI didn't catch it

Both test workflows provide Redis via a redis:8 service container, so the
notebooks' own apt-install cell is never actually executed (and --nbval-lax hides
its errors). This PR adds setup-smoke.yml, which runs the exact install snippet
on ubuntu-latest (= noble) and asserts Redis 8 comes up with FT.* and JSON.*
available. A weekly cron catches future distro/package drift even without a code change.

Changes

  • 35 notebooks: redis-stack-server → redis-server; docker refs → redis:8
  • .github/workflows/setup-smoke.yml: real apt-path smoke test + weekly cron
  • scripts/fix_redis8_setup.py: idempotent migration (rerun for any new notebook)
  • .gitignore: ignore the vendored python-recipes/vector-search/src/ checkout

Testing

  • All 35 notebooks re-validate as JSON; diff is purely the package/command swaps.
  • setup-smoke.yml proves the noble install path + Redis 8 module availability in CI.

Copilot AI lite review requested due to automatic review settings September 25, 2026 17:41

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Unresolved setup inconsistencies remain in the smoke test, three notebooks, and migration helper.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 5 Medium severity

Open (5)
What changed in this PR

Updates Colab notebook Redis setup from Redis Stack to Redis 8 and adds Noble installation smoke coverage.

Changes:

  • Migrates notebook setup and Docker fallbacks to Redis 8.
  • Adds scheduled installation and FT.*/JSON.* smoke testing.
  • Adds a migration helper and ignores vendored sources.
File Summary
scripts/​fix_redis8_setup.py Redis setup migration helper
python-recipes/​vector-search/​05_multivector_search.ipynb Redis 8 setup
python-recipes/​vector-search/​01_redisvl.ipynb Redis 8 setup
python-recipes/​vector-search/​00_redispy.ipynb Redis 8 setup
python-recipes/​semantic-router/​03_router_visualization.ipynb Redis 8 Docker fallback
python-recipes/​semantic-router/​02_advanced_semantic_routing.ipynb Redis 8 Docker fallback
python-recipes/​semantic-router/​01_routing_optimization.ipynb Redis 8 setup
python-recipes/​semantic-router/​00_semantic_routing.ipynb Redis 8 setup
python-recipes/​semantic-cache/​03_context_enabled_semantic_caching.ipynb Redis 8 setup
python-recipes/​semantic-cache/​02_semantic_cache_optimization.ipynb Redis 8 setup
python-recipes/​semantic-cache/​01_doc2cache_llama3_1.ipynb Redis 8 Docker setup
python-recipes/​semantic-cache/​00_semantic_caching_gemini.ipynb Redis 8 setup
python-recipes/​redis-intro/​00_redis_intro.ipynb Redis 8 setup
python-recipes/​recommendation-systems/​02_two_towers.ipynb Redis 8 setup
python-recipes/​recommendation-systems/​01_collaborative_filtering.ipynb Redis 8 setup
python-recipes/​recommendation-systems/​00_content_filtering.ipynb Redis 8 setup
python-recipes/​RAG/​07_user_role_based_rag.ipynb Redis 8 setup
python-recipes/​RAG/​06_ragas_evaluation.ipynb Redis 8 setup
python-recipes/​RAG/​05_nvidia_ai_rag_redis.ipynb Redis 8 setup
python-recipes/​RAG/​04_advanced_redisvl.ipynb Redis 8 setup
python-recipes/​RAG/​03_llamaindex.ipynb Redis 8 setup
python-recipes/​RAG/​02_langchain.ipynb Redis 8 setup
python-recipes/​RAG/​01_redisvl.ipynb Redis 8 setup
python-recipes/​MCP/​01_claude_agent_sdk_redisvl_mcp.ipynb Redis 8 Docker fallback
python-recipes/​llm-message-history/​01_multiple_sessions.ipynb Redis 8 setup
python-recipes/​llm-message-history/​00_llm_message_history.ipynb Redis 8 setup
python-recipes/​gateway/​00_litellm_proxy_redis.ipynb Redis 8 setup
python-recipes/​feature-store/​01_card_transaction_search.ipynb Redis 8 setup
python-recipes/​feature-store/​00_feast_credit_score.ipynb Redis 8 setup
python-recipes/​computer-vision/​00_facial_recognition_facenet.ipynb Redis 8 setup
python-recipes/​agents/​05_agent_framework_agent.ipynb Redis 8 setup
python-recipes/​agents/​04_autogen_agent.ipynb Redis 8 setup and output
python-recipes/​agents/​03_memory_agent.ipynb Redis 8 setup
python-recipes/​agents/​02_full_featured_agent.ipynb Redis 8 setup and Docker fallback
python-recipes/​agents/​01_crewai_langgraph_redis.ipynb Redis 8 setup
python-recipes/​agents/​00_langgraph_redis_agentic_rag.ipynb Redis 8 setup
.gitignore Ignores vendored vector-search sources
.github/​workflows/​setup-smoke.yml Redis 8 installation smoke test

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install -y redis-server
Comment thread python-recipes/MCP/01_claude_agent_sdk_redisvl_mcp.ipynb
Comment thread python-recipes/semantic-router/02_advanced_semantic_routing.ipynb
Comment thread python-recipes/semantic-router/03_router_visualization.ipynb
# Ordered: longer/specific patterns first so a bare "redis-stack-server" left in prose
# is never half-clobbered.
REPLACEMENTS = [
("redis/redis-stack-server:latest", "redis:8"),
@justin-cechmanek
justin-cechmanek self-requested a review September 25, 2026 19:22

@justin-cechmanek justin-cechmanek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏼

rbs333 and others added 3 commits September 25, 2026 16:02
- agents/05_agent_framework_agent: RedisHistoryProvider now defaults to
  key_format="scoped", which requires application_id; pass it plus agent_id
  to mirror the RedisContextProvider so history construction stops raising.
- recommendation-systems/01_collaborative_filtering: drop the numpy==1.25.0
  pin and bump to scikit-surprise>=1.1.4 (1.1.3 won't build on Python 3.12).
- RAG/06_ragas_evaluation: port to the ragas 0.2+ API (TestsetGenerator,
  EvaluationDataset, LangchainLLMWrapper/EmbeddingsWrapper), swap retired
  gpt-3.5-turbo-16k for gpt-4o-mini, pin langchain-community<0.4 so ragas
  imports, and disable ragas usage telemetry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add `-y` to `apt-get install redis-server` in all notebook setup cells so a
  headless Colab shell can't stall on apt's confirmation prompt; this matches the
  setup smoke test, which already used -y.
- Migrate the alternate setup pattern in 8 notebooks (MCP/00, MCP/01,
  semantic-router/02, /03, vector-search/02, /03, /06, /07) that installed `redis`
  and started redis-server with `--loadmodule .../redisearch.so`. Redis 8 has Search
  built in and that module path does not exist, so install redis-server and start
  without --loadmodule.
- Also migrate notebooks newly added on main (e.g. fraud-detection/00) that still
  used redis-stack-server.
- scripts/fix_redis8_setup.py: emit `-y` and correct the docstring's claim about
  recorded cell outputs (only the listed command/image strings are rewritten).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 25, 2026 20:15
@rbs333
rbs333 force-pushed the fix/redis8-colab-setup branch from 87ccb3e to 3e92917 Compare September 25, 2026 20:15

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Unresolved Docker fallbacks, dependency quoting, stale output, and migration coverage issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 Medium severity · 1 Low severity

Open (5)
Resolved since last review (3)

"source": [
"%pip install redis \"redisvl>=0.4.1\" pandas requests\n",
"%pip install numpy==1.25.0 scikit-surprise==1.1.3"
"%pip install scikit-surprise>=1.1.4"
Comment on lines +22 to +27
REPLACEMENTS = [
("redis/redis-stack-server:latest", "redis:8"),
("--name redis-stack-server", "--name redis"),
("apt-get install redis-stack-server", "apt-get install -y redis-server"),
("redis-stack-server --daemonize yes", "redis-server --daemonize yes"),
]
"output_type": "stream",
"text": [
"Unable to find image 'redis/redis-stack-server:latest' locally\n",
"Unable to find image 'redis:8' locally\n",
Library/dataset drift in recently-merged recipes, independent of the Redis 8
migration:

- semantic-router/02, 03: load_dataset("clinc_oos", "plus") fails on datasets
  3.x+ (script-based dataset, removed from the Hub). Switch to the parquet
  mirror "clinc/clinc_oos" (identical schema), which fixes the empty/undefined
  data_subset that cascaded downstream.
- semantic-router/03: plt.cm.get_cmap was removed in matplotlib 3.9+; use
  plt.get_cmap.
- MCP/00: redisvl.mcp MCPConfig no longer exposes binding_id/binding; read the
  per-index settings via validated_config.indexes["movies"].

Verified on Redis 8: semantic-router/03 nbval 19 passed / 1 skipped
(secret-free); semantic-router/02 nbval 24 passed / 14 skipped (OpenAI). The
MCP/00 config access was verified against redisvl 0.27 (a full run of that
notebook also needs GOOGLE_API_KEY + uvx).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 25, 2026 21:21

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Unresolved moderate issues remain in the workflow, migration script, and affected notebooks.

Review effort: Lite
Findings: 4 Medium severity · 1 Low severity

Open (5)

@rbs333
rbs333 merged commit e0d23ee into main Sep 28, 2026
34 checks passed
@rbs333
rbs333 deleted the fix/redis8-colab-setup branch September 28, 2026 12:07
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.

3 participants