8000 Refactor roles that build EPICS Modules by ralphlange · Pull Request #74 · epics-training/training-vm · GitHub
[go: up one dir, main page]

Skip to content

Refactor roles that build EPICS Modules - #74

Merged
ralphlange merged 5 commits into
epics-training:mainfrom
ralphlange:refactor-epics-modules
Feb 21, 2026
Merged

ralphlange merged 5 commits into
epics-training:mainfrom
ralphlange:refactor-epics-modules

Conversation

@ralphlange
Copy link
Copy Markdown
Contributor

This splits up the single epics-modules role (that had a single configuration file for all modules) into a generic role to install EPICS C/C++ modules and separate roles for the actual modules that call the generic role with their configuration. (I used 'm-' prefixes for all roles that install EPICS modules.)

Advantages:

  • EPICS modules can properly define their dependencies as role dependencies. Ansible takes care of creating a graph, flattening it and running the roles in the right order.
  • In the source tree, all module configuration is separated in per-module directories. This allows triggering CI jobs on changes in specific sets of modules.
  • This approach is a lot more "Ansible-natural" compared to keeping the configuration in a shared dictionary and having a single role do very different things. Now, tags can be used to specify sets of roles.
  • Took the opportunity to improve a few small things and add more documentation.

@gilesknap, @simon-ess: Rebasing #71 on this will allow fine-tuned runs of CI jobs depending on which modules were changed and also eventually allow to only recreate the container images when actually required.

Disclaimer: The first step (splitting the role into per-module roles) was the result of a 2.5-hour session with Jules (Google's coding agent). Not bad, but needed quite a bit of fine-tuning.

- Create internal generic role 'epics-module' for building EPICS modules
- Document 'epics-module' usage
- Create high-level roles with proper dependencies:
  m-base, m-p4p, m-pvaPy, m-seq, m-asyn, m-autosave, m-areadetector,
  m-opcua, m-stream
- Move all module configuration and hooks
  to their respective high-level roles
- Fix 'p4p', 'adcore', 'base', 'stream' and 'opcua' prep hooks
  to ensure destination directories exist
- Add retries to 'get_url' in 'epics-module' to handle network hickups
- Add 'set_fact' guards to all high-level roles to prevent multiple executions
- Use 'regexp' instead of 'search_string' in lineinfile
  (compatibility with older Ansible versions)
- Ensure all prep hooks create necessary directories before use
- Make 'epics-module' respect 'skip' attribute in module configurations
- Add distribution-specific skip logic
  for incompatible modules (ADCore, pvaPy)
  on modern OS releases (Fedora, Rocky 9, Ubuntu 24.04)

Co-authored-by: google-labs-jules[bot]
- use fact as 'rebuild all modules' flag
- use block around compiling from sources
- also remove autosave and asyn from top-level roles
@ralphlange
ralphlange requested a review from simon-ess February 9, 2026 16:21
@ralphlange
ralphlange merged commit 8498763 into epics-training:main Feb 21, 2026
@ralphlange
ralphlange deleted the refactor-epics-modules branch February 21, 2026 17:08
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.

1 participant

0