Files
galaxy/packages
mvdbeek ce884dc3da Elect single history-audit monitor; add standalone daemon
Every webapp process was running its own HistoryAuditMonitor (and the
per-process Postgres LISTEN that comes with it). Move to a single elected
producer via a new is_history_audit_monitor role on DatabaseHeartbeat.
The election prefers any WorkerProcess with app_type=sse_monitor, falling
back to the max-server_name webapp when no dedicated daemon is running,
so the monitor migrates cleanly when the leader dies.

Add a standalone galaxy-sse-monitor process (new lib/galaxy/sse_monitor
package, galaxy-sse-monitor console script) that builds a minimal
GalaxyManagerApplication, registers itself as sse_monitor.<host>.<pid>,
and blocks on SIGTERM. Running this daemon moves SSE event production
out of the webapp so its dispatch can't stall behind a webapp's GIL.

Gate HistoryAuditMonitor.start/stop on the role callback rather than a
postfork hook; make start() restart-safe (clear _exit) and shutdown()
idempotent so role transitions can cycle the monitor.
2026-04-28 17:20:22 +02:00
..
2025-10-29 18:45:26 +00:00
2026-04-08 14:47:07 +01:00
2026-01-19 18:39:16 +00:00
2026-04-16 15:48:34 +01:00

Package-centric Galaxy

You clone Galaxy as a Monorepo for its Python backend. This packages directory allows us to distribute smaller connected repositories out of individual Galaxy components. CI ensures these repositories have valid dependencies and such defined by running each components tests in isolation.

Development

Typically Galaxy developers develop against the monorepo but there are times when developing against a small unit of Galaxy might make sense - such as to keep an AI (or human cognitive) context as small as possible.

This can be done by treating Galaxy as a uv workspace. The pyproject.toml file in this directory defines a workspace for Galaxy and allows development and testing of individual packages with uv.

Here is an example workflow that will run tests for a specific package after setting up a virtual environment for that package.

$ git clone https://github.com/galaxyproject/galaxy.git
$ cd galaxy/packages
$ cd auth
$ uv sync --all-extras
$ uv run pytest tests

When switching between projects it is just important to remember to rerun the sync command for that project.

The package Makefile has been updated to use ux also, so the above can be simplified to just:

$ git clone https://github.com/galaxyproject/galaxy.git
$ cd galaxy/packages
$ cd auth
$ make test

If the environment has already been setup and you wish to just re-run the tests. The make _test command be used to just do the testing in the existing environment without messing with sync and adjusting dependencies.

The Makefile can also be used for typechecking.

$ git clone https://github.com/galaxyproject/galaxy.git
$ cd galaxy/packages
$ cd auth
$ make mypy
$ make _mypy  # a shortcut to just run mypy on an existing updated environment

This is equivalent to syncing the uv environment and then adding Galaxy's type checking dependencies to it.

$ uv sync --all-extras
$ uv pip install -r ../../lib/galaxy/dependencies/pinned-typecheck-requirements.txt
$ uv run mypy .

The Makefile can also be used for linting.

$ git clone https://github.com/galaxyproject/galaxy.git
$ cd galaxy/packages
$ cd auth
$ make lint
$ make _lint  # a shortcut to just run ruff on an existing updated environment

This is equivalent to syncing the uv environment and then adding Galaxy's linting dependencies to it.

$ uv sync --all-extras
$ uv pip install -r ../../lib/galaxy/dependencies/pinned-lint-requirements.txt
$ uv run ruff check .