Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocky linux 9 #274

Merged
merged 15 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [debian10, ubuntu1804, ubuntu2004, ubuntu2204]
os: [rockylinux9, debian10, ubuntu1804, ubuntu2004, ubuntu2204]
pg: [pg13, pg14]
exclude:
- os: ubuntu2204
pg: pg13
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Install shunit2
run: sudo apt-get install -y shunit2
- name: Build walkthroughs
Expand All @@ -30,7 +30,7 @@ jobs:
run: |
cd linux/test
PGVER=$PGVER ./docker-build.sh $ENV
./test_services.sh
./test_services.sh
env:
ENV: ${{ matrix.os }}
PGVER: ${{ matrix.pg }}
28 changes: 19 additions & 9 deletions linux/autogenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ dir=`dirname $0`
remove_docker_workaround () {
l="$(echo -e "${@}" | sed -e 's/^[[:space:]]*//')"
l="$(echo -e "${l}" | sed -e 's/^if.*!.*then//' )"
l="$(echo -e "${l}" | sed -e '/^if.*container.*then/,/else/d' )"
l="$(echo -e "${l}" | sed -e '/^if.*docker.*then/,/else/d' )"
l="$(echo -e "${l}" | sed -e 's/^fi//')"
echo "${l}"
}

#generate the walkthrough for all supported os
function generate_all() {
values=(centos7 debian10 ubuntu1804 ubuntu2004 ubuntu2204)
values=(centos7 debian10 ubuntu1804 ubuntu2004 ubuntu2204 rocky9)
for os in "${values[@]}"; do
echo "${os}"
generate ${os}
Expand All @@ -36,6 +36,8 @@ EOF
N=$OS
if [[ $OS =~ "debian" ]] || [[ $OS =~ "ubuntu" ]] ; then
N="ubuntu"
elif [[ $OS =~ "rocky" ]] ; then
N="centos7"
elif [[ $OS =~ "centos" ]] ; then
N="centos7"
fi
Expand All @@ -48,6 +50,8 @@ 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
Expand All @@ -70,6 +74,8 @@ 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)
Expand All @@ -95,23 +101,26 @@ echo -en '\n' >> $file

# install postgres
N=$OS
if [[ $OS =~ "rocky" ]] ; then
N="centos"
fi
echo -en '\n' >> $file
echo "# install Postgres" >> $file
if [[ $OS =~ "centos" ]] ; then
number=$(sed -n '/#start-postgresql-installation-general/=' $dir/step01_"$N"_pg_deps.sh)
if [[ $N =~ "centos" ]] ; then
number=$(sed -n '/#start-postgresql-installation-general/=' $dir/step01_"$OS"_pg_deps.sh)
nrs=$((number+1))
number=$(sed -n '/#end-postgresql-installation-general/=' $dir/step01_"$N"_pg_deps.sh)
number=$(sed -n '/#end-postgresql-installation-general/=' $dir/step01_"$OS"_pg_deps.sh)
nre=$((number-1))
line=$(sed -n ''$nrs','$nre'p' $dir/step01_"$N"_pg_deps.sh)
line=$(sed -n ''$nrs','$nre'p' $dir/step01_"$OS"_pg_deps.sh)
line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')"

echo "$line" >> $file

number=$(sed -n '/#start-recommended/=' $dir/step01_"$N"_pg_deps.sh)
number=$(sed -n '/#start-recommended/=' $dir/step01_"$OS"_pg_deps.sh)
nrs=$((number+1))
number=$(sed -n '/#end-recommended/=' $dir/step01_"$N"_pg_deps.sh)
number=$(sed -n '/#end-recommended/=' $dir/step01_"$OS"_pg_deps.sh)
nre=$((number-1))
line=$(sed -n ''$nrs','$nre'p' $dir/step01_"$N"_pg_deps.sh)
line=$(sed -n ''$nrs','$nre'p' $dir/step01_"$OS"_pg_deps.sh)
# remove docker conditional
line=`remove_docker_workaround "${line}"`
else
Expand All @@ -121,6 +130,7 @@ else
ne=$((number-1))
line=$(sed -n ''$ns','$ne'p' $dir/step01_"$N"_pg_deps.sh)
fi
N=$OS
# remove leading whitespace
line="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//')"

Expand Down
44 changes: 44 additions & 0 deletions linux/install_rocky9.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

set -e -u -x

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 step02_all_setup.sh

