diff --git a/.travis.yml b/.travis.yml index 8e20500d..da4d21ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ env: before_install: - sudo apt-get update - - sudo DEBIAN_FRONTEND=noninteractive apt-get -q -o Dpkg::Options::="--force-confnew" install -y docker-engine + - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" docker-engine script: - cd linux/test && ./docker-build.sh $ENV && docker run -d omero_install_test_$ENV diff --git a/linux/autogenerate.sh b/linux/autogenerate.sh index b4910f09..c6b06724 100644 --- a/linux/autogenerate.sh +++ b/linux/autogenerate.sh @@ -12,46 +12,147 @@ set -e -u -x source settings.env EOF +N=$OS +if [ $OS = "debian8" ] ; then + N="ubuntu1404" +fi echo -en '\n' >> $file echo "#start-step01: As root, install dependencies" >> $file +line=$(sed -n '2,$p' step01_"$N"_init.sh) +echo "$line" >> $file + +# install java +N=$OS +if [[ $OS =~ "centos" ]] ; then + N="centos" +fi +echo -en '\n' >> $file +echo "# install Java" >> $file +number=$(sed -n '/#start-recommended/=' step01_"$N"_java_deps.sh) +ns=$((number+1)) +number=$(sed -n '/#end-recommended/=' step01_"$N"_java_deps.sh) +ne=$((number-1)) +line=$(sed -n ''$ns','$ne'p' step01_"$N"_java_deps.sh) + +# remove leading whitespace +line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + +echo "$line" >> $file +echo -en '\n' >> $file + +# install ice +echo "# install Ice" >> $file +N=$OS +if [ $OS = "debian8" ] ; then + N="ubuntu1404" +fi +number=$(sed -n '/#start-recommended/=' step01_"$N"_ice_deps.sh) +ns=$((number+1)) +number=$(sed -n '/#end-recommended/=' step01_"$N"_ice_deps.sh) +ne=$((number-1)) +line=$(sed -n ''$ns','$ne'p' step01_"$N"_ice_deps.sh) + +# remove leading whitespace +line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + +echo "$line" >> $file +echo -en '\n' >> $file + +# install dependencies if [ $OS = "centos7" ] ; then - number=$(sed -n '/#start-workaround/=' step01_"$OS"_deps.sh) - number=$((number-1)) - line=$(sed -n '2,'$number'p' step01_"$OS"_deps.sh) + number=$(sed -n '/#start-docker-pip/=' step01_"$OS"_deps.sh) + ne=$((number-2)) + line=$(sed -n '2,'$ne'p' step01_"$OS"_deps.sh) + echo "$line" >> $file + # remove leading whitespace + number=$(sed -n '/#start-docker-pip/=' step01_"$OS"_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-docker-pip/=' step01_"$OS"_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step01_"$OS"_deps.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file - number=$(sed -n '/#end-workaround/=' step01_"$OS"_deps.sh) - number=$((number+1)) - line=$(sed -n ''$number',$p' step01_"$OS"_deps.sh) + ne=$(($ne+3)) + line=$(sed -n ''$ne',$p' step01_"$OS"_deps.sh) else line=$(sed -n '2,$p' step01_"$OS"_deps.sh) fi echo "$line" >> $file +# install postgres +N=$OS +if [ $OS = "debian8" ] ; then + N="ubuntu1404" +elif [[ $OS =~ "centos6" ]]; then + N="centos6" +fi +echo -en '\n' >> $file +echo "# install Postgres" >> $file +if [ $OS = "centos7" ] ; then + number=$(sed -n '/#start-recommended/=' step01_"$N"_pg_deps.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-recommended/=' step01_"$N"_pg_deps.sh) + nre=$((number-1)) + number=$(sed -n ''$nrs','$nre'!d;/#start-workaround/!d;=' step01_"$N"_pg_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$nrs','$ne'p' step01_"$N"_pg_deps.sh) + # remove leading whitespace + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + + echo "$line" >> $file + number=$(sed -n ''$nrs','$nre'!d;/#end-workaround/!d;=' step01_"$N"_pg_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended/=' step01_"$N"_pg_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step01_"$N"_pg_deps.sh) +else + number=$(sed -n '/#start-recommended/=' step01_"$N"_pg_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended/=' step01_"$N"_pg_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step01_"$N"_pg_deps.sh) +fi +# remove leading whitespace +line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + +echo "$line" >> $file +echo -en '\n' >> $file + echo "#end-step01" >> $file -# review the name of the original file. if [ $OS = "centos6_py27_ius" ] ; then echo -en '\n' >> $file echo "#start-step01.1: virtual env" >> $file #find from where to start copying - start=$(sed -n '/#start-install/=' step03_"$OS"_virtualenv_deps.sh) + start=$(sed -n '/#start-install/=' step01_"$OS"_virtualenv_deps.sh) start=$((start+1)) - number=$(sed -n '/#start-dev/=' step03_"$OS"_virtualenv_deps.sh) - number=$((number-1)) - line=$(sed -n ''$start','$number'p' step03_"$OS"_virtualenv_deps.sh) - echo "$line" >> $file - number=$(sed -n '/#end-dev/=' step03_"$OS"_virtualenv_deps.sh) - number=$((number+1)) - line=$(sed -n ''$number',$p' step03_"$OS"_virtualenv_deps.sh) + line=$(sed -n ''$start',$p' step01_"$OS"_virtualenv_deps.sh) echo "$line" >> $file echo "#end-step01.1" >> $file fi echo -en '\n' >> $file echo "#start-step02: As root, create an omero system user and directory for the OMERO repository" >> $file -if [ $OS = "centos6_py27" ] || [ $OS = "centos6_py27_ius" ] ; then - line=$(sed -n '2,$p' step02_"$OS"_setup.sh) -else - line=$(sed -n '2,$p' step02_all_setup.sh) +if [[ $OS =~ "centos6_py27" ]] ; then + number=$(sed -n '/#start-create-user/=' step02_"$OS"_setup.sh) + ns=$((number+1)) + number=$(sed -n '/#end-create-user/=' step02_"$OS"_setup.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step02_"$OS"_setup.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + ne=$((number+3)) + line=$(sed -n ''$ne',$p' step02_"$OS"_setup.sh) +else + number=$(sed -n '/#start-create-user/=' step02_all_setup.sh) + ns=$((number+1)) + number=$(sed -n '/#end-create-user/=' step02_all_setup.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step02_all_setup.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + ne=$((number+3)) + line=$(sed -n ''$ne',$p' step02_all_setup.sh) fi echo "$line" >> $file echo "#end-step02" >> $file @@ -71,38 +172,62 @@ echo "#start-step04: As the omero system user, install the OMERO.server" >> $fil if [[ $OS =~ "centos6_py27" ]] ; then var="${OS//_/}" echo "#start-copy-omeroscript" >> $file - echo "cp settings.env omero-$var.env step04_$OS_omero.sh ~omero " >> $file + echo "cp settings.env omero-$var.env step04_all_omero.sh setup_omero_db.sh ~omero " >> $file echo "#end-copy-omeroscript" >> $file - start=$(sed -n '/#start-install/=' step04_"$OS"_omero.sh) - start=$((start+1)) - line=$(sed -n ''$start',$p' step04_"$OS"_omero.sh) + number=$(sed -n '/#start-py27-scl/=' step04_all_omero.sh) + ns=$((number+1)) + number=$(sed -n '/#end-py27-scl/=' step04_all_omero.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' step04_all_omero.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + line=$(sed -n ''$start',$p' step04_all_omero.sh) else echo "#start-copy-omeroscript" >> $file - echo "cp settings.env step04_all_omero.sh ~omero " >> $file + echo "cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero" >> $file echo "#end-copy-omeroscript" >> $file - start=$(sed -n '/#start-install/=' step04_all_omero.sh) - start=$((start+1)) - line=$(sed -n ''$start',$p' step04_all_omero.sh) fi +number=$(sed -n '/#start-venv/=' step04_all_omero.sh) +ns=$((number+1)) +number=$(sed -n '/#end-venv/=' step04_all_omero.sh) +ne=$((number-1)) +line=$(sed -n ''$ns','$ne'p' step04_all_omero.sh) +line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" echo "$line" >> $file -echo "#end-step04" >> $file +number=$(sed -n '/#start-release/=' step04_all_omero.sh) +ns=$((number+1)) +number=$(sed -n '/#end-release/=' step04_all_omero.sh) +ne=$((number-1)) +line=$(sed -n ''$ns','$ne'p' step04_all_omero.sh) -v=$OS -if [ $OS = "debian8" ] ; then - v="ubuntu1404" -fi +line="$(echo -e "${line}" | sed -e 's/$OMEROVER/latest/g')" +echo "$line" >> $file +number=$(sed -n '/#configure/=' step04_all_omero.sh) +ns=$((number+1)) +line=$(sed -n ''$ns',$p' step04_all_omero.sh) +echo "$line" >> $file +number=$(sed -n '/#start-config/=' setup_omero_db.sh) +ns=$((number+1)) +line=$(sed -n ''$ns',$p' setup_omero_db.sh) +echo "$line" >> $file +echo "#end-step04" >> $file echo -en '\n' >> $file echo "#start-step05: As root, install a Web server: Nginx or Apache" >> $file echo "#start-nginx" >> $file -start=$(sed -n '/#start-install/=' step05_"$v"_nginx.sh) +start=$(sed -n '/#start-install/=' step05_"$OS"_nginx.sh) start=$((start+1)) -line=$(sed -n ''$start',$p' step05_"$v"_nginx.sh) +line=$(sed -n ''$start',$p' step05_"$OS"_nginx.sh) echo "$line" >> $file echo "#end-nginx" >> $file echo -en '\n' >> $file echo "#start-apache" >> $file +v=$OS +if [ $OS = "debian8" ] ; then + v="ubuntu1404" +fi + apachever="apache24" #webserver might become a parameter if [ $OS = "centos6" ] || [ $OS = "centos6_py27_ius" ] ; then apachever="apache22" diff --git a/linux/docker_shutdown_centos6.sh b/linux/docker_shutdown_centos6.sh index a0a1c167..517bba91 100644 --- a/linux/docker_shutdown_centos6.sh +++ b/linux/docker_shutdown_centos6.sh @@ -1,4 +1,9 @@ #!/bin/bash # All that's needed to get a clean shutdown of the docker container -service postgresql-9.4 stop +PGVER=${PGVER:-pg94} +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 stop +elif [ "$PGVER" = "pg94" ]; then + service postgresql-9.5 stop +fi diff --git a/linux/install_centos6_apache22.sh b/linux/install_centos6_apache22.sh index cdc6a227..1a878f69 100644 --- a/linux/install_centos6_apache22.sh +++ b/linux/install_centos6_apache22.sh @@ -2,18 +2,35 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_deps.sh +# install ice +bash -eux step01_centos6_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then PY_ENV=py26 bash -eux step05_1_all_webapps.sh diff --git a/linux/install_centos6_nginx.sh b/linux/install_centos6_nginx.sh index 125ce79b..5576c362 100644 --- a/linux/install_centos6_nginx.sh +++ b/linux/install_centos6_nginx.sh @@ -2,19 +2,36 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_deps.sh +# install ice +bash -eux step01_centos6_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +su - omero -c "bash setup_omero_db.sh" bash -eux step05_centos6_nginx.sh diff --git a/linux/install_centos6_py27_apache24.sh b/linux/install_centos6_py27_apache24.sh index 47ad1504..9debac78 100644 --- a/linux/install_centos6_py27_apache24.sh +++ b/linux/install_centos6_py27_apache24.sh @@ -2,18 +2,37 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_py27_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_py27_deps.sh +# install ice +bash -eux step01_centos6_py27_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_centos6_py27_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env omero-centos6py27.env step04_centos6_py27_${OMEROVER}.sh ~omero -su - omero -c "bash -eux step04_centos6_py27_${OMEROVER}.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env omero-centos6py27.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER PY_ENV=py27_scl bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" + if [ $WEBAPPS = true ]; then PY_ENV=py27_scl bash -eux step05_1_all_webapps.sh diff --git a/linux/install_centos6_py27_ius_apache22.sh b/linux/install_centos6_py27_ius_apache22.sh index c00aff8c..13574e13 100644 --- a/linux/install_centos6_py27_ius_apache22.sh +++ b/linux/install_centos6_py27_ius_apache22.sh @@ -2,21 +2,39 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_py27_ius_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_py27_ius_deps.sh + +# install ice +bash -eux step01_centos6_py27_ius_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_centos6_py27_ius_setup.sh -bash -eux step03_all_postgres.sh +bash -eux step01_centos6_py27_ius_virtualenv_deps.sh + +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + -OMEROVER=${OMEROVER} bash -eux step03_centos6_py27_ius_virtualenv_deps.sh +cp settings.env omero-centos6py27ius.env step04_all_omero.sh setup_omero_db.sh ~omero -cp settings.env omero-centos6py27ius.env step04_centos6_py27_ius_${OMEROVER}.sh ~omero +su - omero -c "OMEROVER=$OMEROVER PY_ENV=py27_ius bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_centos6_py27_ius_${OMEROVER}.sh" +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then PY_ENV=py27_ius bash -eux step05_1_all_webapps.sh diff --git a/linux/install_centos6_py27_ius_apache24.sh b/linux/install_centos6_py27_ius_apache24.sh index cc3a50ea..655da648 100644 --- a/linux/install_centos6_py27_ius_apache24.sh +++ b/linux/install_centos6_py27_ius_apache24.sh @@ -2,21 +2,38 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_py27_ius_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_py27_ius_deps.sh + +# install ice +bash -eux step01_centos6_py27_ius_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_centos6_py27_ius_setup.sh -bash -eux step03_all_postgres.sh +bash -eux step01_centos6_py27_ius_virtualenv_deps.sh + +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi -OMEROVER=${OMEROVER} bash -eux step03_centos6_py27_ius_virtualenv_deps.sh +cp settings.env omero-centos6py27ius.env step04_all_omero.sh setup_omero_db.sh ~omero -cp settings.env omero-centos6py27ius.env step04_centos6_py27_ius_${OMEROVER}.sh ~omero +su - omero -c "OMEROVER=$OMEROVER PY_ENV=py27_ius bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_centos6_py27_ius_${OMEROVER}.sh" +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then PY_ENV=py27_ius bash -eux step05_1_all_webapps.sh diff --git a/linux/install_centos6_py27_ius_nginx.sh b/linux/install_centos6_py27_ius_nginx.sh index 469f97a7..3a091528 100644 --- a/linux/install_centos6_py27_ius_nginx.sh +++ b/linux/install_centos6_py27_ius_nginx.sh @@ -2,21 +2,38 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_py27_ius_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_py27_ius_deps.sh + +# install ice +bash -eux step01_centos6_py27_ius_ice_deps.sh + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_centos6_py27_ius_setup.sh -bash -eux step03_all_postgres.sh +bash -eux step01_centos6_py27_ius_virtualenv_deps.sh + +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi -OMEROVER=${OMEROVER} bash -eux step03_centos6_py27_ius_virtualenv_deps.sh +cp settings.env omero-centos6py27ius.env step04_all_omero.sh setup_omero_db.sh ~omero -cp settings.env omero-centos6py27ius.env step04_centos6_py27_ius_${OMEROVER}.sh ~omero +su - omero -c "OMEROVER=$OMEROVER PY_ENV=py27_ius bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_centos6_py27_ius_${OMEROVER}.sh" +su - omero -c "bash setup_omero_db.sh" bash -eux step05_centos6_py27_ius_nginx.sh diff --git a/linux/install_centos6_py27_nginx.sh b/linux/install_centos6_py27_nginx.sh index c79c08d3..91459821 100644 --- a/linux/install_centos6_py27_nginx.sh +++ b/linux/install_centos6_py27_nginx.sh @@ -2,19 +2,37 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_centos6_py27_init.sh + +# install java +bash -eux step01_centos_java_deps.sh + bash -eux step01_centos6_py27_deps.sh +# install ice +bash -eux step01_centos6_py27_ice_deps.sh + + +# install Postgres +bash -eux step01_centos6_pg_deps.sh + bash -eux step02_centos6_py27_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env omero-centos6py27.env step04_centos6_py27_${OMEROVER}.sh ~omero +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env omero-centos6py27.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER PY_ENV=py27_scl bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_centos6_py27_${OMEROVER}.sh" +su - omero -c "bash setup_omero_db.sh" bash -eux step05_centos6_py27_nginx.sh diff --git a/linux/install_centos7_apache24.sh b/linux/install_centos7_apache24.sh index e673ff00..d7a67a07 100644 --- a/linux/install_centos7_apache24.sh +++ b/linux/install_centos7_apache24.sh @@ -2,18 +2,35 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} -source settings.env +source `dirname $0`/settings.env + +bash -eux step01_centos7_init.sh + +# install java +bash -eux step01_centos_java_deps.sh bash -eux step01_centos7_deps.sh +# install ice +bash -eux step01_centos7_ice_deps.sh + +# install Postgres +bash -eux step01_centos7_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then bash -eux step05_1_all_webapps.sh diff --git a/linux/install_centos7_nginx.sh b/linux/install_centos7_nginx.sh index e8356513..03763e1f 100644 --- a/linux/install_centos7_nginx.sh +++ b/linux/install_centos7_nginx.sh @@ -2,18 +2,35 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} -source settings.env +source `dirname $0`/settings.env + +bash -eux step01_centos7_init.sh + +# install java +bash -eux step01_centos_java_deps.sh bash -eux step01_centos7_deps.sh +# install ice +bash -eux step01_centos7_ice_deps.sh + +# install Postgres +bash -eux step01_centos7_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" bash -eux step05_centos7_nginx.sh diff --git a/linux/install_debian8_apache24.sh b/linux/install_debian8_apache24.sh index 08c9ae9a..3f5e3444 100644 --- a/linux/install_debian8_apache24.sh +++ b/linux/install_debian8_apache24.sh @@ -2,18 +2,35 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_ubuntu1404_init.sh + +# install java +bash -eux step01_debian8_java_deps.sh + bash -eux step01_debian8_deps.sh +# install ice +bash -eux step01_ubuntu1404_ice_deps.sh + +# install Postgres +bash -eux step01_debian8_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then bash -eux step05_1_all_webapps.sh diff --git a/linux/install_debian8_nginx.sh b/linux/install_debian8_nginx.sh index 40ef2430..dc65f354 100644 --- a/linux/install_debian8_nginx.sh +++ b/linux/install_debian8_nginx.sh @@ -2,21 +2,38 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_ubuntu1404_init.sh + +# install java +bash -eux step01_debian8_java_deps.sh + bash -eux step01_debian8_deps.sh +# install ice +bash -eux step01_ubuntu1404_ice_deps.sh + +# install Postgres +bash -eux step01_debian8_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +su - omero -c "bash setup_omero_db.sh" -bash -eux step05_ubuntu1404_nginx.sh +bash -eux step05_debian8_nginx.sh if [ $WEBAPPS = true ]; then bash -eux step05_1_all_webapps.sh diff --git a/linux/install_ubuntu1404_apache24.sh b/linux/install_ubuntu1404_apache24.sh index a0361b97..03282ac4 100644 --- a/linux/install_ubuntu1404_apache24.sh +++ b/linux/install_ubuntu1404_apache24.sh @@ -2,18 +2,36 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_ubuntu1404_init.sh + +# install java +bash -eux step01_ubuntu1404_java_deps.sh + bash -eux step01_ubuntu1404_deps.sh +# install ice +bash -eux step01_ubuntu1404_ice_deps.sh + +# install Postgres +bash -eux step01_ubuntu1404_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" + +su - omero -c "bash setup_omero_db.sh" if [ $WEBAPPS = true ]; then bash -eux step05_1_all_webapps.sh diff --git a/linux/install_ubuntu1404_nginx.sh b/linux/install_ubuntu1404_nginx.sh index 9ab3769d..3b710dfb 100644 --- a/linux/install_ubuntu1404_nginx.sh +++ b/linux/install_ubuntu1404_nginx.sh @@ -2,19 +2,36 @@ set -e -u -x -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} WEBAPPS=${WEBAPPS:-false} +PGVER=${PGVER:-pg94} source settings.env +bash -eux step01_ubuntu1404_init.sh + +# install java +bash -eux step01_ubuntu1404_java_deps.sh + bash -eux step01_ubuntu1404_deps.sh +# install ice +bash -eux step01_ubuntu1404_ice_deps.sh + +# install Postgres +bash -eux step01_ubuntu1404_pg_deps.sh + bash -eux step02_all_setup.sh -bash -eux step03_all_postgres.sh -cp settings.env step04_all_$OMEROVER.sh ~omero +if [[ "$PGVER" =~ ^(pg94|pg95)$ ]]; then + bash -eux step03_all_postgres.sh +fi + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero + +su - omero -c "OMEROVER=$OMEROVER bash -eux step04_all_omero.sh" -su - omero -c "bash -eux step04_all_$OMEROVER.sh" +su - omero -c "bash setup_omero_db.sh" bash -eux step05_ubuntu1404_nginx.sh diff --git a/linux/requirements.txt b/linux/requirements.txt new file mode 100644 index 00000000..f3c68911 --- /dev/null +++ b/linux/requirements.txt @@ -0,0 +1,6 @@ +# Python installation requirements for OMERO. +# =========================================== +# +# pip install -r requirements.txt +# +Pillow<3.0 \ No newline at end of file diff --git a/linux/requirements_centos6.txt b/linux/requirements_centos6.txt new file mode 100644 index 00000000..e0dd0eb1 --- /dev/null +++ b/linux/requirements_centos6.txt @@ -0,0 +1,5 @@ +# Python installation requirements for OMERO. +# =========================================== +numexpr==1.4.2 +tables==2.4.0 +Pillow<3.0 \ No newline at end of file diff --git a/linux/requirements_centos6_py27.txt b/linux/requirements_centos6_py27.txt new file mode 100644 index 00000000..58eb28f0 --- /dev/null +++ b/linux/requirements_centos6_py27.txt @@ -0,0 +1,8 @@ +# Python installation requirements for OMERO. +# =========================================== +# +# pip install -r requirements_centos6_py27.txt +# +tables +matplotlib +Pillow<3.0 \ No newline at end of file diff --git a/linux/requirements_centos6_py27_ius.txt b/linux/requirements_centos6_py27_ius.txt new file mode 100644 index 00000000..b0f05cca --- /dev/null +++ b/linux/requirements_centos6_py27_ius.txt @@ -0,0 +1,9 @@ +# Python installation requirements for OMERO. +# =========================================== +# +# pip install -r requirements_centos6_py27_ius.txt +# +numpy +matplotlib +Pillow<3.0 +omego==0.3.0 \ No newline at end of file diff --git a/linux/setup_omero_apache24.sh b/linux/setup_omero_apache24.sh index de86b4b2..1c3b80df 100644 --- a/linux/setup_omero_apache24.sh +++ b/linux/setup_omero_apache24.sh @@ -2,9 +2,9 @@ set -e -u -x -source settings.env +source `dirname $0`/settings.env #start-config OMERO.server/bin/omero config set omero.web.application_server wsgi OMERO.server/bin/omero web config apache24 --http "$OMERO_WEB_PORT" > OMERO.server/apache.conf.tmp -OMERO.server/bin/omero web syncmedia +OMERO.server/bin/omero web syncmedia \ No newline at end of file diff --git a/linux/setup_omero_db.sh b/linux/setup_omero_db.sh new file mode 100644 index 00000000..ddaec101 --- /dev/null +++ b/linux/setup_omero_db.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e -u -x + +source `dirname $0`/settings.env + +#start-config +psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql diff --git a/linux/setup_omero_nginx.sh b/linux/setup_omero_nginx.sh new file mode 100644 index 00000000..f2688c4c --- /dev/null +++ b/linux/setup_omero_nginx.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e -u -x + +source `dirname $0`/settings.env + +#start-config +OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp +OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step01_centos6_deps.sh b/linux/step01_centos6_deps.sh index 3165b051..7e50b2b2 100644 --- a/linux/step01_centos6_deps.sh +++ b/linux/step01_centos6_deps.sh @@ -1,16 +1,5 @@ #!/bin/bash -yum -y install epel-release - -curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ - http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo - -yum -y install \ - unzip \ - wget \ - java-1.7.0-openjdk \ - ice ice-python ice-servers - yum -y install \ python-pip python-devel python-virtualenv \ numpy scipy python-matplotlib Cython \ @@ -21,20 +10,11 @@ yum -y install \ zlib-devel \ hdf5-devel -# Requires gcc {libjpeg,libpng,libtiff,zlib}-devel -pip install 'Pillow<3.0' -pip install numexpr==1.4.2 -# Requires gcc, Cython, hdf5-devel -pip install tables==2.4.0 - -# Django -pip install Django==1.6.11 - -# Postgres, reconfigure to allow TCP connections -yum -y install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm -yum -y install postgresql94-server postgresql94 - -service postgresql-9.4 initdb -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf -chkconfig postgresql-9.4 on -service postgresql-9.4 start +# install dependencies using pip +# due to the fact that numexp must be installed before tables +# and due to limitation of pip. +while IFS='' read -r line || [[ -n "$line" ]]; do + if [[ ! "$line" = \#* ]]; then + pip install $line + fi +done < requirements_centos6.txt \ No newline at end of file diff --git a/linux/step01_centos6_ice_deps.sh b/linux/step01_centos6_ice_deps.sh new file mode 100644 index 00000000..f3c1ac71 --- /dev/null +++ b/linux/step01_centos6_ice_deps.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice35} + +# Ice installation +if [ "$ICEVER" = "ice35" ]; then + #start-recommended + curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ + http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo + + yum -y install ice ice-python ice-servers + #end-recommended +elif [ "$ICEVER" = "ice35-devel" ]; then + curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ + http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo + + yum -y install ice ice-python ice-java-devel ice-servers +fi \ No newline at end of file diff --git a/linux/step01_centos6_init.sh b/linux/step01_centos6_init.sh new file mode 100644 index 00000000..427f7ba5 --- /dev/null +++ b/linux/step01_centos6_init.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +yum -y install epel-release + +# installed for convenience +yum -y install unzip wget diff --git a/linux/step01_centos6_pg_deps.sh b/linux/step01_centos6_pg_deps.sh new file mode 100644 index 00000000..e3c21e2a --- /dev/null +++ b/linux/step01_centos6_pg_deps.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +PGVER=${PGVER:-pg94} + +# Postgres installation +if [ "$PGVER" = "pg94" ]; then + #start-recommended + # Postgres, reconfigure to allow TCP connections + yum -y install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm + yum -y install postgresql94-server postgresql94 + + service postgresql-9.4 initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf + chkconfig postgresql-9.4 on + service postgresql-9.4 start + #end-recommended +elif [ "$PGVER" = "pg95" ]; then + # Postgres, reconfigure to allow TCP connections + yum -y install http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-2.noarch.rpm + yum -y install postgresql95-server postgresql95 + + service postgresql-9.5 initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.5/data/pg_hba.conf + chkconfig postgresql-9.5 on + service postgresql-9.5 start +fi \ No newline at end of file diff --git a/linux/step01_centos6_py27_deps.sh b/linux/step01_centos6_py27_deps.sh index 77a94599..28017860 100644 --- a/linux/step01_centos6_py27_deps.sh +++ b/linux/step01_centos6_py27_deps.sh @@ -1,20 +1,5 @@ #!/bin/bash -yum -y install epel-release -yum -y install centos-release-SCL - -curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ - http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo - -yum -y install \ - unzip \ - wget \ - tar - -yum -y install \ - java-1.8.0-openjdk \ - db53 db53-utils mcpp - yum -y install \ python27 \ python27-virtualenv \ @@ -36,35 +21,4 @@ set -u easy_install pip export PYTHONWARNINGS="ignore:Unverified HTTPS request" -pip install tables matplotlib - -# Cap Pillow version due to a limitation in OMERO.figure with v3.0.0 -pip install "Pillow<3.0" - -# Django -pip install "Django>=1.8,<1.9" - -# Postgres, reconfigure to allow TCP connections -yum -y install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm -yum -y install postgresql94-server postgresql94 - -service postgresql-9.4 initdb -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf -chkconfig postgresql-9.4 on -service postgresql-9.4 start - -# Now install ice -mkdir /tmp/ice-download -cd /tmp/ice-download - -wget http://downloads.openmicroscopy.org/ice/experimental/Ice-3.5.1-b1-centos6-sclpy27-x86_64.tar.gz - -tar -zxvf /tmp/ice-download/Ice-3.5.1-b1-centos6-sclpy27-x86_64.tar.gz - -# so we don't have to update ICE_HOME -mv Ice-3.5.1-b1-centos6-sclpy27-x86_64 /opt/Ice-3.5.1 - -# make path to Ice globally accessible -# if globally set, there is no need to export LD_LIBRARY_PATH -echo /opt/Ice-3.5.1/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf -ldconfig +pip install -r requirements_centos6_py27.txt \ No newline at end of file diff --git a/linux/step01_centos6_py27_ice_deps.sh b/linux/step01_centos6_py27_ice_deps.sh new file mode 100644 index 00000000..d5127221 --- /dev/null +++ b/linux/step01_centos6_py27_ice_deps.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice35} + +# Ice installation +if [[ "$ICEVER" =~ "ice35" ]]; then + #start-recommended + curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ + http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo + + yum -y install db53 db53-utils mcpp + # Now install ice + mkdir /tmp/ice-download + cd /tmp/ice-download + + wget http://downloads.openmicroscopy.org/ice/experimental/Ice-3.5.1-b1-centos6-sclpy27-x86_64.tar.gz + + tar -zxvf /tmp/ice-download/Ice-3.5.1-b1-centos6-sclpy27-x86_64.tar.gz + + # so we don't have to update ICE_HOME + mv Ice-3.5.1-b1-centos6-sclpy27-x86_64 /opt/Ice-3.5.1 + + # make path to Ice globally accessible + # if globally set, there is no need to export LD_LIBRARY_PATH + echo /opt/Ice-3.5.1/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf + ldconfig + #end-recommended +fi diff --git a/linux/step01_centos6_py27_init.sh b/linux/step01_centos6_py27_init.sh new file mode 100644 index 00000000..01bfa486 --- /dev/null +++ b/linux/step01_centos6_py27_init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +yum -y install epel-release +yum -y install centos-release-SCL + +# installed for convenience +yum -y install unzip wget tar \ No newline at end of file diff --git a/linux/step01_centos6_py27_ius_deps.sh b/linux/step01_centos6_py27_ius_deps.sh index 77840d34..714cb38a 100644 --- a/linux/step01_centos6_py27_ius_deps.sh +++ b/linux/step01_centos6_py27_ius_deps.sh @@ -1,20 +1,5 @@ #!/bin/bash -# epel-release will be pulled as a dependency -yum -y install https://centos6.iuscommunity.org/ius-release.rpm - -curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ - http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo - -yum -y install \ - unzip \ - wget \ - tar - -yum -y install \ - java-1.8.0-openjdk \ - db53 db53-utils mcpp - yum -y install \ python27 \ python27-devel \ @@ -25,12 +10,8 @@ yum -y install \ zlib-devel \ freetype-devel -#some general requirements -#yum -y install bzip2-devel openssl-devel - # install pip and virtualenv using Python 2.6 -yum -y install \ - python-pip +yum -y install python-pip pip install --upgrade virtualenv @@ -41,31 +22,4 @@ pip install --upgrade virtualenv # TODO: this installs a lot of unecessary packages: yum -y groupinstall "Development Tools" -export PYTHONWARNINGS="ignore:Unverified HTTPS request" - - -# Postgres, reconfigure to allow TCP connections -yum -y install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm -yum -y install postgresql94-server postgresql94 - -service postgresql-9.4 initdb -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf -chkconfig postgresql-9.4 on -service postgresql-9.4 start - -# Now install ice - -mkdir /tmp/ice-download -cd /tmp/ice-download - -wget http://downloads.openmicroscopy.org/ice/experimental/Ice-3.5.1-b1-centos6-iuspy27-x86_64.tar.gz - -tar -zxvf /tmp/ice-download/Ice-3.5.1-b1-centos6-iuspy27-x86_64.tar.gz - -# so we don't have to update ICE_HOME -mv Ice-3.5.1-b1-centos6-iuspy27-x86_64 /opt/Ice-3.5.1 - -# make path to Ice globally accessible -# if globally set, there is no need to export LD_LIBRARY_PATH -echo /opt/Ice-3.5.1/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf -ldconfig +export PYTHONWARNINGS="ignore:Unverified HTTPS request" \ No newline at end of file diff --git a/linux/step01_centos6_py27_ius_ice_deps.sh b/linux/step01_centos6_py27_ius_ice_deps.sh new file mode 100644 index 00000000..43e9bd10 --- /dev/null +++ b/linux/step01_centos6_py27_ius_ice_deps.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice35} + +# Ice installation +if [[ "$ICEVER" =~ "ice35" ]]; then + #start-recommended + curl -o /etc/yum.repos.d/zeroc-ice-el6.repo \ + http://download.zeroc.com/Ice/3.5/el6/zeroc-ice-el6.repo + + yum -y install db53 db53-utils mcpp + mkdir /tmp/ice-download + cd /tmp/ice-download + + wget http://downloads.openmicroscopy.org/ice/experimental/Ice-3.5.1-b1-centos6-iuspy27-x86_64.tar.gz + + tar -zxvf /tmp/ice-download/Ice-3.5.1-b1-centos6-iuspy27-x86_64.tar.gz + + # so we don't have to update ICE_HOME + mv Ice-3.5.1-b1-centos6-iuspy27-x86_64 /opt/Ice-3.5.1 + + # make path to Ice globally accessible + # if globally set, there is no need to export LD_LIBRARY_PATH + echo /opt/Ice-3.5.1/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf + ldconfig + #end-recommended +fi \ No newline at end of file diff --git a/linux/step01_centos6_py27_ius_init.sh b/linux/step01_centos6_py27_ius_init.sh new file mode 100644 index 00000000..d454fbe0 --- /dev/null +++ b/linux/step01_centos6_py27_ius_init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# epel-release will be pulled as a dependency +yum -y install https://centos6.iuscommunity.org/ius-release.rpm + +# installed for convenience +yum -y install unzip wget tar \ No newline at end of file diff --git a/linux/step01_centos6_py27_ius_virtualenv_deps.sh b/linux/step01_centos6_py27_ius_virtualenv_deps.sh new file mode 100644 index 00000000..d8053f76 --- /dev/null +++ b/linux/step01_centos6_py27_ius_virtualenv_deps.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +#start-install + +# Install the OMERO dependencies in a virtual environment +# Create virtual env. +# -p only require if it has been installed with python 2.6 + +virtualenv -p /usr/bin/python2.7 /home/omero/omeroenv +set +u +source /home/omero/omeroenv/bin/activate +set -u +/home/omero/omeroenv/bin/pip install --upgrade pip + +/home/omero/omeroenv/bin/pip2.7 install -r requirements_centos6_py27_ius.txt + +deactivate \ No newline at end of file diff --git a/linux/step01_centos7_deps.sh b/linux/step01_centos7_deps.sh index 494e7ba0..f4c210bf 100644 --- a/linux/step01_centos7_deps.sh +++ b/linux/step01_centos7_deps.sh @@ -1,49 +1,18 @@ #!/bin/bash -yum -y install epel-release - -curl -o /etc/yum.repos.d/zeroc-ice-el7.repo \ - http://download.zeroc.com/Ice/3.5/el7/zeroc-ice-el7.repo - -yum -y install \ - unzip \ - wget \ - java-1.8.0-openjdk \ - ice ice-python ice-servers - yum -y install \ python-pip python-devel python-virtualenv \ numpy scipy python-matplotlib python-tables -# upgrade pip to run 7.1.2 -pip install --upgrade pip - -# install Pillow via pip yum -y install \ zlib-devel \ libjpeg-devel \ gcc -# Cap Pillow version due to a limitation in OMERO.figure with v3.0.0 -pip install 'Pillow<3.0' - -# Django -pip install 'Django>=1.8,<1.9' - -# Postgres, reconfigure to allow TCP connections -yum -y install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm -yum -y install postgresql94-server postgresql94 - -PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-9.4/bin/postgresql94-setup initdb -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf - -#start-workaround to get postgresql running inside Docker -if [ "${container:-}" = docker ]; then - sed -i 's/OOMScoreAdjust/#OOMScoreAdjust/' \ - /usr/lib/systemd/system/postgresql-9.4.service - systemctl daemon-reload +if [[ ! "${container:-}" = docker ]]; then + #start-docker-pip + pip install --upgrade pip + #end-docker-pip fi -#end-workaround -systemctl start postgresql-9.4.service -systemctl enable postgresql-9.4.service +pip install -r `dirname $0`/requirements.txt \ No newline at end of file diff --git a/linux/step01_centos7_ice_deps.sh b/linux/step01_centos7_ice_deps.sh new file mode 100644 index 00000000..5aac1fa8 --- /dev/null +++ b/linux/step01_centos7_ice_deps.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice35} + +# Ice installation +if [ "$ICEVER" = "ice35" ]; then + #start-recommended + curl -o /etc/yum.repos.d/zeroc-ice-el7.repo \ + http://download.zeroc.com/Ice/3.5/el7/zeroc-ice-el7.repo + + yum -y install ice ice-python ice-servers + #end-recommended +elif [ "$ICEVER" = "ice35-devel" ]; then + curl -o /etc/yum.repos.d/zeroc-ice-el7.repo \ + http://download.zeroc.com/Ice/3.5/el7/zeroc-ice-el7.repo + + yum -y install ice ice-python-devel ice-java-devel ice-servers +fi \ No newline at end of file diff --git a/linux/step01_centos7_init.sh b/linux/step01_centos7_init.sh new file mode 100644 index 00000000..5997489e --- /dev/null +++ b/linux/step01_centos7_init.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +yum -y install epel-release + +# installed for convenience +yum -y install unzip wget \ No newline at end of file diff --git a/linux/step01_centos7_pg_deps.sh b/linux/step01_centos7_pg_deps.sh new file mode 100644 index 00000000..e7a45623 --- /dev/null +++ b/linux/step01_centos7_pg_deps.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +PGVER=${PGVER:-pg94} + +# Postgres installation +if [ "$PGVER" = "pg94" ]; then + #start-recommended + # Postgres, reconfigure to allow TCP connections + yum -y install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm + yum -y install postgresql94-server postgresql94 + + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-9.4/bin/postgresql94-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.4/data/pg_hba.conf + + #start-workaround to get postgresql running inside Docker + if [ "${container:-}" = docker ]; then + sed -i 's/OOMScoreAdjust/#OOMScoreAdjust/' \ + /usr/lib/systemd/system/postgresql-9.4.service + systemctl daemon-reload + fi + #end-workaround + systemctl start postgresql-9.4.service + systemctl enable postgresql-9.4.service + #end-recommended +elif [ "$PGVER" = "pg95" ]; then + # Postgres, reconfigure to allow TCP connections + yum -y install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm + yum -y install postgresql95-server postgresql95 + + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-9.5/bin/postgresql95-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/9.5/data/pg_hba.conf + + #start-workaround to get postgresql running inside Docker + if [ "${container:-}" = docker ]; then + sed -i 's/OOMScoreAdjust/#OOMScoreAdjust/' \ + /usr/lib/systemd/system/postgresql-9.5.service + systemctl daemon-reload + fi + #end-workaround + systemctl start postgresql-9.5.service + systemctl enable postgresql-9.5.service +fi \ No newline at end of file diff --git a/linux/step01_centos_java_deps.sh b/linux/step01_centos_java_deps.sh new file mode 100644 index 00000000..e3fc8832 --- /dev/null +++ b/linux/step01_centos_java_deps.sh @@ -0,0 +1,29 @@ +#!/bin/bash +JAVAVER=${JAVAVER:-openjdk18} + +# Java installation +if [ "$JAVAVER" = "openjdk17" ]; then + yum -y install java-1.7.0-openjdk +elif [ "$JAVAVER" = "oracle17" ]; then + wget --no-cookies \ + --no-check-certificate \ + --header "Cookie: oraclelicense=accept-securebackup-cookie" \ + "http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \ + -O jdk-7-linux-x64.rpm + yum -y localinstall jdk-7-linux-x64.rpm +elif [ "$JAVAVER" = "oracle18" ]; then + wget --no-cookies \ + --no-check-certificate \ + --header "Cookie: oraclelicense=accept-securebackup-cookie" \ + "http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm" \ + -O jdk-8-linux-x64.rpm + yum -y localinstall jdk-8-linux-x64.rpm +elif [ "$JAVAVER" = "openjdk18" ]; then + #start-recommended + yum -y install java-1.8.0-openjdk + #end-recommended +elif [ "$JAVAVER" = "openjdk18-devel" ]; then + yum -y install java-1.8.0-openjdk-devel +elif [ "$JAVAVER" = "openjdk17-devel" ]; then + yum -y install java-1.7.0-openjdk-devel +fi \ No newline at end of file diff --git a/linux/step01_debian8_deps.sh b/linux/step01_debian8_deps.sh index 7598401c..780076c7 100644 --- a/linux/step01_debian8_deps.sh +++ b/linux/step01_debian8_deps.sh @@ -1,13 +1,7 @@ #!/bin/bash -apt-get update apt-get -y install \ - unzip \ - wget \ - python-{matplotlib,numpy,pip,scipy,tables,virtualenv} \ - openjdk-7-jre-headless \ - ice-services python-zeroc-ice \ - postgresql + python-{matplotlib,numpy,pip,scipy,tables,virtualenv} # require to install Pillow apt-get -y install \ @@ -20,9 +14,6 @@ apt-get -y install \ tcl8.6-dev \ tk8.6-dev -pip install --upgrade "Pillow<3.0" +pip install --upgrade pip -# Django -pip install "Django>=1.8,<1.9" - -service postgresql start +pip install -r requirements.txt \ No newline at end of file diff --git a/linux/step01_debian8_java_deps.sh b/linux/step01_debian8_java_deps.sh new file mode 100644 index 00000000..8afba03c --- /dev/null +++ b/linux/step01_debian8_java_deps.sh @@ -0,0 +1,33 @@ +#!/bin/bash +JAVAVER=${JAVAVER:-openjdk18} + +# install java +if [ "$JAVAVER" = "openjdk17" ]; then + apt-get -y install openjdk-7-jre-headless +elif [ "$JAVAVER" = "oracle17" ]; then + echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list + echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 + apt-get update + echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections + apt-get -y install oracle-java7-installer +elif [ "$JAVAVER" = "oracle18" ]; then + echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list + echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 + apt-get update + echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections + apt-get -y install oracle-java8-installer +elif [ "$JAVAVER" = "openjdk18" ]; then + #start-recommended + echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list + apt-get update + apt-get -y install openjdk-8-jre-headless=8u72-b15-1~bpo8+1 ca-certificates-java=20140324 + #end-recommended +elif [ "$JAVAVER" = "openjdk18-devel" ]; then + echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list + apt-get update + apt-get -y install openjdk-8-jdk=8u72-b15-1~bpo8+1 ca-certificates-java=20140324 +elif [ "$JAVAVER" = "openjdk17-devel" ]; then + apt-get -y install openjdk-7-jdk +fi \ No newline at end of file diff --git a/linux/step01_debian8_pg_deps.sh b/linux/step01_debian8_pg_deps.sh new file mode 100644 index 00000000..1cb41b9e --- /dev/null +++ b/linux/step01_debian8_pg_deps.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +PGVER=${PGVER:-pg94} + +# Postgres installation +if [ "$PGVER" = "pg94" ]; then + #start-recommended + apt-get -y install postgresql + service postgresql start + #end-recommended +elif [ "$PGVER" = "pg95" ]; then + apt-get -y install apt-transport-https + echo "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5" >> /etc/apt/sources.list.d/pgdg.list + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update + apt-get -y install postgresql-9.5 + service postgresql start +fi \ No newline at end of file diff --git a/linux/step01_ubuntu1404_deps.sh b/linux/step01_ubuntu1404_deps.sh index e38f4b30..6fb76f6a 100644 --- a/linux/step01_ubuntu1404_deps.sh +++ b/linux/step01_ubuntu1404_deps.sh @@ -4,10 +4,7 @@ apt-get update apt-get -y install \ unzip \ wget \ - python-{matplotlib,numpy,pip,scipy,tables,virtualenv} \ - openjdk-7-jre-headless \ - ice-services python-zeroc-ice \ - postgresql + python-{matplotlib,numpy,pip,scipy,tables,virtualenv} # require to install Pillow apt-get -y install \ @@ -20,9 +17,7 @@ apt-get -y install \ tcl8.6-dev \ tk8.6-dev -pip install --upgrade "Pillow<3.0" +pip install --upgrade pip -# Django -pip install "Django>=1.8,<1.9" - -service postgresql start +# upgrade required since pillow is already installed +pip install --upgrade -r requirements.txt diff --git a/linux/step01_ubuntu1404_ice_deps.sh b/linux/step01_ubuntu1404_ice_deps.sh new file mode 100644 index 00000000..6ed4f83a --- /dev/null +++ b/linux/step01_ubuntu1404_ice_deps.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice35} + + +# Ice installation +if [[ "$ICEVER" =~ "ice35" ]]; then + #start-recommended + apt-get -y install ice-services python-zeroc-ice + #end-recommended +fi \ No newline at end of file diff --git a/linux/step01_ubuntu1404_init.sh b/linux/step01_ubuntu1404_init.sh new file mode 100644 index 00000000..c5c3b800 --- /dev/null +++ b/linux/step01_ubuntu1404_init.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +apt-get update + +# installed for convenience +apt-get -y install unzip wget \ No newline at end of file diff --git a/linux/step01_ubuntu1404_java_deps.sh b/linux/step01_ubuntu1404_java_deps.sh new file mode 100644 index 00000000..3d7c80fb --- /dev/null +++ b/linux/step01_ubuntu1404_java_deps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +JAVAVER=${JAVAVER:-openjdk18} + +# install java +if [ "$JAVAVER" = "openjdk18" ]; then + #start-recommended + apt-get -y install software-properties-common + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get -y install openjdk-8-jre + #end-recommended +elif [ "$JAVAVER" = "oracle17" ]; then + apt-get -y install software-properties-common + add-apt-repository -y ppa:webupd8team/java + apt-get update + echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections + echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections + apt-get -y install oracle-java7-installer +elif [ "$JAVAVER" = "oracle18" ]; then + apt-get -y install software-properties-common + add-apt-repository -y ppa:webupd8team/java + apt-get update + echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections + echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections + apt-get -y install oracle-java8-installer +elif [ "$JAVAVER" = "openjdk17" ]; then + apt-get -y install openjdk-7-jre-headless +elif [ "$JAVAVER" = "openjdk17-devel" ]; then + apt-get -y install openjdk-7-jdk +elif [ "$JAVAVER" = "openjdk18-devel" ]; then + apt-get -y install software-properties-common + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get -y install openjdk-8-jdk +fi \ No newline at end of file diff --git a/linux/step01_ubuntu1404_pg_deps.sh b/linux/step01_ubuntu1404_pg_deps.sh new file mode 100644 index 00000000..329925c7 --- /dev/null +++ b/linux/step01_ubuntu1404_pg_deps.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PGVER=${PGVER:-pg94} + +# Postgres installation +if [ "$PGVER" = "pg94" ]; then + #start-recommended + apt-get -y install apt-transport-https + add-apt-repository -y "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update + apt-get -y install postgresql-9.4 + service postgresql start + #end-recommended +elif [ "$PGVER" = "pg95" ]; then + apt-get -y install apt-transport-https + add-apt-repository -y "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5" + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update + apt-get -y install postgresql-9.5 + service postgresql start +fi \ No newline at end of file diff --git a/linux/step02_all_setup.sh b/linux/step02_all_setup.sh index a82efbd0..ece6cc7e 100644 --- a/linux/step02_all_setup.sh +++ b/linux/step02_all_setup.sh @@ -1,7 +1,12 @@ #!/bin/bash -useradd -m omero +if [ -z "$(getent passwd omero)" ]; then + #start-create-user + useradd -m omero + #end-create-user +fi + chmod a+X ~omero mkdir -p "$OMERO_DATA_DIR" -chown omero "$OMERO_DATA_DIR" +chown omero "$OMERO_DATA_DIR" \ No newline at end of file diff --git a/linux/step02_centos6_py27_ius_setup.sh b/linux/step02_centos6_py27_ius_setup.sh index 2ed7791a..6f10ef8d 100644 --- a/linux/step02_centos6_py27_ius_setup.sh +++ b/linux/step02_centos6_py27_ius_setup.sh @@ -1,6 +1,10 @@ #!/bin/bash -useradd -m omero +if [ -z "$(getent passwd omero)" ]; then + #start-create-user + useradd -m omero + #end-create-user +fi chmod a+X ~omero mkdir -p "$OMERO_DATA_DIR" diff --git a/linux/step02_centos6_py27_setup.sh b/linux/step02_centos6_py27_setup.sh index 9c5e0b4e..03334195 100644 --- a/linux/step02_centos6_py27_setup.sh +++ b/linux/step02_centos6_py27_setup.sh @@ -1,6 +1,10 @@ #!/bin/bash -useradd -m omero +if [ -z "$(getent passwd omero)" ]; then + #start-create-user + useradd -m omero + #end-create-user +fi chmod a+X ~omero mkdir -p "$OMERO_DATA_DIR" diff --git a/linux/step03_all_postgres.sh b/linux/step03_all_postgres.sh index 8f226940..ad843c11 100644 --- a/linux/step03_all_postgres.sh +++ b/linux/step03_all_postgres.sh @@ -1,6 +1,6 @@ #!/bin/bash -source settings.env +source `dirname $0`/settings.env #start-setup diff --git a/linux/step03_centos6_py27_ius_virtualenv_deps.sh b/linux/step03_centos6_py27_ius_virtualenv_deps.sh deleted file mode 100644 index 46c2fff1..00000000 --- a/linux/step03_centos6_py27_ius_virtualenv_deps.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -OMEROVER=${OMEROVER:-omero} - -#start-install - -# Install the OMERO dependencies in a virtual environment -# Create virtual env. -# -p only require if it has been installed with python 2.6 - -virtualenv -p /usr/bin/python2.7 /home/omero/omeroenv -set +u -source /home/omero/omeroenv/bin/activate -set -u -/home/omero/omeroenv/bin/pip install --upgrade pip - -# Cap Pillow version due to a limitation in OMERO.figure with v3.0.0 -/home/omero/omeroenv/bin/pip2.7 install "Pillow<3.0" - -# install omero dependencies -/home/omero/omeroenv/bin/pip2.7 install numpy matplotlib - -# Django -/home/omero/omeroenv/bin/pip2.7 install "Django>=1.8,<1.9" - -#start-dev -if [ $OMEROVER = omerodev ] || [ $OMEROVER = omeromerge ] ; then - /home/omero/omeroenv/bin/pip2.7 install omego -fi -#end-dev - -deactivate \ No newline at end of file diff --git a/linux/step04_all_omero.sh b/linux/step04_all_omero.sh index a7f1a9b7..c4411920 100644 --- a/linux/step04_all_omero.sh +++ b/linux/step04_all_omero.sh @@ -2,24 +2,36 @@ set -e -u -x -source settings.env +OMEROVER=${OMEROVER:-latest} +PY_ENV=${PY_ENV:-py27} +source `dirname $0`/settings.env #start-install +if [ "$PY_ENV" = "py27_scl" ]; then + #start-py27-scl + set +u + source /opt/rh/python27/enable + set -u + #end-py27-scl +fi + +if [[ ! $PY_ENV = "py27_ius" ]]; then + #start-venv + virtualenv /home/omero/omeroenv + /home/omero/omeroenv/bin/pip install omego==0.3.0 + #end-venv +fi -SERVER=http://downloads.openmicroscopy.org/latest/omero5/server-ice35.zip +#start-install +#start-release +/home/omero/omeroenv/bin/omego download --branch $OMEROVER server +#end-release -wget $SERVER -unzip -q server-ice35.zip +#configure ln -s OMERO.server-*/ OMERO.server OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -# This is the default in 5.2 so could be left unset -OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp +OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" \ No newline at end of file diff --git a/linux/step04_all_omerodev.sh b/linux/step04_all_omerodev.sh deleted file mode 100644 index beb04cdf..00000000 --- a/linux/step04_all_omerodev.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -virtualenv omego -omego/bin/pip install omego - -BRANCH=OMERO-DEV-latest - -omego/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_all_omeromerge.sh b/linux/step04_all_omeromerge.sh deleted file mode 100644 index 20303587..00000000 --- a/linux/step04_all_omeromerge.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -virtualenv omego -omego/bin/pip install omego - -BRANCH=OMERO-DEV-merge-build - -omego/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_ius_omero.sh b/linux/step04_centos6_py27_ius_omero.sh deleted file mode 100644 index c360536e..00000000 --- a/linux/step04_centos6_py27_ius_omero.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -#start-install -cd ~omero -SERVER=http://downloads.openmicroscopy.org/latest/omero5/server-ice35.zip - -wget $SERVER -unzip -q server-ice35.zip -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -# This is the default in 5.2 so could be left unset -OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_ius_omerodev.sh b/linux/step04_centos6_py27_ius_omerodev.sh deleted file mode 100644 index 68c5a5f7..00000000 --- a/linux/step04_centos6_py27_ius_omerodev.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -BRANCH=OMERO-DEV-latest - -/home/omero/omeroenv/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -# This is the default in 5.2 so could be left unset -OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_ius_omeromerge.sh b/linux/step04_centos6_py27_ius_omeromerge.sh deleted file mode 100644 index 1d8f91a8..00000000 --- a/linux/step04_centos6_py27_ius_omeromerge.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -BRANCH=OMERO-DEV-merge-build - -/home/omero/omeroenv/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -# This is the default in 5.2 so could be left unset -OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_omero.sh b/linux/step04_centos6_py27_omero.sh deleted file mode 100644 index bbb3340a..00000000 --- a/linux/step04_centos6_py27_omero.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -#start-install -set +u -source /opt/rh/python27/enable -set -u - -SERVER=http://downloads.openmicroscopy.org/latest/omero5/server-ice35.zip - -wget $SERVER -unzip -q server-ice35.zip -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -# This is the default in 5.2 so could be left unset -OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_omerodev.sh b/linux/step04_centos6_py27_omerodev.sh deleted file mode 100644 index 50766dd0..00000000 --- a/linux/step04_centos6_py27_omerodev.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -set +u -source /opt/rh/python27/enable -set -u - -virtualenv omego -omego/bin/pip install omego - -BRANCH=OMERO-DEV-latest - -omego/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step04_centos6_py27_omeromerge.sh b/linux/step04_centos6_py27_omeromerge.sh deleted file mode 100644 index 2b91955c..00000000 --- a/linux/step04_centos6_py27_omeromerge.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e -u -x - -source settings.env - -set +u -source /opt/rh/python27/enable -set -u - -virtualenv omego -omego/bin/pip install omego - -BRANCH=OMERO-DEV-merge-build - -omego/bin/omego download --branch $BRANCH server -ln -s OMERO.server-*/ OMERO.server - -OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR" -OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME" -OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER" -OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS" -OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS" - -psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql - -OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp diff --git a/linux/step05_centos6_apache22.sh b/linux/step05_centos6_apache22.sh index 6f1277a1..ef15ef48 100644 --- a/linux/step05_centos6_apache22.sh +++ b/linux/step05_centos6_apache22.sh @@ -3,15 +3,17 @@ #start-copy cp setup_omero_apache22.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache22.sh" #start-install yum -y install httpd mod_wsgi +# Install OMERO.web requirements +pip install -r ~omero/OMERO.server/share/web/requirements-py26-apache.txt + # See setup_omero_apache.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache22.sh" cp ~omero/OMERO.server/apache.conf.tmp /etc/httpd/conf.d/omero-web.conf chkconfig httpd on -service httpd start - +service httpd start \ No newline at end of file diff --git a/linux/step05_centos6_nginx.sh b/linux/step05_centos6_nginx.sh index f4370a66..af3eff23 100644 --- a/linux/step05_centos6_nginx.sh +++ b/linux/step05_centos6_nginx.sh @@ -1,5 +1,9 @@ #!/bin/bash +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + #start-install cat << EOF > /etc/yum.repos.d/nginx.repo [nginx] @@ -10,12 +14,14 @@ enabled=1 EOF yum -y install nginx -pip install "gunicorn>=19.3" -# See setup_omero*.sh for the nginx config file creation +# Install OMERO.web requirements +pip install -r ~omero/OMERO.server/share/web/requirements-py26-nginx.txt + +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.disabled cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/conf.d/omero-web.conf -service nginx start - +service nginx start \ No newline at end of file diff --git a/linux/step05_centos6_py27_apache24.sh b/linux/step05_centos6_py27_apache24.sh index 81bc4611..86805fc5 100644 --- a/linux/step05_centos6_py27_apache24.sh +++ b/linux/step05_centos6_py27_apache24.sh @@ -3,14 +3,21 @@ #start-copy cp setup_omero_apache24.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache24.sh" #start-install +set +u +source /opt/rh/python27/enable +set -u + yum -y install httpd24-httpd python27-mod_wsgi +# Install OMERO.web requirements +pip install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt + # See setup_omero_apache.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache24.sh" cp ~omero/OMERO.server/apache.conf.tmp /opt/rh/httpd24/root/etc/httpd/conf.d/omero-web.conf chkconfig httpd24-httpd on -service httpd24-httpd start +service httpd24-httpd start \ No newline at end of file diff --git a/linux/step05_centos6_py27_ius_apache22.sh b/linux/step05_centos6_py27_ius_apache22.sh index 3282a2e4..2ef42285 100644 --- a/linux/step05_centos6_py27_ius_apache22.sh +++ b/linux/step05_centos6_py27_ius_apache22.sh @@ -3,7 +3,6 @@ #start-copy cp setup_omero_apache22.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache22.sh" #start-install #install Apache 2.2 @@ -12,6 +11,19 @@ yum -y install httpd # install mod_wsgi compiled against 2.7 yum -y install python27-mod_wsgi +virtualenv -p /usr/bin/python2.7 /home/omero/omeroenv +set +u +source /home/omero/omeroenv/bin/activate +set -u + +# Install OMERO.web requirements +/home/omero/omeroenv/bin/pip2.7 install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt + +deactivate + +# See setup_omero_apache.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache22.sh" + # Add virtual env python to the python-path parameter of the WSGIDaemonProcess directive sed -i 's/\(python-path\=\)/\1\/home\/omero\/omeroenv\/lib64\/python2.7\/site-packages:/' ~omero/OMERO.server/apache.conf.tmp # See setup_omero_apache.sh for the apache config file creation diff --git a/linux/step05_centos6_py27_ius_apache24.sh b/linux/step05_centos6_py27_ius_apache24.sh index ea1e4687..d16a92d1 100644 --- a/linux/step05_centos6_py27_ius_apache24.sh +++ b/linux/step05_centos6_py27_ius_apache24.sh @@ -3,7 +3,6 @@ #start-copy cp setup_omero_apache24.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache24.sh" #start-install #install httpd 2.4 @@ -19,8 +18,13 @@ set -u /home/omero/omeroenv/bin/pip2.7 install mod_wsgi-httpd /home/omero/omeroenv/bin/pip2.7 install mod_wsgi +# Install OMERO.web requirements +/home/omero/omeroenv/bin/pip2.7 install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt + deactivate +# See setup_omero_apache.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache24.sh" # Add virtual env python to the python-path parameter of the WSGIDaemonProcess directive sed -i 's/\(python-path\=\)/\1\/home\/omero\/omeroenv\/lib64\/python2.7\/site-packages:/' ~omero/OMERO.server/apache.conf.tmp @@ -33,4 +37,4 @@ LoadModule wsgi_module /home/omero/omeroenv/lib64/python2.7/site-packages/mod_ws EOF chkconfig httpd on -service httpd start +service httpd start \ No newline at end of file diff --git a/linux/step05_centos6_py27_ius_nginx.sh b/linux/step05_centos6_py27_ius_nginx.sh index e9bddf27..9233dbd8 100644 --- a/linux/step05_centos6_py27_ius_nginx.sh +++ b/linux/step05_centos6_py27_ius_nginx.sh @@ -1,8 +1,12 @@ #!/bin/bash set -e -u -x -#start-install +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + +#start-install cat << EOF > /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo @@ -18,13 +22,15 @@ virtualenv -p /usr/bin/python2.7 /home/omero/omeroenv set +u source /home/omero/omeroenv/bin/activate set -u -# install in virtualenv created in step01 -/home/omero/omeroenv/bin/pip2.7 install --upgrade "gunicorn>=19.3" + +# Install OMERO.web requirements +/home/omero/omeroenv/bin/pip2.7 install -r ~omero/OMERO.server/share/web/requirements-py27-nginx.txt deactivate -# See setup_omero*.sh for the nginx config file creation -#remove comment +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" + mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.disabled cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/conf.d/omero-web.conf diff --git a/linux/step05_centos6_py27_nginx.sh b/linux/step05_centos6_py27_nginx.sh index 9cb0e151..3a947257 100644 --- a/linux/step05_centos6_py27_nginx.sh +++ b/linux/step05_centos6_py27_nginx.sh @@ -1,5 +1,9 @@ #!/bin/bash +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + #start-install set +u source /opt/rh/python27/enable @@ -14,11 +18,12 @@ enabled=1 EOF yum -y install nginx -pip install "gunicorn>=19.3" +pip install -r ~omero/OMERO.server/share/web/requirements-py27-nginx.txt -# See setup_omero*.sh for the nginx config file creation +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.disabled cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/conf.d/omero-web.conf -service nginx start +service nginx start \ No newline at end of file diff --git a/linux/step05_centos7_apache24.sh b/linux/step05_centos7_apache24.sh index 6a1c8b79..c1e90452 100644 --- a/linux/step05_centos7_apache24.sh +++ b/linux/step05_centos7_apache24.sh @@ -3,13 +3,15 @@ #start-copy cp setup_omero_apache24.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache24.sh" #start-install yum -y install httpd mod_wsgi -yum clean all + +# Install OMERO.web requirements +pip install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt # See setup_omero_apache.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache24.sh" cp ~omero/OMERO.server/apache.conf.tmp /etc/httpd/conf.d/omero-web.conf diff --git a/linux/step05_centos7_nginx.sh b/linux/step05_centos7_nginx.sh index 2af0d5e8..75f367a3 100644 --- a/linux/step05_centos7_nginx.sh +++ b/linux/step05_centos7_nginx.sh @@ -1,15 +1,31 @@ #!/bin/bash +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + #start-install -yum -y --enablerepo=cr install nginx +# The following is only required to install +# latest stable version of nginx +# Default will be 1.6.3 if not set +cat << EOF > /etc/yum.repos.d/nginx.repo +[nginx] +name=nginx repo +baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +EOF + +#install nginx +yum -y install nginx -pip install "gunicorn>=19.3" +pip install -r ~omero/OMERO.server/share/web/requirements-py27-nginx.txt -# See setup_omero*.sh for the nginx config file creation +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" sed -i.bak -re 's/( default_server.*)/; #\1/' /etc/nginx/nginx.conf cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/conf.d/omero-web.conf systemctl enable nginx -systemctl start nginx - +systemctl start nginx \ No newline at end of file diff --git a/linux/step05_debian8_nginx.sh b/linux/step05_debian8_nginx.sh new file mode 100644 index 00000000..e45c1db3 --- /dev/null +++ b/linux/step05_debian8_nginx.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + +#start-install +apt-get -y install nginx + +pip install -r ~omero/OMERO.server/share/web/requirements-py27-nginx.txt + +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" + +cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/sites-available/omero-web +rm /etc/nginx/sites-enabled/default +ln -s /etc/nginx/sites-available/omero-web /etc/nginx/sites-enabled/ + +service nginx start \ No newline at end of file diff --git a/linux/step05_ubuntu1404_apache24.sh b/linux/step05_ubuntu1404_apache24.sh index c72cda03..6873fd10 100644 --- a/linux/step05_ubuntu1404_apache24.sh +++ b/linux/step05_ubuntu1404_apache24.sh @@ -3,16 +3,19 @@ #start-copy cp setup_omero_apache24.sh ~omero #end-copy -su - omero -c "bash -eux setup_omero_apache24.sh" #start-install apt-get -y install apache2 libapache2-mod-wsgi +# Install OMERO.web requirements +pip install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt + # See setup_omero*.sh for the apache config file creation +su - omero -c "bash -eux setup_omero_apache24.sh" sed -i -r -e 's|(WSGISocketPrefix run/wsgi)|#\1|' -e 's|# (WSGISocketPrefix /var/run/wsgi)|\1|' ~omero/OMERO.server/apache.conf.tmp cp ~omero/OMERO.server/apache.conf.tmp /etc/apache2/sites-available/omero-web.conf a2dissite 000-default.conf a2ensite omero-web.conf -service apache2 start +service apache2 start \ No newline at end of file diff --git a/linux/step05_ubuntu1404_nginx.sh b/linux/step05_ubuntu1404_nginx.sh index d8d5c40e..95844d86 100644 --- a/linux/step05_ubuntu1404_nginx.sh +++ b/linux/step05_ubuntu1404_nginx.sh @@ -1,14 +1,24 @@ #!/bin/bash +#start-copy +cp setup_omero_nginx.sh ~omero +#end-copy + #start-install +# require to install more recent version of nginx +# w/o the version installed is 1.4.6 +add-apt-repository -y ppa:nginx/stable + +apt-get update apt-get -y install nginx -pip install "gunicorn>=19.3" +pip install -r ~omero/OMERO.server/share/web/requirements-py27-nginx.txt -# See setup_omero*.sh for the nginx config file creation +# set up as the omero user. +su - omero -c "bash -eux setup_omero_nginx.sh" cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/sites-available/omero-web rm /etc/nginx/sites-enabled/default ln -s /etc/nginx/sites-available/omero-web /etc/nginx/sites-enabled/ -service nginx start +service nginx start \ No newline at end of file diff --git a/linux/step07_all_perms.sh b/linux/step07_all_perms.sh index f8275b1e..43106e66 100644 --- a/linux/step07_all_perms.sh +++ b/linux/step07_all_perms.sh @@ -2,7 +2,7 @@ set -e -u -x -source settings.env +source `dirname $0`/settings.env #start chmod go-rwx ~omero/OMERO.server/etc ~omero/OMERO.server/var diff --git a/linux/test/README.md b/linux/test/README.md index e998584a..3d0c7669 100644 --- a/linux/test/README.md +++ b/linux/test/README.md @@ -19,6 +19,103 @@ for running docker images. CentOS 7 cannot be tested in this way as `systemd` doesn't fully work, see below. +Adding a new step +----------------- + +When adding a new step e.g. ice support: +1. first create either a file per OS or for a group of OS. +2. update the install_* scripts. +3. if a new parameter has to be introduce, the various Dockerfile and docker-build.sh in the +test directory have to be updated. +4. add a new configuration section to this README.md. + +Generating the walkthrough for documentation +-------------------------------------------- + +The walkthrough files should be used for documentation purpose. +To generate the walkthrough file corresponding to a given OS i.e. `walkthough_OS.sh`, +run for example: + + OS=centos6 bash autogenerate.sh + +Only the "recommended" requirements will be copied to the walkthrough file. +When a requirement is modified e.g. Postgres 9.5 instead of Postgres 9.4 +the following markers `#start-recommended`, `#end-recommended` should be updated +in the corresponding steps files. +The default value for given parameter should be the recommended version +e.g. openjdk18 for Java. + +Both nginx and apache installation steps are added to the walkthrough file + +The possible values are: +centos7 (default), centos6, centos6_py27, centos6_py27_ius, debian8, ubuntu1404 + +Configuring Java +---------------- + +By default, openjdk1.8 is installed. +It is possible to install other versions using the JAVAVER parameter + +For example, to install oracle-java: + +JAVAVER=oracle18 ./docker-build.sh ubuntu1404_nginx + +The supported values are: +openjdk17, openjdk18 (default), openjdk17-devel, openjdk18-devel, oracle17, oracle18 + +If you do not want to install Java set JAVAVER to nojava. + +To add a new Java version, update the following files +`step01_centos_java_deps.sh`, `step01_debian8_java_deps.sh`, +`step01_ubuntu1404_java_deps.sh` and update this README.md. + +Configuring Postgres +-------------------- + +By default, Postgres 9.4 is installed. +It is possible to install other versions using the PGVER parameter + +For example: + + PGVER=pg95 ./docker-build.sh centos6_py27_ius_nginx + + PGVER=pg95 ./docker-build.sh ubuntu1404_nginx + +To run the image for centOS 6 image, you need to pass the version used e.g. pg95 if the version +is not the default one. It is not necessary to specify the version when running ubuntu/Debian image. + +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_ubuntu1404_nginx + + +The supported values are: +pg94 (default), pg95 + +If you do not want to install Postgres set PGVER to nopg. + +To add a new Postgres version, update the following files +`step01_centos6_pg_deps.sh`, `step01_centos7_pg_deps.sh`, `step01_debian8_pg_deps.sh`, +`step01_ubuntu1404_pg_deps.sh` and update this README.md. + +Configuring Ice +--------------- + +By default, Ice 3.5 is installed. +It is possible to install other versions using the ICEVER parameter + +For example: + + ICEVER=ice35-devel ./docker-build.sh ubuntu1404_nginx + +The supported values are: +ice35, ice35-devel + +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. Installing web applications --------------------------- @@ -39,28 +136,36 @@ Installing development branches ------------------------------- By default the installation uses the latest OMERO server release. To use -a specific development, you can specify as a parameter one of the development version -i.e. omerodev or omeromerge, when building the image. +a specific development, you can specify as a parameter one of the development versions +when building the image. For example: - OMEROVER=omerodev ./docker-build.sh ubuntu1404_nginx + OMEROVER=OMERO-DEV-latest ./docker-build.sh ubuntu1404_nginx +The supported values are: +OMERO-DEV-latest, OMERO-DEV-merge-build, latest (default) -CentOS 7 testing +Testing CentOS 7 ================ 1. Create a test image containing the installation scripts 2. Start the container (this requires special options for systemd which may depend on your host system, see the [parent README](https://github.com/ome/ome-docker/blob/master/omero-ssh-systemd/README.md)) 3. ssh in 4. Change into the `/omero-install-test` directory -5. Run the scripts +5. Run either `install_centos7_apache24.sh` or `install_centos7_nginx.sh` 6. Optionally set a system password for the `omero` user if you want to allow ssh access ./docker-build.sh centos7 - CID=$(docker run -d ... -v /sys/fs/cgroup:/sys/fs/cgroup:ro omero_install_test_centos7) - #CID=$(docker run -d ... --privileged omero_install_test_centos7) - ssh -o UserKnownHostsFile=/dev/null root@
# Password: omero + #CID=$(docker run -d -p 2222:22 -p 8080:80 -p 4063:4063 -p 4064:4064 -v /sys/fs/cgroup:/sys/fs/cgroup:ro omero_install_test_centos7) + CID=$(docker run -d -p 2222:22 -p 8080:80 -p 4063:4063 -p 4064:4064 --privileged omero_install_test_centos7) + ssh -o UserKnownHostsFile=/dev/null -p 2222 root@
# Password: omero cd /omero-install-test bash install_centos7_nginx.sh #echo omero:omero | chpasswd +8. Manually start as the omero system user, the OMERO.server and OMERO.web: + + su - omero -c "OMERO.server/bin/omero admin start" + su - omero -c "OMERO.server/bin/omero web start" +7. Notet that it is possible to use the various parameters when running the installation script e.g. + ICEVER=ice35-devel bash install_centos7_nginx.sh diff --git a/linux/test/centos6_apache22/Dockerfile b/linux/test/centos6_apache22/Dockerfile index 1d10e517..2746bc46 100644 --- a/linux/test/centos6_apache22/Dockerfile +++ b/linux/test/centos6_apache22/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_apache22.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] diff --git a/linux/test/centos6_apache22/run.sh b/linux/test/centos6_apache22/run.sh index 70df9f23..af9ae7e7 100644 --- a/linux/test/centos6_apache22/run.sh +++ b/linux/test/centos6_apache22/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service httpd start diff --git a/linux/test/centos6_nginx/Dockerfile b/linux/test/centos6_nginx/Dockerfile index ea416f20..4b0d9eaf 100644 --- a/linux/test/centos6_nginx/Dockerfile +++ b/linux/test/centos6_nginx/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_nginx.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] \ No newline at end of file diff --git a/linux/test/centos6_nginx/run.sh b/linux/test/centos6_nginx/run.sh index 1289aa7f..9675e02f 100644 --- a/linux/test/centos6_nginx/run.sh +++ b/linux/test/centos6_nginx/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service nginx start diff --git a/linux/test/centos6_py27_apache24/Dockerfile b/linux/test/centos6_py27_apache24/Dockerfile index 612090c3..b3dca99d 100644 --- a/linux/test/centos6_py27_apache24/Dockerfile +++ b/linux/test/centos6_py27_apache24/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_py27_apache24.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] diff --git a/linux/test/centos6_py27_apache24/run.sh b/linux/test/centos6_py27_apache24/run.sh index c1883604..31f64f01 100644 --- a/linux/test/centos6_py27_apache24/run.sh +++ b/linux/test/centos6_py27_apache24/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service httpd24-httpd start diff --git a/linux/test/centos6_py27_ius_apache22/Dockerfile b/linux/test/centos6_py27_ius_apache22/Dockerfile index 2c30cf4d..c791adf4 100644 --- a/linux/test/centos6_py27_ius_apache22/Dockerfile +++ b/linux/test/centos6_py27_ius_apache22/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_py27_ius_apache22.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] diff --git a/linux/test/centos6_py27_ius_apache22/run.sh b/linux/test/centos6_py27_ius_apache22/run.sh index 70df9f23..af9ae7e7 100644 --- a/linux/test/centos6_py27_ius_apache22/run.sh +++ b/linux/test/centos6_py27_ius_apache22/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service httpd start diff --git a/linux/test/centos6_py27_ius_apache24/Dockerfile b/linux/test/centos6_py27_ius_apache24/Dockerfile index eaeedab2..18cb4a7d 100644 --- a/linux/test/centos6_py27_ius_apache24/Dockerfile +++ b/linux/test/centos6_py27_ius_apache24/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_py27_ius_apache24.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] \ No newline at end of file +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] \ No newline at end of file diff --git a/linux/test/centos6_py27_ius_apache24/run.sh b/linux/test/centos6_py27_ius_apache24/run.sh index de72f26e..77e8c806 100644 --- a/linux/test/centos6_py27_ius_apache24/run.sh +++ b/linux/test/centos6_py27_ius_apache24/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service httpd start diff --git a/linux/test/centos6_py27_ius_nginx/Dockerfile b/linux/test/centos6_py27_ius_nginx/Dockerfile index 505dc02e..814627f4 100644 --- a/linux/test/centos6_py27_ius_nginx/Dockerfile +++ b/linux/test/centos6_py27_ius_nginx/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_py27_ius_nginx.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] \ No newline at end of file +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] \ No newline at end of file diff --git a/linux/test/centos6_py27_ius_nginx/run.sh b/linux/test/centos6_py27_ius_nginx/run.sh index 3bd12cb9..991764d4 100644 --- a/linux/test/centos6_py27_ius_nginx/run.sh +++ b/linux/test/centos6_py27_ius_nginx/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service nginx start diff --git a/linux/test/centos6_py27_nginx/Dockerfile b/linux/test/centos6_py27_nginx/Dockerfile index 3fe0e134..7927d857 100644 --- a/linux/test/centos6_py27_nginx/Dockerfile +++ b/linux/test/centos6_py27_nginx/Dockerfile @@ -4,7 +4,10 @@ FROM centos:centos6 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 # Needed for postgres init.d RUN touch /etc/sysconfig/network @@ -19,8 +22,8 @@ RUN yum -y install unzip && unzip omero-install-test.zip RUN cd omero-install-test && \ bash install_centos6_py27_nginx.sh && \ - bash docker_shutdown_centos6.sh + PGVER=${PGVER} bash docker_shutdown_centos6.sh ADD run.sh /home/omero/run.sh EXPOSE 80 4063 4064 -CMD ["/bin/bash", "-e", "/home/omero/run.sh"] +ENTRYPOINT ["/bin/bash", "-e", "/home/omero/run.sh"] diff --git a/linux/test/centos6_py27_nginx/run.sh b/linux/test/centos6_py27_nginx/run.sh index 1289aa7f..9675e02f 100644 --- a/linux/test/centos6_py27_nginx/run.sh +++ b/linux/test/centos6_py27_nginx/run.sh @@ -1,5 +1,11 @@ #!/bin/bash -service postgresql-9.4 start +PGVER=${1:-pg94} + +if [ "$PGVER" = "pg94" ]; then + service postgresql-9.4 start +elif [ "$PGVER" = "pg95" ]; then + service postgresql-9.5 start +fi service crond start service omero start service nginx start diff --git a/linux/test/debian8_apache24/Dockerfile b/linux/test/debian8_apache24/Dockerfile index 3f3affaf..92ea32c8 100644 --- a/linux/test/debian8_apache24/Dockerfile +++ b/linux/test/debian8_apache24/Dockerfile @@ -4,7 +4,10 @@ FROM debian:jessie MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 RUN apt-get update && apt-get -y install locales RUN update-locale LANG=C.UTF-8 diff --git a/linux/test/debian8_nginx/Dockerfile b/linux/test/debian8_nginx/Dockerfile index c46835ce..916a59aa 100644 --- a/linux/test/debian8_nginx/Dockerfile +++ b/linux/test/debian8_nginx/Dockerfile @@ -4,7 +4,10 @@ FROM debian:jessie MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 RUN apt-get update && apt-get -y install locales RUN update-locale LANG=C.UTF-8 diff --git a/linux/test/docker-build.sh b/linux/test/docker-build.sh index f2628525..60c95655 100755 --- a/linux/test/docker-build.sh +++ b/linux/test/docker-build.sh @@ -6,13 +6,16 @@ if [ $# -ne 1 ]; then fi WEBAPPS=${WEBAPPS:-false} -OMEROVER=${OMEROVER:-omero} +OMEROVER=${OMEROVER:-latest} +JAVAVER=${JAVAVER:-openjdk18} +ICEVER=${ICEVER:-ice35} +PGVER=${PGVER:-pg94} set -e rm -rf omero-install-test mkdir omero-install-test -cp ../*.sh ../*.env ../*init.d ../*.service ../*cron omero-install-test +cp ../*.sh ../*.env ../*init.d ../*.service ../*cron ../*.txt omero-install-test zip -r $1/omero-install-test.zip omero-install-test rm -rf omero-install-test @@ -22,6 +25,8 @@ echo "Building image $IMAGE" if [[ $1 =~ "centos7" ]]; then docker build -t $IMAGE --no-cache $1 else - docker build -t $IMAGE --no-cache --build-arg OMEROVER=${OMEROVER} --build-arg WEBAPPS=${WEBAPPS} $1 + docker build -t $IMAGE --no-cache --build-arg OMEROVER=${OMEROVER} \ + --build-arg JAVAVER=${JAVAVER} --build-arg WEBAPPS=${WEBAPPS} \ + --build-arg ICEVER=${ICEVER} --build-arg PGVER=${PGVER} $1 fi echo "Test this image by running docker run -it [...] $IMAGE" diff --git a/linux/test/ubuntu1404_apache24/Dockerfile b/linux/test/ubuntu1404_apache24/Dockerfile index 88f75e91..9c879d8e 100644 --- a/linux/test/ubuntu1404_apache24/Dockerfile +++ b/linux/test/ubuntu1404_apache24/Dockerfile @@ -4,7 +4,10 @@ FROM ubuntu:14.04 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 RUN update-locale LANG=C.UTF-8 diff --git a/linux/test/ubuntu1404_nginx/Dockerfile b/linux/test/ubuntu1404_nginx/Dockerfile index b04ecc13..2e5661f7 100644 --- a/linux/test/ubuntu1404_nginx/Dockerfile +++ b/linux/test/ubuntu1404_nginx/Dockerfile @@ -4,7 +4,10 @@ FROM ubuntu:14.04 MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG WEBAPPS=false -ARG OMEROVER=omero +ARG OMEROVER=latest +ARG JAVAVER=openjdk18 +ARG ICEVER=ice35 +ARG PGVER=pg94 RUN update-locale LANG=C.UTF-8