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

Ubuntu2404 support #98

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu2004, ubuntu2204, rockylinux9]
os: [ubuntu2204, ubuntu2404, rockylinux9]
websession: [true, false]
webprefix: ["", "/omero"]
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up
run: ./.travis/before_install.sh
env:
Expand Down
51 changes: 51 additions & 0 deletions ansible/group_vars/ubuntu2404-ice3.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# INTERNAL CONFIG DON'T CHANGE

path: "{{ playbook_dir }}"
clean:
os: ubuntu2404
ice_version: "3.6"
python_version: "3.12"

doc: False
doc_conf:
note: ".. walkthroughs are generated using ansible, see \n.. https://github.com/ome/omeroweb-install\n"
header: "OMERO.web installation on Ubuntu 24.04 and IcePy 3.6\n====================================================\n"
link_install: "Please first read :doc:`../../server-ubuntu2404-ice36`.\n"
os_full_name: Ubuntu2204
prerequisites: "Installing prerequisites\n------------------------\n"
virtual_env: "Creating a virtual environment\n------------------------------\n"
web_install: "Installing OMERO.web\n--------------------\n"
webapps_install: "Installing OMERO.web apps\n-------------------------\n"
web_configuration: "Configuring OMERO.web\n---------------------\n"
gunicorn_configuration: "Configuring Gunicorn\n--------------------\n"
cors_configuration: "Setting up CORS\n---------------\n"
standalone_web: "Running OMERO.web\n-----------------\n"
nginx_configuration: "Configuring NGINX\n-----------------\n"
sel: "SELinux\n-------\n"
web_run: "Automatically running OMERO.web\n-------------------------------\n"
maintenance: "Maintaining OMERO.web\n---------------------\n"
troubleshoot: "Troubleshooting\n---------------\n"
gunicorn_configuration_advanced: "Configuring Gunicorn advanced options\n-------------------------------------\n"
sync_workers: "Experimental: Sync workers\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
async_workers: "Experimental: Async workers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"

default:
web_prefix:
web_port: 80
web_server_name: localhost

omero_user: "omero-web"
omero_user_home_dir: "/opt/omero/web"
virtualenv_path: "{{omero_user_home_dir}}/venv3"
omero_user_web_dir: "{{ omero_user_home_dir }}/omero-web"

selinux: False
daemon: True

# VARS

web_session:

web_prefix:
web_port:
web_server_name:
5 changes: 5 additions & 0 deletions ansible/hosts/ubuntu2404-ice3.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Hosts can be part of multiple hostgroups, but note that vars will be
# read for all groups that the host is a member of

[ubuntu2404-ice3.6]
localhost ansible_connection=local
2 changes: 2 additions & 0 deletions ansible/templates/rockylinux9/deps.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ set -e -u -x
cp `dirname $0`/nginx.repo /etc/yum.repos.d/
{% endif %}

dnf -y install git

dnf -y install unzip

dnf -y install python3
Expand Down
2 changes: 2 additions & 0 deletions ansible/templates/ubuntu2004/deps.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/01norecommends \

apt-get update


apt-get -y install git
apt-get -y install unzip
apt-get -y install python3
apt-get -y install python3-venv
Expand Down
1 change: 1 addition & 0 deletions ansible/templates/ubuntu2204/deps.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/01norecommends \
{% endif %}

apt-get update
apt-get -y install git

apt-get -y install unzip
apt-get -y install python3
Expand Down
23 changes: 23 additions & 0 deletions ansible/templates/ubuntu2404/daemon.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if doc %}
Copy the `init.d` file, then configure the service::
{% else %}
#!/bin/bash

set -e -u -x
{% endif %}

{% if doc %}
cp omero-web-init.d /etc/init.d/omero-web
{% else %}
cp `dirname $0`/omero-web-init.d /etc/init.d/omero-web
{% endif %}
chmod a+x /etc/init.d/omero-web

update-rc.d -f omero-web remove
update-rc.d -f omero-web defaults 98 02

{% if not doc %}
if [ ! "${container:-}" = docker ]; then
`dirname $0`/run
fi
{% endif %}
19 changes: 19 additions & 0 deletions ansible/templates/ubuntu2404/deps.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% if doc %}
Install dependencies::
{% else %}
#!/bin/bash

set -e -u -x
echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/01norecommends \
&& echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends

{% endif %}

apt-get update

apt-get -y install git
apt-get -y install unzip
apt-get -y install python3
apt-get -y install python3-venv

apt-get -y install nginx
11 changes: 11 additions & 0 deletions ansible/templates/ubuntu2404/deps_ice3.6.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if doc %}
Install ZeroC IcePy {{ ice_version }}::

{% else %}
#!/bin/bash

set -e -u -x

# ZeroC Ice 3.6
{% endif %}
{{ virtualenv_path }}/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
17 changes: 17 additions & 0 deletions ansible/templates/ubuntu2404/deps_web_session.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if doc %}
*Optional*: if you wish to use the Redis cache, install Redis::
{% else %}
#!/bin/bash

