Skip to content

Commit

Permalink
Merge pull request #49 from khaledk2/support_redissession
Browse files Browse the repository at this point in the history
Support of the session engine with Redis
  • Loading branch information
jburel authored Feb 28, 2024
2 parents 19c69f9 + b1c0766 commit 500e9ef
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ OMERO.web with a custom configuration using `omero_web_config_set`:
omero.web.public.user: public
omero.web.public.password: secret-password

OMERO.web with the redis session engine

hosts: localhost
roles:
- role: ome.omero_web
omero_web_setup_redis_session: true
omero_web_config_set:
"omero.web.caches":
"default":
"BACKEND": "django_redis.cache.RedisCache"
"LOCATION": "redis://127.0.0.1:6379/0"
"omero.web.session_engine": "django.contrib.sessions.backends.cache"

OMERO.web with a custom configuration using a configuration file `web-custom-config.omero`:

- hosts: localhost
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ omero_web_config_set: {}
# Install and configure Nginx
omero_web_setup_nginx: true

# Install required package to deploy redis session engine
omero_web_setup_redis_session: false

# List of additional Python packages to be installed into virtualenv
omero_web_python_addons: []

Expand Down
12 changes: 12 additions & 0 deletions tasks/web-install-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@
- omero-web rewrite omero-web configuration
- omero-web restart omero-web

- name: omero web | install django_redis
become: true
pip:
name: django_redis
state: present
virtualenv: "{{ omero_web_virtualenv_basedir }}"
virtualenv_command: /usr/local/bin/ome-python3-virtualenv
notify:
- omero-web rewrite omero-web configuration
- omero-web restart omero-web
when: omero_web_setup_redis_session

# TODO: figure out dependencies, use omero-web version
# Install/upgrade OMERO.web after the configuration files are updated
# This should mean that if OMERO.web fails to start due to a configuration
Expand Down

0 comments on commit 500e9ef

Please sign in to comment.