Skip to content

Add Figure_To_Pdf script to Docker image and update workflows#104

Open
neon-ninja wants to merge 5 commits intoome:masterfrom
UoA-eResearch:master
Open

Add Figure_To_Pdf script to Docker image and update workflows#104
neon-ninja wants to merge 5 commits intoome:masterfrom
UoA-eResearch:master

Conversation

@neon-ninja
Copy link
Copy Markdown

@neon-ninja neon-ninja commented Mar 18, 2026

This pull request introduces support for the Figure_To_Pdf.py script from the OMERO Figure project, ensuring it is included in the build and verified during testing. Additionally, it enables manual workflow dispatch in GitHub Actions. The main changes are grouped below:

OMERO Figure script integration:

  • The Dockerfile now downloads the Figure_To_Pdf.py script from the specified OMERO Figure release and places it in the appropriate directory for use.
  • A new test script, test_figure_script.sh, is added to verify that Figure_To_Pdf.py is available in the OMERO scripts list.
  • The main test script, test.sh, is updated to run the new test_figure_script.sh as part of the test suite.

CI/CD improvements:

  • The GitHub Actions workflow (main.yml) is updated to support manual triggering via workflow_dispatch.

The dependencies for Figure_To_Pdf.py were already included in https://github.com/ome/omero-server-docker/pull/71/changes

Copilot AI and others added 5 commits March 18, 2026 23:26
Co-authored-by: neon-ninja <3378822+neon-ninja@users.noreply.github.com>
…list

Co-authored-by: neon-ninja <3378822+neon-ninja@users.noreply.github.com>
…ript

Add omero-figure Figure_To_Pdf.py script to Docker image
Copilot AI review requested due to automatic review settings March 18, 2026 23:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates the OMERO Figure Figure_To_Pdf.py script into the built Docker image and extends the existing smoke-test suite to verify the script is registered/visible via omero script list. It also enables manual triggering of the CI workflow.

Changes:

  • Download and install Figure_To_Pdf.py into the OMERO server scripts directory during Docker image build.
  • Add test_figure_script.sh and invoke it from test.sh to validate script availability.
  • Enable GitHub Actions manual runs via workflow_dispatch.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
Dockerfile Downloads Figure_To_Pdf.py into $OMERODIR/lib/scripts/... during image build.
test_figure_script.sh New test that checks omero script list output for Figure_To_Pdf.py.
test.sh Runs the new figure-script test as part of the smoke test suite.
.github/workflows/main.yml Adds workflow_dispatch to allow manual workflow execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

script_list=$(docker exec $PREFIX-server $OMERO -s $SERVER -u $OMERO_USER -w $OMERO_PASS script list)
echo "$script_list"

if echo "$script_list" | grep -q "Figure_To_Pdf.py"; then
OMERO=/opt/omero/server/venv3/bin/omero
SERVER="localhost:4064"

script_list=$(docker exec $PREFIX-server $OMERO -s $SERVER -u $OMERO_USER -w $OMERO_PASS script list)
Comment on lines +31 to +34
ARG OMERO_FIGURE_VERSION=v7.4.1
RUN mkdir -p $OMERODIR/lib/scripts/omero/figure_scripts && \
curl -fsSL -o $OMERODIR/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py \
https://raw.githubusercontent.com/ome/omero-figure/$OMERO_FIGURE_VERSION/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
@will-moore
Copy link
Copy Markdown
Member

Hi @neon-ninja - Thanks for the PR.
The inclusion of OMERO.figure in our docker containers has long been a bit of a pain point, due to the fact that the OMERO.figure app versions needs to match the version of the script on the server, but the docker server and docker web are quite uncoupled.
Unfortunately, there is no easy way to ensure that we have the latest OMERO.figure release in the omero-web docker (since we only rebuild it when omero-web is released, not when OMERO.figure is released) or that omero-web will connect to an omero server/docker that has the same version of the OMERO.figure script.

We have tried to improve the situation by providing a one-click button in the OMERO.figure app that allows Admins to upload the script from within the web app itself, ensuring that the server has the exact right version.
But it still requires an Admin to login to omero-web and open the Figure app.

I guess that if we always had the latest version of the script on the server, we could teach the web app to only complain (show a warning message) if the script version was older than the app version. But that would also add the burden of making sure that each new version of the script would work with older versions of the web app.
Currently the web app will show a warning if the server script version doesn't exactly match the figure app version (all in ome/omero-figure#612).

RUN dnf -y clean all
RUN rm -fr /var/cache

ARG OMERO_FIGURE_VERSION=v7.4.1
Copy link
Copy Markdown
Member

@pwalczysko pwalczysko Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @neon-ninja

Yes, but this ^^^ hard-coding will imho cause that at a next release of omero-figure (which is not dependent on releases of omero-server, neither it is dependent on releases of omero-web), for example v7.4.2, the Figure_To_Pdf.py will not be matching the latest released version of omero-figure (7.4.2 which will be the latest agains hard-coded 7.4.1). Do I get this right ?

@neon-ninja It is understandable imho to assume that when any app of omero-web (such as omero-figure) is released, then this docker image is being updated. But, in truth, this is not so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants