Repository navigation
Add Olog electronic logbook: mongodb, phoebus_olog and phoebus_olog_webclient roles - #104
Open
ralphlange wants to merge 3 commits into
Open
ralphlange wants to merge 3 commits into
ralphlange wants to merge 3 commits into
Conversation
MongoDB (single node, localhost only, no authentication) as a systemd service - the attachment storage of Olog. Modelled on phoebus_services_mongodb of ControlSystemStudio/ansible-phoebus (service root under /opt/epics-tools/services/mongodb with data/ and logs/), but installed from MongoDB's generic release archive: - MongoDB 8.0.38, verified against the published .sha256 - Ubuntu builds on the Debian family (Debian has no aarch64 build), RHEL 9.3 builds on Rocky 9 and Fedora, RHEL 10 builds on EL10 - arch.mongodb token in vars/arch - WiredTiger cache limited to 0.25 GB - after starting, the role waits for the port and asserts the service is running (with journal/log diagnostics on failure) Molecule scenario on the systemd platform (x86_64 and aarch64): service state, localhost-only listener, unprivileged user, server version, and a "hello" command sent with a minimal wire protocol client; described in the scenario's README. Developed with the assistance of generative AI.
Runs the Olog electronic logbook service as a systemd service, modelled on phoebus_services_phoebus_olog of ansible-phoebus. - download the Olog v6.0.3 release tar and build it with Maven (from the phoebus role; log entries go to Elasticsearch (elasticsearch role), attachments to MongoDB (mongodb role), add both dependencies - plain HTTP on port 4180 (olog_url, shared with the client preferences), HTTPS with Olog's self-signed certificate on 4181 - same ports as ansible-phoebus - in-memory authentication: built-in accounts user/userPass and admin/adminPass (instead of ansible-phoebus' Active Directory) - /opt/epics-tools/config/olog.properties only holds overrides (spring.config.additional-location); CORS allows the web client's origin (olog_webclient_url) - /usr/local/bin/olog wrapper; after starting, the role waits for the REST API to report Elasticsearch as connected and asserts the service running - when enabled, the phoebus role configures the Phoebus logbook to use Olog (olog-es factory, default logbook "operations") - enabled in everything.yml and ci-phoebus-aa.yml (QEMU role tests) Molecule scenario on the systemd platform (x86_64 and aarch64) that builds Olog and tests it end to end through the REST API: service info with both backends, HTTPS port, default logbooks, authentication, login with the built-in accounts, and a log entry with an attachment created multipart (as the clients do), found by a text search and read back from MongoDB; described in the scenario's README. Developed with the assistance of generative AI.
Builds the Olog web client and serves it as a systemd service, modelled on phoebus_services_phoebus_olog_webclient of ansible-phoebus. - build service once (not at every service start) - Node.js 22 LTS (Vite 7 needs >= 22.12) from the nodejs.org release archive, verified against SHASUMS256.txt; arch.nodejs token in vars/arch - web client v2.8.0 from its release tar; the Olog URLs (olog_url) are compiled into the build through .env.production.local, so changing them triggers a rebuild - served by "serve" (single page application fallback) on port 3000 (olog_webclient_url), as an unprivileged user; after starting, the role waits for the page to be served - linked on the Training-VM homepage; the Phoebus logbook gets the web client's URL (web_client_root_URL) - pulls in the phoebus_olog role - enabled in everything.yml and ci-phoebus-aa.yml (QEMU role tests) Molecule scenario on the systemd platform (x86_64 and aarch64): services, the served application and its client-side routes, the Olog URL in the build (no placeholders left), and CORS requests and a login from the web client's origin; described in the scenario's README. Developed with the assistance of generative AI.
georgweiss
reviewed
Nov 20, 2026
There was a problem hiding this comment.
Ideally I'd like to run a test, can you wait for that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the Olog electronic logbook to the Training-VM. It has three new roles: the Olog service, its MongoDB attachment storage, and the Olog web client. When the roles are enabled, the Phoebus logbook is set up to use Olog. The roles are modelled on the matching
phoebus_services_*roles of ControlSystemStudio/ansible-phoebus, adapted to this repo's conventions:/opt/epics-tools.vars/arch(x86_64 and aarch64), with no hard-coded architecture names.New roles
mongodb: MongoDB 8.0.38 as a systemd service. Single node, listening on localhost only, no authentication. Olog stores its attachments here..sha256.phoebus_olog: Olog v6.0.3 as a systemd service under an unprivilegedologuser. Log entries go to Elasticsearch and attachments to MongoDB, so the role depends onjava,elasticsearchandmongodb.phoebusrole.olog_url), HTTPS on port 4181 with Olog's self-signed certificate. These are the same ports ansible-phoebus uses.user/userPassandadmin/adminPass, instead of ansible-phoebus's Active Directory login./opt/epics-tools/config/olog.propertiesholds only the settings that differ from Olog's defaults. Cross-origin (CORS) requests from the web client's address are allowed./usr/local/bin/ologwrapper. After starting the service, the role waits until Olog's REST API reports that it is connected to Elasticsearch.phoebus_olog_webclient: Olog web client v2.8.0, also built from its release tarball. It is served on port 3000 as a systemd service under an unprivileged user, using theservepackage with fallback toindex.htmlfor the app's own page links.SHASUMS256.txt. Vite 7 needs at least 22.12.phoebus_olog.Olog and the web client keep track of the unpacked version with a marker file in their source directory. On a version change, the source directory is replaced and rebuilt from scratch, so files from two versions never mix.
Changes to existing files
phoebus: whenphoebus_ologorphoebus_olog_webclientis enabled,preferences.iniuses theolog-eslogbook witholog_urland the default logbookoperations. With the web client enabled, it also setsweb_client_root_URL. Otherwise the logbook staysinmemory.olog_urlandolog_webclient_urlhave the same names in the client and the service roles, so setting them once in a setup file configures both consistently.elasticsearch: only descriptions changed, since the role now also serves Olog.playbook.ymlandgroup_vars/all.ymlget the three roles.arch.mongodbandarch.nodejstokens are added tovars/arch/*.yml.everything.ymlandci-phoebus-aa.yml, and listed as commented-out options inlocal.yml.sample.ansible/roles/README.mddescribes the new roles.Testing
ansible/molecule/systemd), run on x86_64 and aarch64. The individual tests are listed in each role'smolecule/README.md.mongodb: service state, listening on localhost only, unprivileged user, server version, and ahellocommand sent with a small MongoDB protocol client.phoebus_olog, end to end through the REST API:phoebus_olog_webclient: the services run and the app is served, including its own page links. The build contains the Olog URL with no leftover placeholders, and cross-origin requests and a login from the web client's address work.ci-phoebus-aanow includes Olog and the web client, and changes to the new roles triggertest-roles-phoebus-aa.yml.e39ed89):Developed with the assistance of generative AI.