set -e -u -x
{% endif %}

apt-get -y install redis-server

{% if doc %}
service redis-server start
{% else %}
if [ ! "${container:-}" = docker ]; then
service redis-server restart
fi
{% endif %}
20 changes: 20 additions & 0 deletions ansible/templates/ubuntu2404/nginx.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% if doc %}
Copy the generated configuration file into the NGINX configuration directory, disable the default configuration and start NGINX::
{% else %}
#!/bin/bash

set -e -u -x
{% endif %}

sed -i.bak -re 's/( default_server.*)/; #\1/' /etc/nginx/nginx.conf
rm /etc/nginx/sites-enabled/default
cp {{ omero_user_web_dir }}/nginx.conf.tmp /etc/nginx/conf.d/omeroweb.conf

{% if doc %}
service nginx start
{% else %}
if [ ! "${container:-}" = docker ]; then
service nginx restart
fi
{% endif %}

76 changes: 76 additions & 0 deletions ansible/templates/ubuntu2404/omero-web-init.d.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{% if doc %}
Should you wish to run OMERO.web automatically, a `init.d` file could be created. See below an example file `omero-web-init.d`::

{% endif %}
#!/bin/bash
#
# /etc/init.d/omero-web
# Subsystem file for "omero" web
#
### BEGIN INIT INFO
# Provides: omero-web
# Required-Start: $local_fs $remote_fs $network $time omero
# Required-Stop: $local_fs $remote_fs $network $time omero
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OMERO.web
### END INIT INFO
#
### Redhat
# chkconfig: - 98 02
# description: init file for OMERO.web
###

RETVAL=0
prog=omero-web

# Read configuration variable file if it is present
[ -r /etc/default/$prog ] && . /etc/default/$prog

OMERO_USER=${OMERO_USER:-{{ omero_user }}}
OMERO={{ virtualenv_path }}/bin/omero
OMERODIR={{ omero_user_web_dir }}
VENVDIR=${VENVDIR:-{{ virtualenv_path }}}

start() {
echo -n $"Starting $prog:"
su - ${OMERO_USER} -c ". ${VENVDIR}/bin/activate;OMERODIR=${OMERODIR} ${OMERO} web start" &> /dev/null && echo -n ' OMERO.web'
sleep 5
RETVAL=$?
[ "$RETVAL" = 0 ]
echo
}

stop() {
echo -n $"Stopping $prog:"
su - ${OMERO_USER} -c ". ${VENVDIR}/bin/activate;OMERODIR=${OMERODIR} ${OMERO} web stop" &> /dev/null && echo -n ' OMERO.web'
RETVAL=$?
[ "$RETVAL" = 0 ]
echo
}

status() {
echo -n $"Status $prog:"
su - ${OMERO_USER} -c ". ${VENVDIR}/bin/activate;OMERODIR=${OMERODIR} ${OMERO} web status"
RETVAL=$?
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
21 changes: 21 additions & 0 deletions ansible/templates/ubuntu2404/run.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if doc %}
Start up services::
{% else %}
#!/bin/bash

set -e -u -x
{% endif %}

{% if web_session %}
service redis-server start
{% endif %}

{% if not doc %}
#service crond start # Doesn't work in Docker
{% endif %}
cron
service nginx start
service omero-web restart
{% if not doc %}
exec bash
{% endif %}
34 changes: 34 additions & 0 deletions test/Dockerfile_ubuntu2404
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile for testing the OMERO Linux installation instructions
# Not intended for production use
FROM ubuntu:24.04
LABEL author="[email protected]"

# RUN update-locale LANG=C.UTF-8
ENV LANG C.UTF-8

ADD ./omeroweb-install-test.zip /tmp
RUN apt-get update && apt-get -y install unzip cron
RUN unzip /tmp/omeroweb-install-test.zip -d /tmp


# This is so that scripts can detect whether they're in docker
RUN echo 'export container=docker' > /etc/profile.d/docker.sh

ARG ICEVER=3.6
ARG WEBPORT=80
ARG WEBPREFIX
ARG WEBSESSION
ARG WEBSERVER_CONF
ARG WEBSERVER_NAME
ARG PYTHONVER

RUN ICEVER=$ICEVER \
WEBPORT=$WEBPORT WEBPREFIX=$WEBPREFIX WEBSESSION=$WEBSESSION \
WEBSERVER_CONF=$WEBSERVER_CONF WEBSERVER_NAME=$WEBSERVER_NAME \
PYTHONVER=$PYTHONVER \
/tmp/omeroweb-install-test/omeroweb-install-ubuntu2404-ice${ICEVER}

EXPOSE 22 80

ENV RUNPATH="/tmp/omeroweb-install-test/ubuntu2204-ice${ICEVER}/run"
CMD ["/bin/bash", "-c", "-e", "$RUNPATH"]