Versions Compared

Key

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

...

  1. Setup EPICS_CA_ADDR_LIST
  2. Identify your target ECS information page (i.e EPIK8s Sparc ) retrieving "GIT Control Source" URL, clone it

Python SoftIOC workflow

Setup a target container

...

  1. .

...

  1. Code Block
    language

...

  1. bash
    titleFull CS
    git clone https://baltig.infn.it

...

  1. /

...

  1. lnf-da-

...

  1. control/

...

  1. <BEAMLINE>-

...

A fully functional example:

https://baltig.infn.it/infn-epics/py-ioc-collector

Follow development guidelines

SOFT IOC Development SoftIOC in a Linux-like environment

Deploy on the target ECS

Once your IOC/application is tested and ready to be published on the target ECS.

In your application repository create a bash file named start.sh (bash script) that will be used to start your application. Add it to your repo.

...

  1. k8s-ecs.git --recurse-submodules
  2. This project includes a opi directories that is a git submodule that points to a GIT project intended to include all the CSS/phoebus interfaces that compose the Control System interfaces of the K8S ECS beamline. The entry point to the beamline control interface is Launcher.bob. The settings.ini is built by start.sh depending on the environment variables:
    1. EPICS_CA_ADDR_LIST that must include the addresses of the IOC you want to access or the address of the ca-gateway listed on the target ECS information page
    2. OPIHOME the directory where the OPIs are.
    3. EPICS_ARCHIVER the Entry point of the archiver.

    4. PHOEBUS_SAVE_AND_RESTORE service of save and restore

    5. PHOEBUS_SCAN_SERVER service

  3. Test your environment trying to open Launcher.bob and open some control interface.


Develop your OPI and deploy

Use your local Phoebus to develop and test your OPI, when the OPI is ok and you need to include it in the control follow this steps:

  1. go into the opi directory and add your GIT project:
    Code Block
    languagebash
    titlestart.sh

...

#!/bin/bash
script_dir=$(dirname "$0")
cd $script_dir
echo "Starting Accumulator Orbit addr: $EPICS_CA_ADDR_LIST"
python ./scripts/py-ioc-collector.py -c accumulator_orbit.json

  1. cd opi
    git submodule add <your project url> 
  2. modify the Launcher.bob to properly integrate your new interface
  3. test and commit your modification

If the application/ioc is generic a more generic approach should be followed decoupling the source and the startup. In this approach the configuration of the IOC resides in a dedicated directory <TARGET ECS>/config/ioc of the target K8s ECS see for instance https://baltig.infn.it/lnf-da-control/dafne-k8s-ecs/-/tree/main/config/ioc

Follow this steps:

  1.  Identify your target ECS information page (i.e EPIK8s Sparc ) retrieving "GIT Control Source" URL, clone it:
    Code Block
     create a manifest yaml for your application like this:apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: <myapplicationname>-ioc namespace: argocd labels: rootapp: {{ .Chart.Name }} rootappver: {{ .Chart.Version | quote }} beamline: {{ .Values.beamline | quote }} spec: project: default source: repoURL: 'https://baltig.infn.it/epics-containers/ioc-chart.git' path: . targetRevision: HEAD helm: values: | image: baltig.infn.it:4567/epics-containers/epics-py-base beamline: {{ .Values.beamline | quote }} replicaCount: {{ .Values.consoleReplica }} configCA: existingConfigMap: {{ .Values.configCA.configName | quote}} address_list: {{ .Values.configCA.gatewayName }} ## override with gateway gitRepoConfig: url: 'http://<your repo url>' path: '<path to reach your app and conf... usually just .>' branch: 'main' init: 'true'
    Code Block
    languageyml
    titleApplication yaml
    languagebash
    titleFull CS
    git clone https://baltig.infn.it/lnf-da-control/<BEAMLINE>-k8s-ecs.git --recurse-submodules
  2. go in deploy/templates
  3. : '/epics/ioc/config/start' destination: server: 'https://kubernetes.default.svc' namespace: {{ .Values.namespace | quote }} syncPolicy: automated: prune: true # Optional: Automatically remove resources not specified in Helm chart selfHeal: true
    start
    .sh
  4. name it as <myapplicationname>-ioc.yaml,
  5. update the deploy/values.yaml by adding <myapplicationname>-ioc to the address_list, so that it can be found from interface and services
  6. git add <myapplicationname>-ioc.yaml
  7. git commit -m "a meaningful comment" .
  8. git push origin main
  9. The application manifest is ok the application should be started by ArgoCD https://argocd-server-argocd.apps.okd-datest.lnf.infn.it/applications
  10. Login in the argoCD using 'admin' and a password that you've to ask. Check the status of your application and 'delete ca-gateway' application so that the Gateway is restarted updating the configuration for all the clients.

Setup Phoebus and develop the OPI for your softioc

Install Phoebus: Phoebus Setup.

If you want to develop the OPI for your IOC however each K8S ECS installation has in its GIT Control Source project a directory opi (that is a git subproject with other subproject) that contain a Launcher.bob and a start.shthis setup is intended to start the main control interface of a given beamline.

...

  1. git commit -m "my comment" .
    git push origin