Versions Compared

Key

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

...

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
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


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 Sparc ECS ) retrieving "GIT Control Source" URL, clone it:
    Code Block
    languagebash
    titleFull CS
    git clone https://baltig.infn.it/lnf-da-control/<BEAMLINE>-k8s-ecs.git --recurse-submodules
  2. go in deploy/templates
  3.  create a manifest yaml for your application like this:
    Code Block
    languageyml
    titleApplication 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
  4. name it as <myapplicationname>-ioc.yaml,
  5. git add <myapplicationname>-ioc.yaml
  6. git commit -m "a meaningful comment" .
  7. git push origin main
  8. The application(i.e Sparc ECS )