containers icon indicating copy to clipboard operation
containers copied to clipboard

Load Redis module like RedisSearch

Open nemo83 opened this issue 1 year ago • 1 comments

Name and Version

bitnami/redis:latest

What is the problem this feature will solve?

It will allow the bitnami Kubernetes Helm Redis chart to offer FT.SEARCH capabilities, in particular HNSW indexes query

What is the feature you are proposing to solve the problem?

Add modules in the image as well as cusomising entrypoint/cmd scripts to load such modules

What alternatives have you considered?

I was thinking to use redis-stack but there are no helm charts for that.

nemo83 avatar Sep 07 '22 20:09 nemo83

Thanks for the suggestion, I just created an internal task to evaluate this feature. Due to the team capacity and other priorities we are working on, I can't provide an ETA for this evaluation. Because of that, I'm moving this issue to On hold and we'll update it once we have more news.

As usual, the Bitnami team will be happy to review any contribution via PRs and provide feedback. Here you can find the contributing guidelines.

carrodher avatar Sep 08 '22 06:09 carrodher

Until an official response is provided, you can use a custom image. Example Dockerfile:

FROM docker.io/redislabs/redisearch:latest as redisearch

FROM docker.io/bitnami/redis:6.2.10
COPY --from=redisearch /usr/lib/redis/modules/redisearch.so /usr/lib/redis/modules/redisearch.so
COPY --from=redisearch /usr/lib/redis/modules/rejson.so /usr/lib/redis/modules/rejson.so

CMD ["/run.sh", "--loadmodule", "/usr/lib/redis/modules/redisearch.so", "--loadmodule", "/usr/lib/redis/modules/rejson.so"]

If you have a redis.conf file, you'll need to manually add loadmodule in the config file.

For example, if you're using the Bitnami Helm chart for Kubernetes, you have to override the YAML parameter values, using one of 2 options:

  1. Option 1:
master:
  extraFlags: ["--loadmodule", "/usr/lib/redis/modules/redisearch.so", "--loadmodule", "/usr/lib/redis/modules/rejson.so"]
  1. Option 2:
master:
  configuration: |-
    loadmodule /usr/lib/redis/modules/redisearch.so
    loadmodule /usr/lib/redis/modules/rejson.so

@carrodher if you're happy with this approach, I can submit a PR to update the documentation.

hussam-qasem avatar Jan 23 '23 09:01 hussam-qasem

If you're using Bitnami Helm chart for Redis to deploy on Kubernetes, you can bypass creating custom images, by utilizing an Init Container to copy the RediSearch module from the RedisSearch Docker image. For example:

master:
  initContainers:
   - name: copy-redisearch-module
     image: docker.io/redislabs/redisearch:latest
     command: ['sh', '-c', 'cp /usr/lib/redis/modules/redisearch.so /modules && cp /usr/lib/redis/modules/rejson.so /modules']
     securityContext:
       runAsUser: 0
     volumeMounts:
       - name: redis-modules
         mountPath: /modules
  extraVolumes:
    - name: redis-modules
      emptyDir: {}
  extraVolumeMounts:
    - name: redis-modules
      mountPath: /usr/lib/redis/modules
  extraFlags: ["--loadmodule", "/usr/lib/redis/modules/redisearch.so", "--loadmodule", "/usr/lib/redis/modules/rejson.so"]
  # configuration: |-
  #   loadmodule /usr/lib/redis/modules/redisearch.so
  #   loadmodule /usr/lib/redis/modules/rejson.so

hussam-qasem avatar Jan 31 '23 07:01 hussam-qasem

Hi, thanks for creating this issue. After analyzing internally our priorities and due to other issues/initiatives we are working on, we didn't find the bandwidth to implement this feature.

Being said that, would you like to contribute by creating a PR to solve the issue? The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

carrodher avatar Feb 23 '23 17:02 carrodher

Hello @carrodher. Would you like me to submit a PR for the Configuration sections of:

Please confirm. Thanks!

hussam-qasem avatar Feb 24 '23 14:02 hussam-qasem

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] avatar Mar 12 '23 01:03 github-actions[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

github-actions[bot] avatar Mar 18 '23 01:03 github-actions[bot]