From 448dff5a1caf59b75a0d54e905dfb08ebe10ec02 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Mon, 25 Sep 2023 13:01:14 +0100 Subject: [PATCH 01/20] Simplify rocky9 installation --- linux/install_rocky9.sh | 22 +++++------- linux/step01_rocky9_deps.sh | 63 +++++++++++++++++++++++++++++++++ linux/step01_rocky9_ice_deps.sh | 13 ------- linux/step01_rocky9_ice_venv.sh | 2 +- linux/step01_rocky9_pg_deps.sh | 28 --------------- 5 files changed, 72 insertions(+), 56 deletions(-) create mode 100644 linux/step01_rocky9_deps.sh delete mode 100644 linux/step01_rocky9_ice_deps.sh delete mode 100644 linux/step01_rocky9_pg_deps.sh diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index 5fc76d71..34aaf21e 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -6,18 +6,7 @@ OMEROVER=${OMEROVER:-latest} . `dirname $0`/settings.env -bash -eux step01_centos7_init.sh - -bash -eux step01_centos7_deps.sh - -# install java -bash -eux step01_centos_java_deps.sh - -# install ice -bash -eux step01_rocky9_ice_deps.sh - -# install Postgres -bash -eux step01_rocky9_pg_deps.sh +bash -eux step01_rocky9_deps.sh bash -eux step02_all_setup.sh @@ -40,5 +29,10 @@ fi #If you don't want to use the systemd scripts you can start OMERO manually: #su - omero-server -c ". /home/omero-server/settings.env omero admin start" - -bash -eux step06_centos7_daemon.sh +#start-recommended +cp omero-server-systemd.service /etc/systemd/system/omero-server.service +if [ ! -f /.dockerenv ]; then + systemctl daemon-reload +fi +systemctl enable omero-server.service +#end-recommended diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh new file mode 100644 index 00000000..c78322db --- /dev/null +++ b/linux/step01_rocky9_deps.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# General additional packages installation +dnf -y install python unzip bzip2 wget bc openssl + + +# Java installation +JAVAVER=${JAVAVER:-openjdk11} +if [ "$JAVAVER" = "openjdk1.8" ]; then + dnf -y install java-1.8.0-openjdk +elif [ "$JAVAVER" = "openjdk1.8-devel" ]; then + dnf -y install java-1.8.0-openjdk-devel +elif [ "$JAVAVER" = "openjdk11" ]; then + #start-recommended + dnf -y install java-11-openjdk + #end-recommended +elif [ "$JAVAVER" = "openjdk11-devel" ]; then + dnf -y install java-11-openjdk-devel +fi + + +# ICE installation +#start-recommended +if grep -q "Rocky" /etc/redhat-release; then + dnf -y install 'dnf-command(config-manager)' + dnf config-manager --set-enabled crb +fi +if grep -q "Red Hat" /etc/redhat-release; then + subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms +fi +dnf -y install expat libdb-cxx + +cd /tmp +wget https://github.com/sbesson/zeroc-ice-rhel9-x86_64/releases/download/20230830/Ice-3.6.5-rhel9-x86_64.tar.gz +tar xf Ice-3.6.5-rhel9-x86_64.tar.gz +mv Ice-3.6.5 /opt/ice-3.6.5 +echo /opt/ice-3.6.5/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf +ldconfig +#end-recommended + + +# PostgreSQL installation +PGVER=${PGVER:-pg13} # pg 13 is installed by default +#start-recommended +dnf -y install postgresql-server postgresql + +if [ -f /.dockerenv ]; then + su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/data/postgresql.conf +else + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/bin/postgresql-setup --initdb +fi +sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf + +if [ -f /.dockerenv ]; then + su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" +else + systemctl start postgresql +fi + systemctl enable postgresql + +sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf +#end-recommended diff --git a/linux/step01_rocky9_ice_deps.sh b/linux/step01_rocky9_ice_deps.sh deleted file mode 100644 index 82e451d2..00000000 --- a/linux/step01_rocky9_ice_deps.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#start-recommended -dnf config-manager --set-enabled crb -yum -y install bzip2 expat libdb-cxx - -cd /tmp -wget https://github.com/sbesson/zeroc-ice-rockylinux9-x86_64/releases/download/202307018/Ice-3.6.5-rockylinux9-x86_64.tar.gz -tar xf Ice-3.6.5-rockylinux9-x86_64.tar.gz -mv Ice-3.6.5 /opt/ice-3.6.5 -echo /opt/ice-3.6.5/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf -ldconfig -#end-recommended \ No newline at end of file diff --git a/linux/step01_rocky9_ice_venv.sh b/linux/step01_rocky9_ice_venv.sh index cb4887c2..c4605985 100644 --- a/linux/step01_rocky9_ice_venv.sh +++ b/linux/step01_rocky9_ice_venv.sh @@ -5,7 +5,7 @@ set -e -u -x VENV_SERVER=${VENV_SERVER:-/opt/omero/server/venv3} #start-ice-py # Create a virtual env -python3 -mvenv $VENV_SERVER +python -mvenv $VENV_SERVER # Upgrade pip $VENV_SERVER/bin/pip install --upgrade pip diff --git a/linux/step01_rocky9_pg_deps.sh b/linux/step01_rocky9_pg_deps.sh deleted file mode 100644 index f6c3e024..00000000 --- a/linux/step01_rocky9_pg_deps.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -PGVER=${PGVER:-pg13} # pg 13 is installed by default - -#start-postgresql-installation-general - -#end-postgresql-installation-general -#start-recommended -yum -y install postgresql-server postgresql - -if [ -f /.dockerenv ]; then - su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" - echo "listen_addresses='*'" >> /var/lib/pgsql/data/postgresql.conf -else - PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/bin/postgresql-setup --initdb -fi -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf - -if [ -f /.dockerenv ]; then - su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" -else - systemctl start postgresql -fi - systemctl enable postgresql - -sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf - -#end-recommended From bc71fe5d6d68452e320d0f4ab16b957807b5159e Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Tue, 26 Sep 2023 09:20:02 +0100 Subject: [PATCH 02/20] Use python3 instead of python --- linux/step01_rocky9_ice_venv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/step01_rocky9_ice_venv.sh b/linux/step01_rocky9_ice_venv.sh index c4605985..cb4887c2 100644 --- a/linux/step01_rocky9_ice_venv.sh +++ b/linux/step01_rocky9_ice_venv.sh @@ -5,7 +5,7 @@ set -e -u -x VENV_SERVER=${VENV_SERVER:-/opt/omero/server/venv3} #start-ice-py # Create a virtual env -python -mvenv $VENV_SERVER +python3 -mvenv $VENV_SERVER # Upgrade pip $VENV_SERVER/bin/pip install --upgrade pip From 6e458df08ebc4827132c28a304de99ba2b61db55 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Thu, 28 Sep 2023 14:47:09 +0100 Subject: [PATCH 03/20] Use Glencoe ice build --- linux/step01_rocky9_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index c78322db..1e8aecf7 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -31,7 +31,7 @@ fi dnf -y install expat libdb-cxx cd /tmp -wget https://github.com/sbesson/zeroc-ice-rhel9-x86_64/releases/download/20230830/Ice-3.6.5-rhel9-x86_64.tar.gz +wget https://github.com/glencoesoftware/zeroc-ice-rhel9-x86_64/releases/download/20230928/Ice-3.6.5-rhel9-x86_64.tar.gz tar xf Ice-3.6.5-rhel9-x86_64.tar.gz mv Ice-3.6.5 /opt/ice-3.6.5 echo /opt/ice-3.6.5/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf From 6c85e13df07821e69fae55c1253dce2420528960 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Fri, 29 Sep 2023 15:25:59 +0100 Subject: [PATCH 04/20] Add newer postgres versions --- .github/workflows/main.yml | 4 +-- linux/step01_rocky9_deps.sh | 69 ++++++++++++++++++++++++++++--------- 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd88d27b..7a1497dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - os: [rockylinux9, debian10, ubuntu1804, ubuntu2004, ubuntu2204] - pg: [pg13, pg14] + os: [rockylinux9, debian10, ubuntu2204] + pg: [pg13, pg14, pg15, pg16] exclude: - os: ubuntu2204 pg: pg13 diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 1e8aecf7..90c207a0 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -40,24 +40,61 @@ ldconfig # PostgreSQL installation -PGVER=${PGVER:-pg13} # pg 13 is installed by default -#start-recommended -dnf -y install postgresql-server postgresql - -if [ -f /.dockerenv ]; then - su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" - echo "listen_addresses='*'" >> /var/lib/pgsql/data/postgresql.conf -else - PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/bin/postgresql-setup --initdb +dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm +dnf -qy module disable postgresql +PGVER=${PGVER:-pg13} +if [ "$PGVER" = "pg13" ]; then + #start-recommended + dnf -y install postgresql13-server postgresql + /usr/pgsql-13/bin/postgresql-13-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/13/data/pg_hba.conf + sed -i 's/ ident/ trust/g' /var/lib/pgsql/13/data/pg_hba.conf + #end-recommended +elif [ "$PGVER" = "pg14" ]; then + dnf -y install postgresql14-server postgresql + /usr/pgsql-14/bin/postgresql-14-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/14/data/pg_hba.conf + sed -i 's/ ident/ trust/g' /var/lib/pgsql/14/data/pg_hba.conf +elif [ "$PGVER" = "pg15" ]; then + dnf -y install postgresql15-server postgresql + /usr/pgsql-15/bin/postgresql-15-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/15/data/pg_hba.conf + sed -i 's/ ident/ trust/g' /var/lib/pgsql/15/data/pg_hba.conf +elif [ "$PGVER" = "pg16" ]; then + dnf -y install postgresql16-server postgresql + /usr/pgsql-16/bin/postgresql-16-setup initdb + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/16/data/pg_hba.conf + sed -i 's/ ident/ trust/g' /var/lib/pgsql/16/data/pg_hba.conf fi -sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf if [ -f /.dockerenv ]; then - su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" + if [ "$PGVER" = "pg13" ]; then + echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf + su - postgres -c "/usr/pgsql-13/binpg_ctl start -D /var/lib/pgsql/13/data -w" + elif [ "$PGVER" = "pg14" ]; then + echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf + su - postgres -c "/usr/pgsql-14/binpg_ctl start -D /var/lib/pgsql/14/data -w" + elif [ "$PGVER" = "pg15" ]; then + echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf + su - postgres -c "/usr/pgsql-15/binpg_ctl start -D /var/lib/pgsql/15/data -w" + elif [ "$PGVER" = "pg16" ]; then + echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf + su - postgres -c "/usr/pgsql-16/binpg_ctl start -D /var/lib/pgsql/16/data -w" + fi else - systemctl start postgresql + if [ "$PGVER" = "pg13" ]; then + #start-recommended + systemctl start postgresql-13 + systemctl enable postgresql-13 + #end-recommended + elif [ "$PGVER" = "pg14" ]; then + systemctl start postgresql-14 + systemctl enable postgresql-14 + elif [ "$PGVER" = "pg15" ]; then + systemctl start postgresql-15 + systemctl enable postgresql-15 + elif [ "$PGVER" = "pg16" ]; then + systemctl start postgresql-16 + systemctl enable postgresql-16 + fi fi - systemctl enable postgresql - -sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf -#end-recommended From e30026599efae9f4e9781e6f093b7fa5f1ed82db Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 16:08:34 +0100 Subject: [PATCH 05/20] run in docker --- linux/step01_rocky9_deps.sh | 38 +++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 90c207a0..19ff3a52 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -46,23 +46,45 @@ PGVER=${PGVER:-pg13} if [ "$PGVER" = "pg13" ]; then #start-recommended dnf -y install postgresql13-server postgresql - /usr/pgsql-13/bin/postgresql-13-setup initdb + if [ -f /.dockerenv ]; then + su - postgres -c "/usr/postgresql13/bin/initdb -D /var/lib/pgsql/13/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf + else + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-13/bin/postgresql-13-setup initdb + fi sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/13/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/13/data/pg_hba.conf #end-recommended elif [ "$PGVER" = "pg14" ]; then dnf -y install postgresql14-server postgresql - /usr/pgsql-14/bin/postgresql-14-setup initdb + if [ -f /.dockerenv ]; then + su - postgres -c "/usr/postgresql14/bin/initdb -D /var/lib/pgsql/14/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf + else + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-14/bin/postgresql-14-setup initdb + fi + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/14/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/14/data/pg_hba.conf elif [ "$PGVER" = "pg15" ]; then dnf -y install postgresql15-server postgresql - /usr/pgsql-15/bin/postgresql-15-setup initdb + if [ -f /.dockerenv ]; then + su - postgres -c "/usr/postgresql15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf + else + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-15/bin/postgresql-15-setup initdb + fi sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/15/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/15/data/pg_hba.conf elif [ "$PGVER" = "pg16" ]; then dnf -y install postgresql16-server postgresql - /usr/pgsql-16/bin/postgresql-16-setup initdb + if [ -f /.dockerenv ]; then + su - postgres -c "/usr/pgsql-16/bin/initdb -D /var/lib/pgsql/16/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf + else + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-16/bin/postgresql-16-setup initdb + fi + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/16/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/16/data/pg_hba.conf fi @@ -70,16 +92,16 @@ fi if [ -f /.dockerenv ]; then if [ "$PGVER" = "pg13" ]; then echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf - su - postgres -c "/usr/pgsql-13/binpg_ctl start -D /var/lib/pgsql/13/data -w" + su - postgres -c "/usr/pgsql-13/bin/pg_ctl start -D /var/lib/pgsql/13/data -w" elif [ "$PGVER" = "pg14" ]; then echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf - su - postgres -c "/usr/pgsql-14/binpg_ctl start -D /var/lib/pgsql/14/data -w" + su - postgres -c "/usr/pgsql-14/bin/pg_ctl start -D /var/lib/pgsql/14/data -w" elif [ "$PGVER" = "pg15" ]; then echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf - su - postgres -c "/usr/pgsql-15/binpg_ctl start -D /var/lib/pgsql/15/data -w" + su - postgres -c "/usr/pgsql-15/bin/pg_ctl start -D /var/lib/pgsql/15/data -w" elif [ "$PGVER" = "pg16" ]; then echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf - su - postgres -c "/usr/pgsql-16/binpg_ctl start -D /var/lib/pgsql/16/data -w" + su - postgres -c "/usr/pgsql-16/bin/pg_ctl start -D /var/lib/pgsql/16/data -w" fi else if [ "$PGVER" = "pg13" ]; then From 34874e8553173c8fd0eab4d7bdad816e30613e0d Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 16:12:36 +0100 Subject: [PATCH 06/20] fix name --- linux/step01_rocky9_deps.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 19ff3a52..5cc74ef4 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -47,7 +47,7 @@ if [ "$PGVER" = "pg13" ]; then #start-recommended dnf -y install postgresql13-server postgresql if [ -f /.dockerenv ]; then - su - postgres -c "/usr/postgresql13/bin/initdb -D /var/lib/pgsql/13/data --encoding=UTF8" + su - postgres -c "/usr/pgsql-13/bin/initdb -D /var/lib/pgsql/13/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-13/bin/postgresql-13-setup initdb @@ -58,7 +58,7 @@ if [ "$PGVER" = "pg13" ]; then elif [ "$PGVER" = "pg14" ]; then dnf -y install postgresql14-server postgresql if [ -f /.dockerenv ]; then - su - postgres -c "/usr/postgresql14/bin/initdb -D /var/lib/pgsql/14/data --encoding=UTF8" + su - postgres -c "/usr/pgsql-14/bin/initdb -D /var/lib/pgsql/14/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-14/bin/postgresql-14-setup initdb @@ -69,7 +69,7 @@ elif [ "$PGVER" = "pg14" ]; then elif [ "$PGVER" = "pg15" ]; then dnf -y install postgresql15-server postgresql if [ -f /.dockerenv ]; then - su - postgres -c "/usr/postgresql15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" + su - postgres -c "/usr/pgsql-15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-15/bin/postgresql-15-setup initdb From afde6d2bad24a0fb9b87b9a8c363026824f086af Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 16:44:01 +0100 Subject: [PATCH 07/20] use version --- linux/step01_rocky9_deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 5cc74ef4..a6a54a1b 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -45,7 +45,7 @@ dnf -qy module disable postgresql PGVER=${PGVER:-pg13} if [ "$PGVER" = "pg13" ]; then #start-recommended - dnf -y install postgresql13-server postgresql + dnf -y install postgresql13-server postgresql13 if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-13/bin/initdb -D /var/lib/pgsql/13/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf @@ -56,7 +56,7 @@ if [ "$PGVER" = "pg13" ]; then sed -i 's/ ident/ trust/g' /var/lib/pgsql/13/data/pg_hba.conf #end-recommended elif [ "$PGVER" = "pg14" ]; then - dnf -y install postgresql14-server postgresql + dnf -y install postgresql14-server postgresql14 if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-14/bin/initdb -D /var/lib/pgsql/14/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf @@ -67,7 +67,7 @@ elif [ "$PGVER" = "pg14" ]; then sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/14/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/14/data/pg_hba.conf elif [ "$PGVER" = "pg15" ]; then - dnf -y install postgresql15-server postgresql + dnf -y install postgresql15-server postgresql15 if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf @@ -77,7 +77,7 @@ elif [ "$PGVER" = "pg15" ]; then sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/15/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/15/data/pg_hba.conf elif [ "$PGVER" = "pg16" ]; then - dnf -y install postgresql16-server postgresql + dnf -y install postgresql16-server postgresql16 if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-16/bin/initdb -D /var/lib/pgsql/16/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf From 27c79a1cf9a3ad4d069e238338a94e8b96bd8aef Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 16:50:15 +0100 Subject: [PATCH 08/20] exclude pg15 and 16 build on debian --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a1497dd..f3ecdfbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,10 @@ jobs: exclude: - os: ubuntu2204 pg: pg13 + - os: debian10 + pg: pg15 + - os: debian10 + pg: pg16 steps: - name: Checkout uses: actions/checkout@v2 From 3c57eb17805d7c757862963dba8bdd841df507b2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 17:02:57 +0100 Subject: [PATCH 09/20] use the default --- linux/test/rockylinux9/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/test/rockylinux9/run.sh b/linux/test/rockylinux9/run.sh index 8e105b18..f05e4b70 100644 --- a/linux/test/rockylinux9/run.sh +++ b/linux/test/rockylinux9/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" +su - postgres -c "/usr/pgsql-13/bin/pg_ctl start -D /var/lib/pgsql/13/data -w" #service crond start # Doesn't work in Docker su - omero-server -c ". /home/omero-server/settings.env && omero admin start" From 5147ad2f232430dcc90db8c5535b49eff75d802d Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 20:24:32 +0100 Subject: [PATCH 10/20] remove duplicate --- linux/step01_rocky9_deps.sh | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index a6a54a1b..8129bcdd 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -1,21 +1,23 @@ #!/bin/bash +PGVER=${PGVER:-pg13} +JAVAVER=${JAVAVER:-openjdk11} # General additional packages installation dnf -y install python unzip bzip2 wget bc openssl # Java installation -JAVAVER=${JAVAVER:-openjdk11} + if [ "$JAVAVER" = "openjdk1.8" ]; then - dnf -y install java-1.8.0-openjdk + dnf -y install java-1.8.0-openjdk elif [ "$JAVAVER" = "openjdk1.8-devel" ]; then - dnf -y install java-1.8.0-openjdk-devel + dnf -y install java-1.8.0-openjdk-devel elif [ "$JAVAVER" = "openjdk11" ]; then - #start-recommended - dnf -y install java-11-openjdk + #start-recommended + dnf -y install java-11-openjdk #end-recommended elif [ "$JAVAVER" = "openjdk11-devel" ]; then - dnf -y install java-11-openjdk-devel + dnf -y install java-11-openjdk-devel fi @@ -40,20 +42,22 @@ ldconfig # PostgreSQL installation -dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm -dnf -qy module disable postgresql -PGVER=${PGVER:-pg13} +if [ "$PGVER" != "pg13" ]; then + dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm + dnf -qy module disable postgresql +fi + if [ "$PGVER" = "pg13" ]; then #start-recommended - dnf -y install postgresql13-server postgresql13 + dnf -y install postgresql-server postgresql if [ -f /.dockerenv ]; then - su - postgres -c "/usr/pgsql-13/bin/initdb -D /var/lib/pgsql/13/data --encoding=UTF8" - echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf + su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" + echo "listen_addresses='*'" >> /var/lib/pgsql/data/postgresql.conf else - PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-13/bin/postgresql-13-setup initdb + PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/bin/postgresql-setup --initdb fi - sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/13/data/pg_hba.conf - sed -i 's/ ident/ trust/g' /var/lib/pgsql/13/data/pg_hba.conf + sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf + sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf #end-recommended elif [ "$PGVER" = "pg14" ]; then dnf -y install postgresql14-server postgresql14 @@ -91,16 +95,12 @@ fi if [ -f /.dockerenv ]; then if [ "$PGVER" = "pg13" ]; then - echo "listen_addresses='*'" >> /var/lib/pgsql/13/data/postgresql.conf - su - postgres -c "/usr/pgsql-13/bin/pg_ctl start -D /var/lib/pgsql/13/data -w" + su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" elif [ "$PGVER" = "pg14" ]; then - echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf su - postgres -c "/usr/pgsql-14/bin/pg_ctl start -D /var/lib/pgsql/14/data -w" elif [ "$PGVER" = "pg15" ]; then - echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf su - postgres -c "/usr/pgsql-15/bin/pg_ctl start -D /var/lib/pgsql/15/data -w" elif [ "$PGVER" = "pg16" ]; then - echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf su - postgres -c "/usr/pgsql-16/bin/pg_ctl start -D /var/lib/pgsql/16/data -w" fi else From a1605f1ccf538292094662797e09b8c886bb9d58 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 2 Oct 2023 20:24:51 +0100 Subject: [PATCH 11/20] roll back --- linux/test/rockylinux9/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/test/rockylinux9/run.sh b/linux/test/rockylinux9/run.sh index f05e4b70..8e105b18 100644 --- a/linux/test/rockylinux9/run.sh +++ b/linux/test/rockylinux9/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -su - postgres -c "/usr/pgsql-13/bin/pg_ctl start -D /var/lib/pgsql/13/data -w" +su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" #service crond start # Doesn't work in Docker su - omero-server -c ". /home/omero-server/settings.env && omero admin start" From e585e5c40cebe5d5b67c846e13c674ca3e05f856 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 07:33:35 +0100 Subject: [PATCH 12/20] create symlink for docker --- linux/step01_rocky9_deps.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 8129bcdd..334f9f63 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -64,6 +64,8 @@ elif [ "$PGVER" = "pg14" ]; then if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-14/bin/initdb -D /var/lib/pgsql/14/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/14/data/postgresql.conf + ln -s /usr/pgsql-14/bin/pg_ctl /usr/bin/pg_ctl + ln -s /var/lib/pgsql/14/data /var/lib/pgsql/data else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-14/bin/postgresql-14-setup initdb fi @@ -75,6 +77,8 @@ elif [ "$PGVER" = "pg15" ]; then if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/15/data/postgresql.conf + ln -s /usr/pgsql-15/bin/pg_ctl /usr/bin/pg_ctl + ln -s /var/lib/pgsql/15/data /var/lib/pgsql/data else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-15/bin/postgresql-15-setup initdb fi @@ -85,6 +89,8 @@ elif [ "$PGVER" = "pg16" ]; then if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-16/bin/initdb -D /var/lib/pgsql/16/data --encoding=UTF8" echo "listen_addresses='*'" >> /var/lib/pgsql/16/data/postgresql.conf + ln -s /usr/pgsql-16/bin/pg_ctl /usr/bin/pg_ctl + ln -s /var/lib/pgsql/16/data /var/lib/pgsql/data else PGSETUP_INITDB_OPTIONS=--encoding=UTF8 /usr/pgsql-16/bin/postgresql-16-setup initdb fi @@ -94,15 +100,7 @@ elif [ "$PGVER" = "pg16" ]; then fi if [ -f /.dockerenv ]; then - if [ "$PGVER" = "pg13" ]; then - su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" - elif [ "$PGVER" = "pg14" ]; then - su - postgres -c "/usr/pgsql-14/bin/pg_ctl start -D /var/lib/pgsql/14/data -w" - elif [ "$PGVER" = "pg15" ]; then - su - postgres -c "/usr/pgsql-15/bin/pg_ctl start -D /var/lib/pgsql/15/data -w" - elif [ "$PGVER" = "pg16" ]; then - su - postgres -c "/usr/pgsql-16/bin/pg_ctl start -D /var/lib/pgsql/16/data -w" - fi + su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" else if [ "$PGVER" = "pg13" ]; then #start-recommended From 5c9b588435ca46e767eb1a2b7b229331d5c84ab6 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 07:41:49 +0100 Subject: [PATCH 13/20] drop 13 in pg command --- linux/step01_rocky9_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 334f9f63..52aafb9d 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -104,8 +104,8 @@ if [ -f /.dockerenv ]; then else if [ "$PGVER" = "pg13" ]; then #start-recommended - systemctl start postgresql-13 - systemctl enable postgresql-13 + systemctl start postgresql + systemctl enable postgresql #end-recommended elif [ "$PGVER" = "pg14" ]; then systemctl start postgresql-14 From f3576a62deb696574720d69e10a3cd0e26783215 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 13:48:16 +0100 Subject: [PATCH 14/20] fix doc generation for rocky9 --- linux/autogenerate.sh | 88 ++++++++++++++++++++++++++++--------- linux/step01_rocky9_deps.sh | 21 +++++---- 2 files changed, 80 insertions(+), 29 deletions(-) diff --git a/linux/autogenerate.sh b/linux/autogenerate.sh index d4fe6182..ecc6a39e 100755 --- a/linux/autogenerate.sh +++ b/linux/autogenerate.sh @@ -50,8 +50,6 @@ echo "$line" >> $file N=$OS if [[ $OS =~ "centos" ]] ; then N="centos" -elif [[ $OS =~ "rocky" ]] ; then - N="centos" elif [[ $OS =~ "ubuntu1804" ]] ; then N="ubuntu1804" elif [[ $OS =~ "ubuntu" ]] ; then @@ -59,11 +57,20 @@ elif [[ $OS =~ "ubuntu" ]] ; then fi echo -en '\n' >> $file echo "# install Java" >> $file -number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_java_deps.sh) -ns=$((number+1)) -number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_java_deps.sh) -ne=$((number-1)) -line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_java_deps.sh) +if [[ $OS =~ "rocky" ]] ; then + number=$(sed -n '/#start-recommended-java/=' $dir/step01_rocky9_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended-java/=' $dir/step01_rocky9_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' $dir/step01_rocky9_deps.sh) +else + number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_java_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_java_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_java_deps.sh) +fi + # remove leading whitespace line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" echo "$line" >> $file @@ -74,11 +81,18 @@ echo "# install dependencies" >> $file N=$OS if [[ $OS =~ "ubuntu" ]] ; then N="ubuntu1804" -elif [[ $OS =~ "rocky" ]] ; then - N="centos7" fi -line=$(sed -n '2,$p' $dir/step01_"$N"_deps.sh) +if [[ $OS =~ "rocky" ]] ; then + number=$(sed -n '/#start-general/=' $dir/step01_rocky9_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-general/=' $dir/step01_rocky9_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' $dir/step01_rocky9_deps.sh) +else + line=$(sed -n '2,$p' $dir/step01_"$N"_deps.sh) +fi + echo "$line" >> $file echo "#end-step01" >> $file @@ -87,13 +101,22 @@ echo "#end-step01" >> $file echo "# install Ice" >> $file N=$OS echo "#start-recommended-ice" >> $file -number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_ice_deps.sh) -ns=$((number+1)) -number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_ice_deps.sh) -ne=$((number-1)) -line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_ice_deps.sh) -# remove leading whitespace -line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" +if [[ $OS =~ "rocky" ]] ; then + number=$(sed -n '/#start-recommended-ice/=' $dir/step01_rocky9_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended-ice/=' $dir/step01_rocky9_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' $dir/step01_rocky9_deps.sh) +else + number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_ice_deps.sh) + ns=$((number+1)) + number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_ice_deps.sh) + ne=$((number-1)) + line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_ice_deps.sh) + # remove leading whitespace + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" +fi + echo "$line" >> $file echo "#end-recommended-ice" >> $file @@ -101,9 +124,6 @@ echo -en '\n' >> $file # install postgres N=$OS -if [[ $OS =~ "rocky" ]] ; then - N="centos" -fi echo -en '\n' >> $file echo "# install Postgres" >> $file if [[ $N =~ "centos" ]] ; then @@ -123,6 +143,34 @@ if [[ $N =~ "centos" ]] ; then line=$(sed -n ''$nrs','$nre'p' $dir/step01_"$OS"_pg_deps.sh) # remove docker conditional line=`remove_docker_workaround "${line}"` +elif [[ $OS =~ "rocky" ]] ; then + number=$(sed -n '/#start-pg-enabling/=' $dir/step01_rocky9_deps.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-pg-enabling/=' $dir/step01_rocky9_deps.sh) + nre=$((number-1)) + line=$(sed -n ''$nrs','$nre'p' $dir/step01_rocky9_deps.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + + number=$(sed -n '/#start-recommended-postgres/=' $dir/step01_rocky9_deps.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-recommended-postgres/=' $dir/step01_rocky9_deps.sh) + nre=$((number-1)) + line=$(sed -n ''$nrs','$nre'p' $dir/step01_rocky9_deps.sh) + + + # remove docker conditional + line=`remove_docker_workaround "${line}"` + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + + number=$(sed -n '/#start-recommended-pg-start/=' $dir/step01_rocky9_deps.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-recommended-pg-start/=' $dir/step01_rocky9_deps.sh) + nre=$((number-1)) + line=$(sed -n ''$nrs','$nre'p' $dir/step01_rocky9_deps.sh) + # remove docker conditional + line=`remove_docker_workaround "${line}"` else number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_pg_deps.sh) ns=$((number+1)) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 52aafb9d..3a70890a 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -3,8 +3,9 @@ PGVER=${PGVER:-pg13} JAVAVER=${JAVAVER:-openjdk11} # General additional packages installation +#start-general dnf -y install python unzip bzip2 wget bc openssl - +#end-general # Java installation @@ -13,16 +14,16 @@ if [ "$JAVAVER" = "openjdk1.8" ]; then elif [ "$JAVAVER" = "openjdk1.8-devel" ]; then dnf -y install java-1.8.0-openjdk-devel elif [ "$JAVAVER" = "openjdk11" ]; then - #start-recommended + #start-recommended-java dnf -y install java-11-openjdk - #end-recommended + #end-recommended-java elif [ "$JAVAVER" = "openjdk11-devel" ]; then dnf -y install java-11-openjdk-devel fi # ICE installation -#start-recommended +#start-recommended-ice if grep -q "Rocky" /etc/redhat-release; then dnf -y install 'dnf-command(config-manager)' dnf config-manager --set-enabled crb @@ -38,17 +39,19 @@ tar xf Ice-3.6.5-rhel9-x86_64.tar.gz mv Ice-3.6.5 /opt/ice-3.6.5 echo /opt/ice-3.6.5/lib64 > /etc/ld.so.conf.d/ice-x86_64.conf ldconfig -#end-recommended +#end-recommended-ice # PostgreSQL installation if [ "$PGVER" != "pg13" ]; then + #start-pg-enabling dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm dnf -qy module disable postgresql + #end-pg-enabling fi if [ "$PGVER" = "pg13" ]; then - #start-recommended + #start-recommended-postgres dnf -y install postgresql-server postgresql if [ -f /.dockerenv ]; then su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" @@ -58,7 +61,7 @@ if [ "$PGVER" = "pg13" ]; then fi sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf - #end-recommended + #end-recommended-postgres elif [ "$PGVER" = "pg14" ]; then dnf -y install postgresql14-server postgresql14 if [ -f /.dockerenv ]; then @@ -103,10 +106,10 @@ if [ -f /.dockerenv ]; then su - postgres -c "/usr/bin/pg_ctl start -D /var/lib/pgsql/data -w" else if [ "$PGVER" = "pg13" ]; then - #start-recommended + #start-recommended-pg-start systemctl start postgresql systemctl enable postgresql - #end-recommended + #end-recommended-pg-start elif [ "$PGVER" = "pg14" ]; then systemctl start postgresql-14 systemctl enable postgresql-14 From 424891cc7adc9d14e6809c3bf2e3387a82fec316 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 13:50:34 +0100 Subject: [PATCH 15/20] mark pg15 as the default --- linux/step01_rocky9_deps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index 3a70890a..ec98d1e8 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -51,7 +51,7 @@ if [ "$PGVER" != "pg13" ]; then fi if [ "$PGVER" = "pg13" ]; then - #start-recommended-postgres + dnf -y install postgresql-server postgresql if [ -f /.dockerenv ]; then su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data --encoding=UTF8" @@ -61,7 +61,7 @@ if [ "$PGVER" = "pg13" ]; then fi sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf - #end-recommended-postgres + elif [ "$PGVER" = "pg14" ]; then dnf -y install postgresql14-server postgresql14 if [ -f /.dockerenv ]; then @@ -76,6 +76,7 @@ elif [ "$PGVER" = "pg14" ]; then sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/14/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/14/data/pg_hba.conf elif [ "$PGVER" = "pg15" ]; then + #start-recommended-postgres dnf -y install postgresql15-server postgresql15 if [ -f /.dockerenv ]; then su - postgres -c "/usr/pgsql-15/bin/initdb -D /var/lib/pgsql/15/data --encoding=UTF8" @@ -87,6 +88,7 @@ elif [ "$PGVER" = "pg15" ]; then fi sed -i.bak -re 's/^(host.*)ident/\1md5/' /var/lib/pgsql/15/data/pg_hba.conf sed -i 's/ ident/ trust/g' /var/lib/pgsql/15/data/pg_hba.conf + #end-recommended-postgres elif [ "$PGVER" = "pg16" ]; then dnf -y install postgresql16-server postgresql16 if [ -f /.dockerenv ]; then From ca44874c7e8c141a44927fa7af8a792d4eae3d5e Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 13:52:51 +0100 Subject: [PATCH 16/20] review default for rocky9 --- linux/install_rocky9.sh | 4 +++- linux/step01_rocky9_deps.sh | 2 +- linux/test/rockylinux9/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index 34aaf21e..6ef82b8e 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -3,10 +3,12 @@ set -e -u -x OMEROVER=${OMEROVER:-latest} +PGVER=${PGVER:-pg15} +JAVAVER=${JAVAVER:-openjdk11} . `dirname $0`/settings.env -bash -eux step01_rocky9_deps.sh +PGVER=$PGVER JAVAVER=$JAVAVER bash -eux step01_rocky9_deps.sh bash -eux step02_all_setup.sh diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh index ec98d1e8..be61b489 100644 --- a/linux/step01_rocky9_deps.sh +++ b/linux/step01_rocky9_deps.sh @@ -1,6 +1,6 @@ #!/bin/bash -PGVER=${PGVER:-pg13} +PGVER=${PGVER:-pg15} JAVAVER=${JAVAVER:-openjdk11} # General additional packages installation #start-general diff --git a/linux/test/rockylinux9/Dockerfile b/linux/test/rockylinux9/Dockerfile index 83d27f22..55c84fc1 100644 --- a/linux/test/rockylinux9/Dockerfile +++ b/linux/test/rockylinux9/Dockerfile @@ -6,7 +6,7 @@ MAINTAINER ome-devel@lists.openmicroscopy.org.uk ARG OMEROVER=latest ARG JAVAVER=openjdk11 ARG ICEVER=ice36 -ARG PGVER=pg13 +ARG PGVER=pg15 RUN touch /.dockerenv ADD omero-install-test.zip / From c0f998ab53d89f7a0d1a43c31e921a1a112fdc89 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Tue, 3 Oct 2023 16:27:32 +0100 Subject: [PATCH 17/20] Open port --- linux/install_rocky9.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index 6ef82b8e..f9367cda 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -38,3 +38,7 @@ if [ ! -f /.dockerenv ]; then fi systemctl enable omero-server.service #end-recommended + +# open omero-server port +firewall-cmd --zone=public --add-port=4064/tcp --permanent +firewall-cmd --reload From 1c97d5fd7305a9098d52bee85b359f8c1e433c8d Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Tue, 3 Oct 2023 16:30:57 +0100 Subject: [PATCH 18/20] Check for dockerenv --- linux/install_rocky9.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index f9367cda..15e0694e 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -40,5 +40,7 @@ systemctl enable omero-server.service #end-recommended # open omero-server port -firewall-cmd --zone=public --add-port=4064/tcp --permanent -firewall-cmd --reload +if [ ! -f /.dockerenv ]; then + firewall-cmd --zone=public --add-port=4064/tcp --permanent + firewall-cmd --reload +fi \ No newline at end of file From 41ad1091d9921f55c71830ae8c9eef7335e5ff77 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 18:36:23 +0100 Subject: [PATCH 19/20] re-organise for doc --- linux/install_rocky9.sh | 15 ++------------- linux/step08_rocky9_config.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 linux/step08_rocky9_config.sh diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index 15e0694e..23eaa8fe 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -31,16 +31,5 @@ fi #If you don't want to use the systemd scripts you can start OMERO manually: #su - omero-server -c ". /home/omero-server/settings.env omero admin start" -#start-recommended -cp omero-server-systemd.service /etc/systemd/system/omero-server.service -if [ ! -f /.dockerenv ]; then - systemctl daemon-reload -fi -systemctl enable omero-server.service -#end-recommended - -# open omero-server port -if [ ! -f /.dockerenv ]; then - firewall-cmd --zone=public --add-port=4064/tcp --permanent - firewall-cmd --reload -fi \ No newline at end of file + +bash -eux step08_rocky9_config.sh diff --git a/linux/step08_rocky9_config.sh b/linux/step08_rocky9_config.sh new file mode 100644 index 00000000..48061f41 --- /dev/null +++ b/linux/step08_rocky9_config.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e -u -x + +#start-recommended +cp omero-server-systemd.service /etc/systemd/system/omero-server.service +if [ ! -f /.dockerenv ]; then + systemctl daemon-reload +fi +systemctl enable omero-server.service +#end-recommended + + +if [ ! -f /.dockerenv ]; then + #start-open-omero-server-port + firewall-cmd --zone=public --add-port=4064/tcp --permanent + firewall-cmd --reload + #end-open-omero-server-port +fi From 8cc33094bc6beb2d3afb6e206f6ce29656dde6fb Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 3 Oct 2023 18:36:43 +0100 Subject: [PATCH 20/20] use new section --- linux/autogenerate.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/linux/autogenerate.sh b/linux/autogenerate.sh index ecc6a39e..3881b257 100755 --- a/linux/autogenerate.sh +++ b/linux/autogenerate.sh @@ -322,11 +322,33 @@ echo "$line" >> $file echo "#end-step07" >> $file if [[ $OS =~ "centos" ]]; then -echo "#start-selinux" >> $file -line=$(sed -n '2,$p' $dir/setup_centos_selinux.sh) -echo "$line" >> $file -echo "#end-selinux" >> $file + echo "#start-selinux" >> $file + line=$(sed -n '2,$p' $dir/setup_centos_selinux.sh) + echo "$line" >> $file + echo "#end-selinux" >> $file +fi + +if [[ $OS =~ "rocky" ]]; then + echo "#start-step08: As root, configure" >> $file + number=$(sed -n '/#start-recommended/=' $dir/step08_rocky9_config.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-recommended/=' $dir/step08_rocky9_config.sh) + nre=$((number-1)) + line=$(sed -n ''$nrs','$nre'p' $dir/step08_rocky9_config.sh) + # remove docker conditional + line=`remove_docker_workaround "${line}"` + echo "$line" >> $file + + number=$(sed -n '/#start-open-omero-server-port/=' $dir/step08_rocky9_config.sh) + nrs=$((number+1)) + number=$(sed -n '/#end-open-omero-server-port/=' $dir/step08_rocky9_config.sh) + nre=$((number-1)) + line=$(sed -n ''$nrs','$nre'p' $dir/step08_rocky9_config.sh) + line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')" + echo "$line" >> $file + echo "#end-step08" >> $file fi + } #generate scripts for all os by default.