Repository navigation
Add phoebus_save_restore role, with Molecule tests - #106
ralphlange wants to merge 1 commit into
Conversation
Runs the Phoebus save-and-restore service - already built by the phoebus role - as a systemd service: it stores configurations and snapshots in Elasticsearch and serves the Phoebus "Save & Restore" application through its REST API. Modelled on the phoebus_services_save_restore role of ControlSystemStudio/ansible-phoebus. - pulls in the elasticsearch role; enabling it also runs the phoebus role and installs graphics - REST API on port 8080, context path /save-restore (the Phoebus client default): save_restore_url, a role default; the phoebus role uses the same name for the client's jmasar.service.url preference (replacing the hardcoded epics-services-tst URL), so one setting configures both; the role checks that the URL is http:// with an explicit port >= 1024 (the service runs unprivileged), a trailing slash is ignored - overrides of the packaged application.properties in /etc/save-and-restore/save-and-restore.properties: Elasticsearch, port, Spring logging at INFO, built-in demo users for authentication (instead of upstream's site-specific Active Directory) - EPICS access for server-side snapshots/restores as documented for the service (which does not read the client's preferences): the wrapper sets -Djca.use_env=true and -DdefaultProtocol (save_restore_default_protocol, default ca), EPICS_* environment variables go into save_restore_epics_env (default: none, i.e. the EPICS defaults) - /usr/local/bin/save-and-restore wrapper (no procServ); after starting, the role waits for the REST API to report Elasticsearch as connected and asserts the service is running - enabled in everything.yml and ci-phoebus-aa.yml (QEMU role tests) Molecule scenario on the systemd platform (x86_64 and aarch64) that builds Phoebus and tests the service end to end through its REST API: it creates a folder and a configuration with a local PV, lets the service take and save a snapshot, and reads it back, finds it by search and in Elasticsearch; it also checks that the EPICS settings reach the service process. Described in the scenario's README. Developed with the assistance of generative AI.
There was a problem hiding this comment.
@ralphlange, default port (8080) is the same for alarm logger and save-n-restore. For both services one can override this with JVM option -Dserver.port=<my favourite port>.
|
The question is: what should we use on the Training-VM? I would like to have stable (different) ports for the two services on the VM to avoid having to resolve the conflict every time. |
|
If the training VM controls both services and Phoebus (including settings file) any port strategy would be "stable" by design. Or am missing something? |
|
True. |
|
How about:
As for archiver... @jacomago might want to have a saying. |
|
Archiver is silly with default of 17665 for mgmt 17668 for retrieval. Not best, but is historical ports. |
|
Ok, also, |
Already mentioned in one of the other tickets: |
|
Ok |
|
Molecule tests? But that's a discussion for that repository, not this. |
Runs the Phoebus save-and-restore service - already built by the phoebus
role - as a systemd service: it stores configurations and snapshots in
Elasticsearch and serves the Phoebus "Save & Restore" application through
its REST API. Modelled on the phoebus_services_save_restore role of
ControlSystemStudio/ansible-phoebus.
and installs graphics
default): save_restore_url, a role default; the phoebus role uses the
same name for the client's jmasar.service.url preference (replacing the
hardcoded epics-services-tst URL), so one setting configures both;
the role checks that the URL is http:// with an explicit port >= 1024
(the service runs unprivileged), a trailing slash is ignored
/etc/save-and-restore/save-and-restore.properties: Elasticsearch,
port, Spring logging at INFO, built-in demo users for authentication
(instead of upstream's site-specific Active Directory)
service (which does not read the client's preferences): the wrapper
sets -Djca.use_env=true and -DdefaultProtocol
(save_restore_default_protocol, default ca), EPICS_* environment
variables go into save_restore_epics_env (default: none, i.e. the
EPICS defaults)
the role waits for the REST API to report Elasticsearch as connected
and asserts the service is running
Molecule scenario on the systemd platform (x86_64 and aarch64) that
builds Phoebus and tests the service end to end through its REST API:
it creates a folder and a configuration with a local PV, lets the
service take and save a snapshot, and reads it back, finds it by search
and in Elasticsearch; it also checks that the EPICS settings reach the
service process. Described in the scenario's README.
Developed with the assistance of generative AI.