Skip to content

feat: add --redis-stack flag to dapr init for RediSearch support#1644

Open
singhvishalkr wants to merge 1 commit into
dapr:masterfrom
singhvishalkr:feat-redis-stack-init
Open

feat: add --redis-stack flag to dapr init for RediSearch support#1644
singhvishalkr wants to merge 1 commit into
dapr:masterfrom
singhvishalkr:feat-redis-stack-init

Conversation

@singhvishalkr
Copy link
Copy Markdown

Currently dapr init deploys a standard Redis container (redis:6) that does not include RediSearch. RediSearch is required for Dapr Agents' vector store capabilities and must be explicitly loaded or bundled in a Redis distribution that includes it.

This PR adds a --redis-stack flag to the dapr init command that switches the deployed Redis image to redis/redis-stack-server, which bundles Redis OSS with RediSearch and other modules pre-installed.

Usage:

dapr init --redis-stack

Changes:

  • Added redisStackDockerImageName and redisStackGhcrImageName constants for the redis-stack image
  • Added redisStack field to initInfo struct
  • Modified Init() function signature to accept the new redisStack parameter
  • Updated runRedis() to use the redis-stack image when the flag is set
  • Added --redis-stack flag to the init command with appropriate help text and example

The change is opt-in via the flag, so existing behavior remains unchanged for users who don't need RediSearch.

Closes #1607

Add a new --redis-stack flag to the dapr init command that deploys
redis/redis-stack-server instead of the standard Redis container.
Redis Stack bundles RediSearch which is required for Dapr Agents
vector store capabilities.

When --redis-stack is specified:
- Uses docker.io/redis/redis-stack-server:latest for Docker Hub
- Uses redis/redis-stack-server:latest for GHCR

This enables Dapr Agents Redis VectorStore to work out of the box
without additional configuration.

Signed-off-by: Vishal Kumar Singh <vishal.kr.singh2021@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in --redis-stack flag to dapr init (self-hosted) to deploy Redis Stack instead of the default Redis container, enabling RediSearch-backed scenarios such as vector store usage.

Changes:

  • Introduces Redis Stack image constants and a redisStack toggle in standalone init flow.
  • Updates Redis container startup logic to select the Redis Stack image when the flag is enabled.
  • Adds the --redis-stack CLI flag with help text and an example.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
cmd/init.go Adds the --redis-stack flag and CLI help/example text for dapr init.
pkg/standalone/standalone.go Adds Redis Stack image constants and plumbs a new redisStack option into Redis container provisioning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/init.go
Comment on lines 233 to 238
InitCmd.Flags().StringVarP(&fromDir, "from-dir", "", "", "Use Dapr artifacts from local directory for self-hosted installation")
InitCmd.Flags().StringVarP(&imageVariant, "image-variant", "", "", "The image variant to use for the Dapr runtime, for example: mariner")
InitCmd.Flags().StringVarP(&schedulerVolume, "scheduler-volume", "", "dapr_scheduler", "Self-hosted only. Specify a volume for the scheduler service data directory.")
InitCmd.Flags().StringVarP(&schedulerOverrideBroadcastHostPort, "scheduler-override-broadcast-host-port", "", "", "Self-hosted only. Specify the scheduler broadcast host and port, for example: 192.168.42.42:50006. If not specified, it uses localhost:50006 (6060 for Windows).")
InitCmd.Flags().BoolVarP(&redisStack, "redis-stack", "", false, "Use redis-stack-server image instead of standard Redis for RediSearch support")
InitCmd.Flags().BoolP("help", "h", false, "Print this help message")
Comment on lines 191 to 193
// Init installs Dapr on a local machine using the supplied runtimeVersion.
func Init(runtimeVersion, dashboardVersion string, dockerNetwork string, slimMode bool, imageRegistryURL string, fromDir string, containerRuntime string, imageVariant string, daprInstallPath string, schedulerVolume *string, schedulerOverrideBroadcastHostPort *string) error {
func Init(runtimeVersion, dashboardVersion string, dockerNetwork string, slimMode bool, imageRegistryURL string, fromDir string, containerRuntime string, imageVariant string, daprInstallPath string, schedulerVolume *string, schedulerOverrideBroadcastHostPort *string, redisStack bool) error {
var err error
Comment on lines +62 to +65
daprDockerImageName = "docker.io/daprio/dapr"
redisDockerImageName = "docker.io/redis:6"
redisStackDockerImageName = "docker.io/redis/redis-stack-server:latest"
zipkinDockerImageName = "docker.io/openzipkin/zipkin"
Comment on lines +471 to 479
if info.redisStack {
ghcrImage = redisStackGhcrImageName
dockerImage = redisStackDockerImageName
}
imageName, err = resolveImageURI(daprImageInfo{
ghcrImageName: redisGhcrImageName,
dockerHubImageName: redisDockerImageName,
ghcrImageName: ghcrImage,
dockerHubImageName: dockerImage,
imageRegistryURL: info.imageRegistryURL,
imageRegistryName: defaultImageRegistryName,
Comment on lines +72 to +75
daprGhcrImageName = "dapr/dapr"
redisGhcrImageName = "dapr/3rdparty/redis:6"
redisStackGhcrImageName = "redis/redis-stack-server:latest"
zipkinGhcrImageName = "dapr/3rdparty/zipkin"
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.

feat: enable RediSearch support in dapr init for vector store capabilities

2 participants