bash -eux step03_all_postgres.sh

bash -eux step01_rocky9_ice_venv.sh

# Those steps are valid if an omero-server user exists
# This might not be the case when used in the context of devspace
if [ "$(getent passwd omero-server)" ]; then
cp settings.env step04_all_omero.sh setup_omero_db.sh ~omero-server

OMEROVER=$OMEROVER bash -eux step04_all_omero_install.sh

su - omero-server -c " bash -eux step04_all_omero.sh"

su - omero-server -c "bash setup_omero_db.sh"
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
4 changes: 3 additions & 1 deletion linux/settings.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export OMERODIR=/opt/omero/server/OMERO.server
# Location of the virtual environment for omero-py
VENV_SERVER=/opt/omero/server/venv3

export PATH=$VENV_SERVER/bin:$PATH
export ICE_HOME=/opt/ice-3.6.5

export PATH=$ICE_HOME/bin:$VENV_SERVER/bin:$PATH
13 changes: 13 additions & 0 deletions linux/step01_rocky9_ice_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/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
18 changes: 18 additions & 0 deletions linux/step01_rocky9_ice_venv.sh
Original file line number Diff line number Diff line change
@@ -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/sbesson/zeroc-ice-py-rockylinux9-x86_64/releases/download/20230719/zeroc_ice-3.6.5-cp39-cp39-linux_x86_64.whl

# Install server dependencies
$VENV_SERVER/bin/pip install omero-server
#end-ice-py
28 changes: 28 additions & 0 deletions linux/step01_rocky9_pg_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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
19 changes: 8 additions & 11 deletions linux/step04_all_omero_install.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
#!/bin/bash
OMEROVER=${OMEROVER:-latest}
ICEVER=${ICEVER:-ice36}

set -eux

. `dirname $0`/settings.env


#start-install
if [ "$ICEVER" = "ice36" ] || [ "$ICEVER" = "ice36-devel" ]; then
if [ $OMEROVER == "latest" ]; then
#start-release-ice36
cd /opt/omero/server
SERVER=https://downloads.openmicroscopy.org/omero/5.6/server-ice36.zip
wget -q $SERVER -O OMERO.server-ice36.zip
unzip -q OMERO.server*
#end-release-ice36
rm OMERO.server-ice36.zip
fi
if [ $OMEROVER == "latest" ]; then
#start-release-ice36
cd /opt/omero/server
SERVER=https://downloads.openmicroscopy.org/omero/5.6/server-ice36.zip
wget -q $SERVER -O OMERO.server-ice36.zip
unzip -q OMERO.server*
#end-release-ice36
rm OMERO.server-ice36.zip
fi

#start-link
Expand Down
2 changes: 1 addition & 1 deletion linux/step06_centos7_daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#start-recommended
cp omero-server-systemd.service /etc/systemd/system/omero-server.service
if [ ! "${container:-}" = docker ]; then
if [ ! -f /.dockerenv ]; then
systemctl daemon-reload
fi
systemctl enable omero-server.service
Expand Down
21 changes: 21 additions & 0 deletions linux/test/rockylinux9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dockerfile for testing the OMERO Linux installation instructions
# Not intended for production use
FROM rockylinux:9
MAINTAINER [email protected]

ARG OMEROVER=latest
ARG JAVAVER=openjdk11
ARG ICEVER=ice36
ARG PGVER=pg13

RUN touch /.dockerenv
ADD omero-install-test.zip /
RUN dnf -y install unzip && unzip omero-install-test.zip

RUN cd omero-install-test && \
bash install_rocky9.sh

ADD run.sh /home/omero-server/run.sh

EXPOSE 80 4063 4064
CMD ["/bin/bash", "-e", "/home/omero-server/run.sh"]
11 changes: 11 additions & 0 deletions linux/test/rockylinux9/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

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"
if [ -t 1 ] ; then
exec bash
else
exec tail -F /opt/omero/server/OMERO.server/var/log/*
fi
3 changes: 0 additions & 3 deletions linux/test/test_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ docker exec $CNAME /bin/bash -c 'd=10; \
done; \
echo "Entry found"; exit'

#check OMERO.server service status
docker exec $CNAME /bin/bash -c "service omero-server status -l --no-pager"

docker exec $CNAME /bin/bash -c "su - omero-server -c \". ${SETTINGS} && omero admin diagnostics\""

# Log in to OMERO.server
Expand Down
Loading