ome / ansible-role-omero-web

Installs and configures OMERO.web and Nginx
BSD 2-Clause "Simplified" License
1 stars 14 forks source link

Support of the session engine with Redis #49

Closed khaledk2 closed 8 months ago

khaledk2 commented 9 months ago

This PR adds the support of the session engine with Redis for the Omero web role It includes an example of deploying the web client with the Redis session engine in the readme file.

sbesson commented 9 months ago

In general big :+1: for adding Redis to the example. See also #43 for a possible alternative approach usingomero-web[redis]

What puzzles me though is that the IDR deployment playbook seems to install django-redis without any extra task. So far I cannot find where the installation happens

pwalczysko commented 9 months ago

where the installation happens

We have a specific redis role, so maybe that is how ? At least this is how (via the role) I install redis in the learning playbook.

joshmoore commented 9 months ago

So far I cannot find where the installation happens

https://github.com/IDR/deployment/blob/825c70b6b778e76d9efbee0aea492d967c0f3753/ansible/idr-omero-web.yml#L7 ?

sbesson commented 9 months ago

We have a specific redis role, so maybe that is how ? At least this is how (via the role) I install redis in the learning playbook.

The ome.redis role installs the Redis server but that's not sufficient to install the Redis backend for Django sessions.

After a bit of searching, I think I identified how the installation of django-redis happens: omero-mapr depends on omero-web[redis]>=5.14.0 which will install django-redis - https://github.com/ome/omero-mapr/blob/9631b155c44fcec9986b03315dd9f5c5c64aa7eb/requirements.txt#L2. That's very fragile at best, I completely support bringing this installation at the level of the role, possibly using an variable if we want to make optional.

pwalczysko commented 9 months ago

The ome.redis role installs the Redis server but that's not sufficient to install the Redis backend for Django sessions.

After a bit of searching, I think I identified how the installation of django-redis happens: omero-mapr depends on omero-web[redis]>=5.14.0 which will install django-redis - https://github.com/ome/omero-mapr/blob/9631b155c44fcec9986b03315dd9f5c5c64aa7eb/requirements.txt#L2. That's very fragile at best, I completely support bringing this installation at the level of the role, possibly using an variable if we want to make optional.

Understood and makes sense, thanks for explanation.

jburel commented 9 months ago

@pwalczysko that will make sense especially if we want to decommission mapr

khaledk2 commented 9 months ago

I have added a variable to control adding the support of the Redissession engine, i.e. omero_web_setup_redis_session. The variable default is false, so you may not change any of the current installation ansible-playbooks which install the package. What do you think?