...
- Setup EPICS_CA_ADDR_LIST
- Identify your target ECS information page (i.e EPIK8s Sparc ) retrieving "GIT Control Source" URL, clone it
Python SoftIOC workflow
Setup a target container
...
- .
...
Code Block language
...
bash title Full CS git clone https://baltig.infn.it
...
/
...
lnf-da-
...
control/
...
<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.
...
k8s-ecs.git --recurse-submodules
- 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:
- 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
- OPIHOME the directory where the OPIs are.
EPICS_ARCHIVER the Entry point of the archiver.
PHOEBUS_SAVE_AND_RESTORE service of save and restore
PHOEBUS_SCAN_SERVER service
- 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:
- go into the opi directory and add your GIT project:
Code Block language bash title start.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
cd opi git submodule add <your project url>
- modify the Launcher.bob to properly integrate your new interface
- 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:
- Identify your target ECS information page (i.e EPIK8s Sparc ) retrieving "GIT Control Source" URL, clone it:
create a manifest yaml for your application like this:Code Block Code Block language yml title Application yaml 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' language bash title Full CS git clone https://baltig.infn.it/lnf-da-control/<BEAMLINE>-k8s-ecs.git --recurse-submodules
- go in deploy/templates
: '/epics/ioc/config/startstart ' 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.sh - name it as <myapplicationname>-ioc.yaml,
- update the deploy/values.yaml by adding <myapplicationname>-ioc to the
address_list, so that it can be found from interface and services
- git add <myapplicationname>-ioc.yaml
- git commit -m "a meaningful comment" .
- git push origin main
- The application manifest is ok the application should be started by ArgoCD https://argocd-server-argocd.apps.okd-datest.lnf.infn.it/applications
- 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.sh, this setup is intended to start the main control interface of a given beamline.
...
git commit -m "my comment" . git push origin