...
It's highly suggested to use https://code.visualstudio.com/ to handle the project.
It's
also recommended to use a container for development to decouple development of the application from the platform where the application is developed.
...
SOFT IOC Development SoftIOC in a Linux-like environment
Deploy on the target
...
EPIK8S
Once your IOC/application named 'mynewioc' is tested and ready to be published on the target EPIK8S.
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.
...
Identify your target EPIK8S information page (i.e EPIK8s Sparc ) retrieving "GIT Control Source" URL, clone it:
| Code Block | ||||
|---|---|---|---|---|
| ||||
git clone https://baltig.infn.it/lnf-da-control/epik8-<BEAMLINE>.git --recurse-submodules |
you should have a directory like thisdafne-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
| |||||
├── README.md
├── config
│ ├── applications
│ │ ├── flame-state-import
│ │ └── icpdastemp01
│ ├── iocs
│ │ ├── mrf01
│ │ ├── pitaya
│ │ ├── temp01
│ │ └── mynewioc <-- add here your folder or git subproject
│ └── services
│ └── cagateway
├── deploy
│ ├── Chart.yaml
│ ├── templates
│ │ └── epik8.yaml
│ └── values.yaml
├─ |
Adding IOC
Suppose your iocname is mynewioc you should create a folder with the same name. This folder should contain a:
- ioc.yaml if your IOC is generic and has support in ibek see IBEK support
- start.sh + other ioc startup files or submodules. The start.sh is the entry point that can perform some useful substitutions in case of multiple instances of same ioc and start your IOC.
In case mynewioc is a soft IOC this directory should also contain the git submodule that point to your application git repository.
Example softioc
If your mynewioc is a softioc you should have a repository for it. So in the EPIK8S folder config/iocs/mynewioc you must add your repository as submodule:
| Code Block | ||||
|---|---|---|---|---|
| ||||
cd <EPIK8Sfolder/config/iocs>
git pull --recurse-submodules ## to update remote changes
git submodule update --init ## to update eventually new submodules
cd mynewioc
## here add your new submodule
git submodule add <your repository_URL> scripts # your softioc repository will be added as scripts
git commit -m "your comment Add submodule <submodule_name>"
git push origin <your remote branch i.e main/master> |
In your application repository create a bash file named start.sh (bash script) that will be used to start your application.
| Code Block | ||||
|---|---|---|---|---|
| ||||
#!/bin/bash
script_dir=$(dirname "$0")
cd $script_dir
echo "Starting mynewioc : $EPICS_CA_ADDR_LIST"
python ./scripts/mynewioc <parameters> -c myconfig.json
|
This script will launch ./scripts/mynewioc (remember scripts scripts is the folder name you gave to your submodule in the previous step) and will give some parameters and a configuration myconfig.json file that must be added to the mynewioc.
Add to EPIK8s
Once your configuration directory mynewioc is complete. We need to add to the main git repository.
| Code Block | ||||
|---|---|---|---|---|
| ||||
cd <EPIK8Sfolder/config/iocs/mynewioc>
chmod a+x start.sh # make start.sh executable
git add start.sh myconfig.json scripts
git commit -m "my comment" .
git push origin
|
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):
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
...