From 1b42c86dbe02a7e987445f00550b89ac3418f67a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 4 Nov 2024 19:20:50 +0000 Subject: [PATCH 1/6] Add installation instruction for Ubuntu 24.04 --- linux/install_ubuntu2404.sh | 52 +++++++++++++++++++++++++++++ linux/step01_ubuntu2404_ice_deps.sh | 27 +++++++++++++++ linux/step01_ubuntu2404_ice_venv.sh | 18 ++++++++++ linux/step01_ubuntu2404_pg_deps.sh | 25 ++++++++++++++ linux/test/ubuntu2404/Dockerfile | 28 ++++++++++++++++ linux/test/ubuntu2404/run.sh | 12 +++++++ 6 files changed, 162 insertions(+) create mode 100644 linux/install_ubuntu2404.sh create mode 100644 linux/step01_ubuntu2404_ice_deps.sh create mode 100644 linux/step01_ubuntu2404_ice_venv.sh create mode 100644 linux/step01_ubuntu2404_pg_deps.sh create mode 100644 linux/test/ubuntu2404/Dockerfile create mode 100644 linux/test/ubuntu2404/run.sh diff --git a/linux/install_ubuntu2404.sh b/linux/install_ubuntu2404.sh new file mode 100644 index 00000000..6926b080 --- /dev/null +++ b/linux/install_ubuntu2404.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e -u -x + +OMEROVER=${OMEROVER:-latest} +PGVER=${PGVER:-pg15} +ICEVER=${ICEVER:-ice36} + +. settings.env + +bash -eux step01_ubuntu_init.sh + +# disable daemon restart pop-up: +# see https://stackoverflow.com/questions/73397110/how-to-stop-ubuntu-pop-up-daemons-using-outdated-libraries-when-using-apt-to-i +if [ ! -f /.dockerenv ]; then + echo "\$nrconf{restart} = 'a';" >> /etc/needrestart/needrestart.conf +fi + +# install java +bash -eux step01_ubuntu_java_deps.sh + +bash -eux step01_ubuntu_deps.sh + +# install ice +bash -eux step01_ubuntu2404_ice_deps.sh + +cat omero-ice36.env >> /etc/profile + +# install Postgres +bash -eux step01_ubuntu2404_pg_deps.sh + +bash -eux step02_all_setup.sh + +bash -eux step03_all_postgres.sh + +cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero-server + +bash -eux step01_ubuntu2404_ice_venv.sh +bash -eux step04_all_omero_install.sh + +su - omero-server -c "OMEROVER=$OMEROVER ICEVER=$ICEVER bash -eux step04_all_omero.sh" +su - omero-server -c "bash setup_omero_db.sh" + + +#If you don't want to use the init.d scripts you can start OMERO manually: +#su - omero-server -c ". /home/omero-server/settings.env omero admin start" + +bash -eux step06_ubuntu_daemon.sh + +bash -eux step07_all_perms.sh + +#service omero start diff --git a/linux/step01_ubuntu2404_ice_deps.sh b/linux/step01_ubuntu2404_ice_deps.sh new file mode 100644 index 00000000..84c4b9ea --- /dev/null +++ b/linux/step01_ubuntu2404_ice_deps.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +ICEVER=${ICEVER:-ice36} + +echo $ICEVER +# Ice installation +if [ "$ICEVER" = "ice36" ]; then + #start-recommended + apt-get update && \ + apt-get install -y -q \ + db5.3-util \ + bzip2 \ + libdb++ \ + libexpat1 \ + libmcpp0 \ + openssl \ + mcpp \ + zlib1g + + cd /tmp + wget -q https://github.com/glencoesoftware/zeroc-ice-ubuntu2404-x86_64/releases/download/20240619/Ice-3.6.5-ubuntu2404-x86_64.tar.gz + tar xf Ice-3.6.5-ubuntu2404-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 +fi diff --git a/linux/step01_ubuntu2404_ice_venv.sh b/linux/step01_ubuntu2404_ice_venv.sh new file mode 100644 index 00000000..2403f35b --- /dev/null +++ b/linux/step01_ubuntu2404_ice_venv.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e -u -x + +VENV_SERVER=${VENV_SERVER:-/opt/omero/server/venv3} +#start-ice-py +# Create a virtual env +python3 -mvenv $VENV_SERVER + +# Upgrade pip +$VENV_SERVER/bin/pip install --upgrade pip + +# Install the Ice Python binding +$VENV_SERVER/bin/pip install https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp312-cp312-manylinux_2_28_x86_64.whl + +# Install server dependencies +$VENV_SERVER/bin/pip install omero-server +#end-ice-py diff --git a/linux/step01_ubuntu2404_pg_deps.sh b/linux/step01_ubuntu2404_pg_deps.sh new file mode 100644 index 00000000..9f89a525 --- /dev/null +++ b/linux/step01_ubuntu2404_pg_deps.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PGVER=${PGVER:-pg15} + +if [ "$PGVER" = "pg14" ]; then + apt-get update + apt-get -y install postgresql + service postgresql start +elif [ "$PGVER" = "pg15" ]; then + #start-recommended + apt-get install -y gnupg + echo "deb http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /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-15 + service postgresql start + #end-recommended +elif [ "$PGVER" = "pg16" ]; then + apt-get install -y gnupg + echo "deb http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /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-16 + service postgresql start +fi diff --git a/linux/test/ubuntu2404/Dockerfile b/linux/test/ubuntu2404/Dockerfile new file mode 100644 index 00000000..999be54c --- /dev/null +++ b/linux/test/ubuntu2404/Dockerfile @@ -0,0 +1,28 @@ +# Dockerfile for testing the OMERO Linux installation instructions +# Not intended for production use +FROM ubuntu:24.04 +MAINTAINER ome-devel@lists.openmicroscopy.org.uk + +ARG OMEROVER=latest +ARG JAVAVER=openjdk11 +ARG ICEVER=ice36 +ARG PGVER=pg14 + +RUN touch /.dockerenv + +ENV TZ=Europe/London +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/01norecommends \ + && echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends + +ADD omero-install-test.zip / +RUN apt-get update && apt-get -y install unzip && unzip omero-install-test.zip + +RUN cd omero-install-test && \ + bash install_ubuntu2404.sh && \ + bash docker_shutdown_ubuntu.sh +ADD run.sh /home/omero-server/run.sh + +EXPOSE 80 4063 4064 +CMD ["/bin/bash", "-e", "/home/omero-server/run.sh"] diff --git a/linux/test/ubuntu2404/run.sh b/linux/test/ubuntu2404/run.sh new file mode 100644 index 00000000..686f75b6 --- /dev/null +++ b/linux/test/ubuntu2404/run.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +service postgresql start + +#service crond start # Doesn't work in Docker +cron +service omero-server start +if [ -t 1 ] ; then + exec bash +else + exec tail -F /opt/omero/server/OMERO.server/var/log/* +fi From 4759f3837aa558dd7eefc000e6bc8cd9855b92d0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 4 Nov 2024 19:26:54 +0000 Subject: [PATCH 2/6] Modify psql installation --- linux/step01_ubuntu2404_pg_deps.sh | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/linux/step01_ubuntu2404_pg_deps.sh b/linux/step01_ubuntu2404_pg_deps.sh index 9f89a525..7b2bf9bc 100644 --- a/linux/step01_ubuntu2404_pg_deps.sh +++ b/linux/step01_ubuntu2404_pg_deps.sh @@ -1,25 +1,8 @@ #!/bin/bash -PGVER=${PGVER:-pg15} - -if [ "$PGVER" = "pg14" ]; then - apt-get update - apt-get -y install postgresql - service postgresql start -elif [ "$PGVER" = "pg15" ]; then - #start-recommended - apt-get install -y gnupg - echo "deb http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /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-15 - service postgresql start - #end-recommended -elif [ "$PGVER" = "pg16" ]; then - apt-get install -y gnupg - echo "deb http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /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-16 - service postgresql start -fi +PGVER=${PGVER:-pg16} +#start-recommended +apt-get update +apt-get -y install postgresql +service postgresql start +#end-recommended \ No newline at end of file From b4daa70e0ca3f068a2295c30864771a7e4c2bef4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 4 Nov 2024 19:27:20 +0000 Subject: [PATCH 3/6] Add ubuntu 24.04 to the testing matrix --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 630b7c33..7b68cf79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,11 +12,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - os: [rockylinux9, ubuntu2204] + os: [rockylinux9, ubuntu2204, ubuntu2404] pg: [pg13, pg14, pg15, pg16] exclude: - os: ubuntu2204 pg: pg13 + - os: ubuntu2404 + pg: pg13 + - os: ubuntu2404 + pg: pg14 + - os: ubuntu2504 + pg: pg15 steps: - name: Checkout uses: actions/checkout@v4 From 1211bb80c0dd1ed1131cdf1473c14a60aa08188c Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 4 Nov 2024 19:28:52 +0000 Subject: [PATCH 4/6] Fix typo in exclusion --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b68cf79..a41bdb38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: pg: pg13 - os: ubuntu2404 pg: pg14 - - os: ubuntu2504 + - os: ubuntu2404 pg: pg15 steps: - name: Checkout From 2da6a0ee764ccba5b71f944f2079c0ffc74328c7 Mon Sep 17 00:00:00 2001 From: jean-marie burel Date: Mon, 4 Nov 2024 19:55:59 +0000 Subject: [PATCH 5/6] Add missing line --- linux/step01_ubuntu2404_pg_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/step01_ubuntu2404_pg_deps.sh b/linux/step01_ubuntu2404_pg_deps.sh index 7b2bf9bc..d8f780a5 100644 --- a/linux/step01_ubuntu2404_pg_deps.sh +++ b/linux/step01_ubuntu2404_pg_deps.sh @@ -5,4 +5,4 @@ PGVER=${PGVER:-pg16} apt-get update apt-get -y install postgresql service postgresql start -#end-recommended \ No newline at end of file +#end-recommended From 7caaca49370a01e43673672950563ca67bc77038 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 5 Nov 2024 11:57:33 +0000 Subject: [PATCH 6/6] Generate doc for ubuntu 24.04 --- linux/autogenerate.sh | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/linux/autogenerate.sh b/linux/autogenerate.sh index cdd5562c..f51c4056 100755 --- a/linux/autogenerate.sh +++ b/linux/autogenerate.sh @@ -14,7 +14,7 @@ echo "${l}" #generate the walkthrough for all supported os function generate_all() { - values=(ubuntu2004 ubuntu2204 rocky9) + values=(ubuntu2004 ubuntu2204 ubuntu2404 rocky9) for os in "${values[@]}"; do echo "${os}" generate ${os} @@ -47,12 +47,6 @@ if ! [[ $OS =~ "rocky" ]] ; then fi # install java -N=$OS -if [[ $OS =~ "ubuntu1804" ]] ; then - N="ubuntu1804" -elif [[ $OS =~ "ubuntu" ]] ; then - N="ubuntu" -fi echo -en '\n' >> $file echo "# install Java" >> $file if [[ $OS =~ "rocky" ]] ; then @@ -62,11 +56,11 @@ if [[ $OS =~ "rocky" ]] ; then 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) + number=$(sed -n '/#start-recommended/=' $dir/step01_ubuntu_java_deps.sh) ns=$((number+1)) - number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_java_deps.sh) + number=$(sed -n '/#end-recommended/=' $dir/step01_ubuntu_java_deps.sh) ne=$((number-1)) - line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_java_deps.sh) + line=$(sed -n ''$ns','$ne'p' $dir/step01_ubuntu_java_deps.sh) fi # remove leading whitespace @@ -77,9 +71,6 @@ echo -en '\n' >> $file echo "# install dependencies" >> $file # install dependencies N=$OS -if [[ $OS =~ "ubuntu" ]] ; then - N="ubuntu1804" -fi if [[ $OS =~ "rocky" ]] ; then number=$(sed -n '/#start-general/=' $dir/step01_rocky9_deps.sh) @@ -88,7 +79,7 @@ if [[ $OS =~ "rocky" ]] ; then 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) + line=$(sed -n '2,$p' $dir/step01_ubuntu_deps.sh) fi echo "$line" >> $file