...
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.
An simple example took from (https://baltig.infn.it/lnf-da-control/dafne-k8s-ecs/-/tree/main/config/ioc/ioc-dafne-accumulator-orbit?ref_type=heads):
| Code Block | ||||
|---|---|---|---|---|
| ||||
#!/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
|
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 Sparc ECS ) retrieving "GIT Control Source" URL, clone it:
Code Block language bash title Full CS git clone https://baltig.infn.it/lnf-da-control/<BEAMLINE>-k8s-ecs.git --recurse-submodules
- go in deploy/templates
- create a manifest yaml for your application like this:
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' start: '/epics/ioc/config/start.sh' 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 - name it as <myapplicationname>-ioc.yaml,
- git add <myapplicationname>-ioc.yaml
- git commit -m "a meaningful comment" .
- git push origin main
- The application(i.e Sparc ECS )