IOC engineer
Getting help with EPICS IOCs built with ibek: find a driver, write a beamline IOC entry, check it before deploying, start a new driver.
Il manuale dettagliato è attualmente disponibile in inglese.
Ask ARGUS (and any assistant connected to the hub’s MCP server) knows the drivers and templates of the INFN
IOC image, infn-epics-ioc. It can explain them, write a beamline IOC entry with you and check that entry
before you deploy it. It never deploys anything: what it writes is for you to review and commit.
Configure a device of a known type
- Ask, for example, “how do I add a Pfeiffer TPG 366 gauge controller at 192.168.1.20 to SPARC?”.
- The assistant searches the catalogue and opens the template (here
pfeiffer-tpg) and an example entry. - It proposes the IOC entry for
deploy/values.yaml(template,devtype,iocprefix,devices, …) and renders it the way the IOC pod will. Check that the render shows no errors. Each error is somethingibekwould stop on at pod start. - Add the entry under
epicsConfiguration.iocs, commit it, and sync the IOC’s application in ArgoCD.
Check an entry you wrote
Paste the IOC’s block, the whole name: {template: …} mapping, and ask “will this start?”. The answer
lists:
- errors: an entity type that is unknown or not compiled into the image, a missing or wrong parameter, or a reference to an object that does not exist;
- rendered_empty: the keys the template expected and did not find;
- warnings, such as a devtype that matches none of the template’s branches.
Check a whole beamline
Ask “will every ELI IOC still start?” before a new IOC image or a template change. The assistant renders
every enabled, templated IOC of the beamline as deployed, with its iocDefaults merged in. It lists the IOCs
that would fail and why. It also lists every value the chart’s merge ignores: a false, 0 or empty value in
an entry never replaces a default from iocDefaults. Ask about one IOC (“show me vgcon01 as deployed”) to see
its entry, its defaults and the values the pod receives.
The beamlines it knows are the ones its catalogue was built with. Ask “which beamlines do you know?” to see them.
Ibekize a driver that already has an IOC
If the driver already has an EPICS repository with an example st.cmd, give its address: “ibekize
https://github.com/infn-epics/my-driver”. The assistant reads the repository and writes these drafts:
install.yml, from its Makefiles;- the support definition, with a controller made from the
st.cmdport set-up and one entity per db template with its macros; - a template and a fixture.
The drafts are rendered against each other. The answer lists which values came from where, which parameters
have no example, and which st.cmd lines were copied as written. Review those, then ask for the two pull
requests.
Write a module for hardware with no EPICS support
For a device nobody has written EPICS support for, describe it: “write a module for the ACME power supply: TCP
port 4001, MEAS:CURR? returns the current, CURR <value> sets it, OUTP 0|1 switches the output; an auto-on
sequence switches the output on, then ramps to 10 A”. The assistant asks for whatever is missing, such as
replies, terminators and limits. It never invents a command. Then it writes the whole module, in the same
layout as ppt-modulator:
configure/and the Makefiles;- the driver, of one of two kinds:
- an asyn port driver in C++, which polls the readbacks and sends setpoints when they are written;
- a StreamDevice protocol, one per command;
- one SNL state program per sequence, with step, wait, retry, timeout and abort;
- the db templates, with a
<name>_RBrecord for each value the device reports and a<name>_SPrecord for each value you set; st.cmd, andst-sim.cmdfor running against a simulator of the device that answers the same commands;- the ibek files:
install.yml, the support definition, the template and a fixture.
The ibek files are rendered against each other, as every draft is. The C++ and SNL are not compiled by ARGUS.
Before connecting to hardware:
- Create the repository; ARGUS cannot.
- Run
makein the devcontainer. - Start the simulator, then the IOC with
st-sim.cmd, and try every record and sequence. - Check every command against the device’s manual.
Then ask for the two pull requests: the ibek files and the template.
Support new hardware
Ask for a new driver (“draft the ibek support for the XYZ controller, repository xyz-ioc, StreamDevice”). You get these drafts:
<folder>.install.ymland<folder>.ibek.support.yamlfor ibek-support-infn;- a template and a test fixture for ibek-templates;
- the line to add to the Dockerfile.
The drafts are rendered against each other. Adapt the parameters to the driver’s db template macros, then:
- Run the ibek-support-infn tests.
- Bump the submodules in infn-epics-ioc.
- Tag a release.
Open a pull request
When the files are right, ask “open a pull request with them”. The answer shows the pull request as a proposed change, with its repository, title and files. Nothing leaves ARGUS until you apply it.
- Check the files and the checks listed under the proposal.
- Select it and choose Apply. You need the approve permission in the workspace. ARGUS opens a draft pull request that lists the checks and names you as the person who confirmed it.
- Follow the link to the pull request. The repository’s reviewers review it and merge it; ARGUS never merges.
A new driver is two pull requests: the support module on ibek-support-infn, then the template and its fixture on ibek-templates. If the option is not offered, an administrator has not installed the GitHub credential (docs/ioc-engineer.md).
INFN EPICS ecosystem
The INFN EPICS site introduces EPIK8S and links the shared IOC image, support modules, charts and operator interfaces. Use it to find the source repository before drafting or changing a beamline IOC entry.
When an IOC does not start
Give the assistant the IOC’s entry and the error from the pod log. “Template directory … not found” (exit 7) means the image is older than the template. “Unknown entity type” means the driver is not in the image’s build list.
What it knows, and from when
The catalogue is read from a commit of infn-epics-ioc and its submodules. Ask “which version of the IOC catalogue do you have?” to see that commit. An image tagged later can hold drivers or templates that the catalogue does not know yet.