Skip to content

Commit

Permalink
Merge pull request #95 from aleksandra-tarkowska/dev_redis
Browse files Browse the repository at this point in the history
Redis
  • Loading branch information
jburel committed Apr 22, 2016
2 parents 066c7d8 + 11d6d49 commit 6c0587b
Show file tree
Hide file tree
Showing 42 changed files with 463 additions and 24 deletions.
9 changes: 9 additions & 0 deletions linux/install_centos6_py27_apache24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -19,6 +20,10 @@ bash -eux step01_centos6_py27_deps.sh
# install ice
bash -eux step01_centos6_py27_ice_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos6_py27_deps_websession.sh
fi

# install Postgres
bash -eux step01_centos6_pg_deps.sh

Expand All @@ -39,6 +44,10 @@ if [ $WEBAPPS = true ]; then
PY_ENV=py27_scl bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
PY_ENV=py27_scl bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_centos6_py27_apache24.sh

#If you don't want to use the init.d scripts you can start OMERO manually:
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos6_py27_ius_apache22.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -27,6 +28,10 @@ bash -eux step01_centos6_pg_deps.sh

bash -eux step01_centos6_py27_ius_virtualenv_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos6_py27_ius_deps_websession.sh
fi

if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then
bash -eux step03_all_postgres.sh
fi
Expand All @@ -41,6 +46,10 @@ if [ $WEBAPPS = true ]; then
PY_ENV=py27_ius bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
PY_ENV=py27_ius bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_centos6_py27_ius_apache22.sh

#If you don't want to use the init.d scripts you can start OMERO manually:
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos6_py27_ius_apache24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -27,6 +28,10 @@ bash -eux step01_centos6_pg_deps.sh

bash -eux step01_centos6_py27_ius_virtualenv_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos6_py27_ius_deps_websession.sh
fi

if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then
bash -eux step03_all_postgres.sh
fi
Expand All @@ -41,6 +46,10 @@ if [ $WEBAPPS = true ]; then
PY_ENV=py27_ius bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
PY_ENV=py27_ius bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_centos6_py27_ius_apache24.sh

#If you don't want to use the init.d scripts you can start OMERO manually:
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos6_py27_ius_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -27,6 +28,10 @@ bash -eux step01_centos6_pg_deps.sh

bash -eux step01_centos6_py27_ius_virtualenv_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos6_py27_ius_deps_websession.sh
fi

if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then
bash -eux step03_all_postgres.sh
fi
Expand All @@ -43,6 +48,10 @@ if [ $WEBAPPS = true ]; then
PY_ENV=py27_ius bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
PY_ENV=py27_ius bash -eux step05_2_websessionconfig.sh
fi

#If you don't want to use the init.d scripts you can start OMERO manually:
#su - omero -c "OMERO.server/bin/omero admin start"
#su - omero -c "OMERO.server/bin/omero web start"
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos6_py27_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -20,6 +21,10 @@ bash -eux step01_centos6_py27_deps.sh
bash -eux step01_centos6_py27_ice_deps.sh


if $WEBSESSION ; then
bash -eux step01_centos6_py27_deps_websession.sh
fi

# install Postgres
bash -eux step01_centos6_pg_deps.sh

Expand All @@ -41,6 +46,10 @@ if [ $WEBAPPS = true ]; then
PY_ENV=py27_scl bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
PY_ENV=py27_scl bash -eux step05_2_websessionconfig.sh
fi

#If you don't want to use the init.d scripts you can start OMERO manually:
#su - omero -c "OMERO.server/bin/omero admin start"
#su - omero -c "OMERO.server/bin/omero web start"
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos7_apache24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -19,6 +20,10 @@ bash -eux step01_centos7_deps.sh
# install ice
bash -eux step01_centos7_ice_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos7_deps_websession.sh
fi

# install Postgres
bash -eux step01_centos7_pg_deps.sh

Expand All @@ -37,6 +42,10 @@ if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_centos7_apache24.sh

#If you don't want to use the systemd scripts you can start OMERO manually:
Expand Down
9 changes: 9 additions & 0 deletions linux/install_centos7_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -u -x

WEBSESSION=${WEBSESSION:-false}
OMEROVER=${OMEROVER:-latest}
WEBAPPS=${WEBAPPS:-false}
PGVER=${PGVER:-pg94}
Expand All @@ -19,6 +20,10 @@ bash -eux step01_centos7_deps.sh
# install ice
bash -eux step01_centos7_ice_deps.sh

if $WEBSESSION ; then
bash -eux step01_centos7_deps_websession.sh
fi

# install Postgres
bash -eux step01_centos7_pg_deps.sh

Expand All @@ -39,6 +44,10 @@ if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

#If you don't want to use the systemd scripts you can start OMERO manually:
#su - omero -c "OMERO.server/bin/omero admin start"
#su - omero -c "OMERO.server/bin/omero web start"
Expand Down
4 changes: 4 additions & 0 deletions linux/install_debian8_apache24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_ubuntu1404_apache24.sh

