diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd88d27b..f3ecdfbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,11 +12,15 @@ 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 + - os: debian10 + pg: pg15 + - os: debian10 + pg: pg16 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/linux/autogenerate.sh b/linux/autogenerate.sh index d4fe6182..3881b257 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)) @@ -274,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. diff --git a/linux/install_rocky9.sh b/linux/install_rocky9.sh index 5fc76d71..23eaa8fe 100644 --- a/linux/install_rocky9.sh +++ b/linux/install_rocky9.sh @@ -3,21 +3,12 @@ set -e -u -x OMEROVER=${OMEROVER:-latest} +PGVER=${PGVER:-pg15} +JAVAVER=${JAVAVER:-openjdk11} . `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 +PGVER=$PGVER JAVAVER=$JAVAVER bash -eux step01_rocky9_deps.sh bash -eux step02_all_setup.sh @@ -41,4 +32,4 @@ 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 +bash -eux step08_rocky9_config.sh diff --git a/linux/step01_rocky9_deps.sh b/linux/step01_rocky9_deps.sh new file mode 100644 index 00000000..be61b489 --- /dev/null +++ b/linux/step01_rocky9_deps.sh @@ -0,0 +1,125 @@ +#!/bin/bash + +PGVER=${PGVER:-pg15} +JAVAVER=${JAVAVER:-openjdk11} +# General additional packages installation +#start-general +dnf -y install python unzip bzip2 wget bc openssl +#end-general + +# Java installation + +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-java + dnf -y install java-11-openjdk + #end-recommended-java +elif [ "$JAVAVER" = "openjdk11-devel" ]; then + dnf -y install java-11-openjdk-devel +fi + + +# ICE installation +#start-recommended-ice +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/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 +ldconfig +#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 + + 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 + sed -i 's/ ident/ trust/g' /var/lib/pgsql/data/pg_hba.conf + +elif [ "$PGVER" = "pg14" ]; then + 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 + 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 + + 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" + 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 + 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 + 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 + + 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 + +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-pg-start + systemctl start postgresql + systemctl enable postgresql + #end-recommended-pg-start + 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 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_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 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 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 /