Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageshell
titleShell
├── Dockerfile                   <-- 2 file where to add the new support this file will create the docker image
├── Dockerfile.all
├── Dockerfile.base
├── LICENSE
├── README.md
├── build
├── build-base
├── epics-support-template-infn  <-- JNJA2 templates for not ibekizable supports
├── ibek-support                 <-- DLS base ibek-support
├── ibek-support-infn            <-- 1 INFN specific ibek supports ADD NEW support HERE
├── ibek-templates               <-- 3 JNJA2 templates to generalize, make sophisticated templates and allow parameters to be given
├── tests                        <-- 4 test directory


...

Code Block
languageyaml
titlemynewsupportname.install.yml
# yaml-language-server: $schema=../../ibek-support/_scripts/support_install_variables.json

module: mynewsupportname ## your git project name
version: devel ## your reversion/tag

# this module uses modbus so requires none of its own libs/dbds
organization: https://github.com/infn-epics/ ## your git organization name

dbds:								## here the dbds used by your ioc/support
  - asyn.dbd
  - stream.dbd
  - calc.dbd
  - asSupport.dbd
  - sscan.dbd
  - <mynewsupportname>.dbd

libs:								#here 
  - asyn
  - stream
  - calc
  - autosave
  - <mynewsupportname>Support  ## if you have support libs


protocol_files:
  - db/<mynewsupportname>.proto ## if you have protocols file


4- Create the support file  mynewsupportname.ibek.

...

support.yml

mynewsupportname.ibek.support.yaml

...

Code Block
languageyaml
titlemynewsupportname.ibek.installsupport.yml
# yaml-language-server: $schema=https://github.com/epics-containers/ibek/releases/download/3.1.2/ibek.support.schema.json


module: mynewsupportname

entity_models:
  - name: mycontroller
    description: |-
      Create a my controller
    parameters:
      name:
        type: id
        description: |-
          The name of the controller and its Asyn Port Name
      P:
        type: str
        description: |-
          Device PV Prefix
      IP:
        type: str
        description: |-
          IP address of the ethernet2serial
        default: 127.0.0.1 ## localhost

      TCPPORT:
        type: int
        description: |-
          Port of the ethernet2serial
        default: 4001

      ASYNPRIO:
        type: int
        description: |-
          ASYN   PRIORITY, Default : 0
        default: 0

      AUTOCONNECT:
        type: int
        description: |-
          Asyn auto connect
          0: Auto connection
          1: no Auto connection
        default: 0

      NOPRECESSESOS:
        type: int
        description: |-
          ASYN   noProcessEos, Default : 0
          https://epics.anl.gov/tech-talk/2020/msg01705.php
        default: 0

      TPG_UNDERRANGE_ALARM_SEVERITY_A1:
        type: enum
        description: |-
            underrange severity A1
        values:
          MINOR:
          MAJOR:
          NO_ALARM:
        default: MINOR
      
      TPG_UNDERRANGE_ALARM_SEVERITY_A2:
        type: enum
        description: |-
            underrange severity A2
        values:
          MINOR:
          MAJOR:
          NO_ALARM:
        default: MINOR
      
      TPG_UNDERRANGE_ALARM_SEVERITY_B1:
        type: enum
        description: |-
            underrange severity 
        values:
          MINOR:
          MAJOR:
          NO_ALARM:
        default: MINOR

      TPG_UNDERRANGE_ALARM_SEVERITY_B2:
        type: enum
        description: |-
            underrange severity 
        values:
          MINOR:
          MAJOR:
          NO_ALARM:
        default: MINOR
        
    pre_init:
      - value: |
          drvAsynIPPortConfigure("{{name}}", "{{IP}}:{{TCPPORT}}", 0, 0, 0)
          epicsEnvSet "STREAM_PROTOCOL_PATH", "/epics/support/configure/protocol/
    databases:
      - file: <mymodule1>.db
        args:
          P: 
          PORT: '{{name}}'
          TPG_UNDERRANGE_ALARM_SEVERITY_A1:
          TPG_UNDERRANGE_ALARM_SEVERITY_A2:
          TPG_UNDERRANGE_ALARM_SEVERITY_B1:
          TPG_UNDERRANGE_ALARM_SEVERITY_B2:
          

  - name: mychannel
    description: |-
      Template database for a channel
    parameters:
      controller:
        type: object
        description: |-
          a reference to the controller
      name:
        type: str
        description: |-
          channel prefix
        
      channel:
        type: enum
        description: |-
          Channel 
        values:
          A1:
          A2:
          B1:
          B2:
      
      TPG_UNDERRANGE_ALARM_SEVERITY:
        type: enum
        description: |-
            underrange severity 
        values:
          MINOR:
          MAJOR:
          NO_ALARM:
        default: MINOR

    databases:
      - file: $(MYMODULENAME)/mydb2.template
        args:
          P: '{{controller.P}}'
          NAME: '{{name}}'
          CHAN: '{{channel}}'
          PORT: '{{controller.name}}'
          TPG_UNDERRANGE_ALARM_SEVERITY:

...

Code Block
languageshell
titleShell
rm /epics/ioc/config/* ## remove previous configs
epik8s-run tests/values.yaml mynewIOCNAME --native

...

Once the IOC starts everything can be committed step 9.

9- Commit, Tag to create a new image

ibek-infn-support and ibek-templates are git subproject so to add your new support you should go in the directories:It's possible to check the yaml result of instantiation in /epics/ioc/config the yaml has the name like the template without .j2.



Code Block
languageshell
titleShell
rm /epics/ioc/config/* ## remove previous configs
## the following will perform replacement and start the ioc
epik8s-run tests/values.yaml mynewIOCNAME --native

## check yaml 

more /epics/ioc/config/mynewsupportname.yaml
## the resulting st.cmd after ibek instantiation of mynewsupportname.yaml can be found in
more /epics/runtime/st.cmd



Chek Intermediate files generated

  • /epics/ioc/config/<mynewsupportname>.yaml resulting YAML after j2 replacement with parameters given from IBEK beamline/deploy/values.yaml

  • /epics/runtime/st.cmd resulting st.cmd after ibek replacement using the support mynewsupportname

Code Block
languageshell
titleShell
more /epics/ioc/config/mynewsupportname.yaml

more /epics/runtime/st.cmd


9- Commit, Tag to create a new image

ibek-infn-support and ibek-templates are git subproject so to add your new support you should go in the directories:

Code Block
languageshell
titleShell
cd ibek-infn-support 
git status
git add cd ibek-infn-support 
git status
git add <mynewsupportname>
git commit -m "my first beautiful ibek support" .
git checkout main
git merge <hash/branch>
git push origin
cd ..
cd ibek-templates/templates

git add <mynewsupportdircontent>
git commit -m "my first beautiful ibek template" .
git checkout main
git merge <hash/branch>
git push origin

## now commit and push the epics-infn-ioc main project
cd ../../
git commit -m "my first beautiful support" .
git checkout main
git merge <hash/branch>
git push origin

## to create a new image a tag must be created
## list tags
git tag
git tag <last tag + 1 in minor or +1 in bump release (something temporary) <tag>b xx
git push origin <tagname created>

Release tags convention

The ufficial tags should have the following format : v<year>.<month>.<day> the test tags or fix during a day must have the suffix <bincremental number>

Deploy on the target EPIK8S 

...