#If you don't want to use the init.d scripts you can start OMERO manually:
Expand Down
4 changes: 4 additions & 0 deletions linux/install_debian8_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

#If you don't want to use the init.d scripts you can start OMERO manually:
#su - omero -c "OMERO.server/bin/omero admin start"
#su - omero -c "OMERO.server/bin/omero web start"
Expand Down
5 changes: 5 additions & 0 deletions linux/install_ubuntu1404_apache24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ su - omero -c "bash setup_omero_db.sh"
if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

bash -eux step05_ubuntu1404_apache24.sh


Expand Down
5 changes: 5 additions & 0 deletions linux/install_ubuntu1404_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ bash -eux step05_ubuntu1404_nginx.sh
if [ $WEBAPPS = true ]; then
bash -eux step05_1_all_webapps.sh
fi

if [ "$WEBSESSION" = true ]; then
bash -eux step05_2_websessionconfig.sh
fi

#If you don't want to use the init.d scripts you can start OMERO manually:
#su - omero -c "OMERO.server/bin/omero admin start"
#su - omero -c "OMERO.server/bin/omero web start"
Expand Down
13 changes: 13 additions & 0 deletions linux/step01_centos6_py27_deps_websession.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

#!/bin/bash

yum -y install redis python-redis

service redis start

set +u
source /opt/rh/python27/enable
set -u

pip install django-redis-cache>=1.6.5
15 changes: 15 additions & 0 deletions linux/step01_centos6_py27_ius_deps_websession.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

#!/bin/bash

yum -y install redis python-redis

service redis start

set +u
source /home/omero/omeroenv/bin/activate
set -u

pip install django-redis-cache>=1.6.5

deactivate
10 changes: 10 additions & 0 deletions linux/step01_centos7_deps_websession.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

yum -y install redis python-redis

pip install django-redis-cache>=1.6.5

systemctl enable redis.service
if [ ! "${container:-}" = docker ]; then
systemctl start redis.service
fi
22 changes: 22 additions & 0 deletions linux/step05_2_websessionconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

PY_ENV=${PY_ENV:-py27}

cd ~omero

echo "value=$PY_ENV"
# Install required packages
if [ "$PY_ENV" = "py27_scl" ]; then
set +u
source /opt/rh/python27/enable
set -u
elif [ "$PY_ENV" = "py27_ius" ]; then
virtualenv -p /usr/bin/python2.7 /home/omero/omeroenv
set +u
source /home/omero/omeroenv/bin/activate
set -u
fi

# Register the app
su - omero -c "OMERO.server/bin/omero config set omero.web.session_engine 'django.contrib.sessions.backends.cache'"
su - omero -c "OMERO.server/bin/omero config set omero.web.caches '{\"default\": {\"BACKEND\": \"redis_cache.RedisCache\",\"LOCATION\": \"127.0.0.1:6379\"}}'"
27 changes: 25 additions & 2 deletions linux/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ is not the default one. It is not necessary to specify the version when running

For example:

docker run --rm -it -p 8080:80 -p 4063:4063 -p 4064:4064 omero_install_test_centos6_py27_ius_nginx pg95
docker run --rm -it -p 8080:80 -p 4063:4063 -p 4064:4064 omero_install_test_centos6_py27_ius_nginx --pg 95

docker run --rm -it -p 8080:80 -p 4063:4063 -p 4064:4064 omero_install_test_ubuntu1404_nginx


The supported values are:
pg94 (default), pg95
94 (default), 95

If you do not want to install Postgres set PGVER to nopg.

Expand All @@ -122,6 +122,29 @@ To add a new Ice version, update the following files:
`step01_centos6_ice_deps.sh`, `step01_centos6_py27_ice_deps.sh`, `step01_centos6_py27_ius_ice_deps.sh`
`step01_centos7_ice_deps.sh`, `step01_ubuntu1404_ice_deps.sh` and update this README.md.

Configuring Redis
-----------------

By default, OMERO.web is set to use filestore session backend.
For Python 2.7 based environment it is possible to use Redis as a session
backend using the WEBSESSION parameter

For example:

WEBSESSION=true ./docker-build.sh centos6_py27_ius_nginx

WEBSESSION=true ./docker-build.sh ubuntu1404_nginx

To run the image for centOS 6 or ubuntu/Debian, you need to pass the -w/--websession true.

For example:

docker run --rm -it -p 8080:80 -p 4063:4063 -p 4064:4064 omero_install_test_centos6_py27_ius_nginx --websession true

docker run --rm -it -p 8080:80 -p 4063:4063 -p 4064:4064 omero_install_test_ubuntu1404_nginx --websession true

It is not necessary to specify the version when running CentOS 7 image.

Installing web applications
---------------------------

Expand Down
1 change: 1 addition & 0 deletions linux/test/centos6_apache22/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FROM centos:centos6
MAINTAINER [email protected]

ARG WEBSESSION=false
ARG WEBAPPS=false
ARG OMEROVER=latest
ARG JAVAVER=openjdk18
Expand Down
Loading

0 comments on commit 6c0587b

Please sign in to comment.