You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

For the integration of existing developments into docker/kubernates we use part of the  Diamond flow for a beamline under kubernates.

In particular we have realised our customisation where we put all the normalisable support we have for our INFN's beamlines.

The project is INFN EPICS IOC by cloning it:

cloning the project
git clone https://baltig.infn.it/epics-containers/infn-epics-ioc.git --recurse-submodules


The aim of this project:

  1. create a docker image with the device support needed for INFN beamlines that can be run in container.
  2. standardize and greatly  simplify the way to instantiate iocs via simple yaml file
  3. have a common database (shared among INFN and Diamond)
  4. standardize the build system

The layout of this project is:

Project layout
.
├── Dockerfile   				<-- docker file production
├── LICENSE
├── README.md
├── build
├── ibek-support				<-- submodule with ibek device support
│   ├── ADAravis
│   ├── ADCore
│   ├── ADGenICam
│   ├── ADSimDetector
│   ├── IOCInfo
│   ├── LICENSE
│   ├── README.md
│   ├── StreamDevice
│   ├── _global
│   ├── asyn
│   ├── autosave
│   ├── build_support.sh
│   ├── busy
│   ├── calc
│   ├── easy-driver-epics
│   ├── iocStats
│   ├── lakeshore340
│   ├── make_global_schemas.sh
│   ├── modbus
│   ├── motor
│   ├── motorMotorSim
│   ├── motorNewport
│   ├── opcua
│   ├── pmac
│   ├── pvi-generate.sh
│   ├── quadEM
│   ├── schemas
│   ├── screen-epics-ioc
│   ├── sequencer
│   ├── sscan
│   ├── tests
│   ├── todo
│   └── zebra
├── ioc
│   ├── Makefile
│   ├── configure
│   ├── install.sh
│   ├── iocApp
│   ├── liveness.sh
│   ├── start.sh
│   └── stop.sh
├── menlo
│   ├── install.sh
│   └── menlo.ibek.support.yaml
├── requirements.txt
├── requirements_ec.txt
├── tests
│   ├── example-config
│   ├── example-ibek-config
│   └── run-tests.sh
└── user_examples
    └── README.md



When we have to put an IOC in production we may have the following possibility:

  1. support already present in <ibek-support>
  2. support present as git project
  3. support not present at all → put in the condition 2

Use an existing support

If a support is present in <ibek-support>, it's very simple to use it just create a yaml that instantiates  your device(s).

An example could be the following the following yaml newport.yaml. It instatiate a motor with 1 axis. This support implicitly assumes that this serial control is connected to a Ethernet2Serial server like a moxa that responds on address   192.168.190.56 and port 4001


newport.yaml
ioc_name: rfmotors
description: RF motors 

entities:

  - type: motorNewport.SMC100CreateController
    controllerName: NEWPORT001
    P: "SPARC:RF:"
    IP: 192.168.190.56
    TCPPORT: 4001
    numAxes: 1

  
  - type: motorNewport.motorAxis
    controller: NEWPORT001
    M: "m0"
    DESC: "Axis"
    ADDR: 0
    DLLM: -25
    DHLM: 25
    home: 1
    start: 10
    VELO: 1


Then we can test if simply having the docker image: baltig.infn.it:4567/epics-containers/infn-epics-ioc


Docker image creation and run as ioc
docker run -p 5064:5064/udp -p 5064:5064/tcp -p 5065:5065/udp -p 5065:5065/tcp -it -v .:/epics/ioc/config baltig.infn.it:4567/epics-containers/infn-epics-ioc:local 


A generic asyn motor OPI interface  can be used to drive the motor. Motor OPIs Remember to add localhost to your phoebus 

org.phoebus.pv.ca/addr_list settings:

Phoebus settings example
org.phoebus.pv.ca/addr_list=localhost
org.phoebus.pv.ca/auto_addr_list=false
org.csstudio.trends.databrowser3/urls=pbraw://sparc-archiver.apps.okd-datest.lnf.infn.it/retrieval
org.csstudio.trends.databrowser3/archives=pbraw://sparc-archiver.apps.okd-datest.lnf.infn.it/retrieval
org.phoebus.olog.es.api/olog_url=http://sparc-olog.apps.okd-datest.lnf.infn.it/Olog
org.phoebus.olog.api/olog_url=http://sparc-olog.apps.okd-datest.lnf.infn.it/Olog
org.phoebus.logbook/logbook_factory=olog-es
org.phoebus.olog.api/username=epics
org.phoebus.olog.api/password=epics
org.phoebus.channelfinder/channelfinder.serviceURL=http://sparc-channelfinder.apps.okd-datest.lnf.infn.it/ChannelFinder
org.phoebus.applications.saveandrestore.client/jmasar.service.url=http://sparc-saveandrestore.apps.okd-datest.lnf.infn.it/save-restore
org.csstudio.scan.client/host=http://sparc-scanserver.apps.okd-datest.lnf.infn.it
org.csstudio.scan.client/port=4810


Once the IOC runs correctly as docker can be inserted in the EPIK8S configuration


Build a support from existing git support

This is path is more complex, but gives much more satisfaction, in fact each time you add a new support as much generic possible you greatly simplify the life of your self and in principle many other people will use the your support.

Step 1 create a directory inside ibek-support


Create by copy and renaming one of the existing support. Suppose you want to add the support for <mydevmodule>, you should have:

Project layout
.
├── Dockerfile
├── LICENSE
├── README.md
├── build
├── ibek-support
│   ├── ADAravis
│   ├── mydevmodule
│   │   ├── install.sh
│   │   └── mydevmodule.ibek.support.yaml
│   ├── opcua
│   │   └── install.sh
│   ├── pmac
│   │   ├── install.sh
│   │   ├── make_pvi.sh
│   │   ├── pmac.ibek.support.todo
│   │   ├── pmac.ibek.support.yaml
│   │   ├── pmacAxis.pvi.device.yaml
│   │   ├── pmacCSController.pvi.device.yaml
│   │   ├── pmacController.pvi.device.yaml
│   │   └── pmacTrajectory.pvi.device.yaml
│   



So in general just two file must be added: install.sh and mydevmodule.ibek.support.yaml.

The first are instructions on howto compile and the dependencies of your module. In general if the mydevmodule  is well structured from a build epics point of view needs only to be patched like that:

install.sh
#!/bin/bash

# ARGUMENTS:
#  $1 VERSION to install (must match repo tag)
VERSION=${1}
NAME=<mydevmodule>  ## as compare in the git repository
FOLDER=$(dirname $(readlink -f $0))

# log output and abort on failure
set -xe

# get the source and fix up the configure/RELEASE files
ibek support git-clone ${NAME} ${VERSION} --org http://gitrepo ## repository git root
ibek support register ${NAME}

# declare the libs and DBDs that are required in ioc/iocApp/src/Makefile
ibek support add-libs <mydevmodulelib> <support1lib> <support2lib> asyn ## optional libraries that must be linked
ibek support add-dbds <mydevmodule>.dbd <optsupport1.dbd> <optsupport2>.dbd ### optional dbd supports
# global config settings
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
# prepare *.bob, *.pvi, *.ibek.support.yaml for access outside the container.
ibek support generate-links ${FOLDER}







  • No labels