From af99c633715bef3e6f1a993bf508abd1a6a686a3 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 4 Oct 2023 09:38:26 +0100 Subject: [PATCH 1/3] genericize genericizable files --- .gitignore | 2 +- ci_verify.sh | 12 ++++++------ bl45p => environment.sh | 8 ++------ iocs/bl45p-ea-ioc-01/config/xxxxxyyy | 0 4 files changed, 9 insertions(+), 13 deletions(-) rename bl45p => environment.sh (90%) delete mode 100644 iocs/bl45p-ea-ioc-01/config/xxxxxyyy diff --git a/.gitignore b/.gitignore index b224198..e7007fa 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ iocs/bl45p-ea-ioc-01/config/make_db.sh iocs/bl45p-ea-ioc-01/config/st.cmd # this file is placed in the folder for running CI tests -test/values.yaml +ci_test/values.yaml diff --git a/ci_verify.sh b/ci_verify.sh index b22fdf3..8227bd2 100755 --- a/ci_verify.sh +++ b/ci_verify.sh @@ -8,24 +8,24 @@ set -ex pip install --upgrade "epics-containers-cli>=2.0.0" # setup environment for epics-containers-cli (ec) to work with BL45P -source ${THIS_DIR}/bl45p +source ${THIS_DIR}/environment.sh for ioc in iocs/* do if [ ! -d "${ioc}/config" ]; then continue fi - + # verify that the instance can generate a schema ec dev launch --target runtime ${ioc} --execute \ - 'ibek ioc generate-schema /epics/ioc-adaravis/ibek-support/*/*.ibek.support.yaml' - + 'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' + # verify that the instance can launch its IOC - + # put the values.yaml file a test config directory with basic startup script cp -r ${ioc}/values.yaml ci_test/ # launch the generic IOC pointing at that config container=$(ec dev launch --target runtime ci_test --args '-dit') podman stop ${container} -t0 - + done diff --git a/bl45p b/environment.sh similarity index 90% rename from bl45p rename to environment.sh index 91ba8bb..7817596 100755 --- a/bl45p +++ b/environment.sh @@ -28,11 +28,7 @@ fi if module --version &> /dev/null; then if module avail pollux > /dev/null; then module load pollux > /dev/null - ec ps + # allow this to fail if the cluster is not available + if ! ec ps ; then echo "no cluster available"; fi fi fi - -set +e -# replace the shell so the caller can use the environment -exec ${SHELL} - diff --git a/iocs/bl45p-ea-ioc-01/config/xxxxxyyy b/iocs/bl45p-ea-ioc-01/config/xxxxxyyy deleted file mode 100644 index e69de29..0000000 From 92dc37ecc2b8e3407b441f4b4ede5d2ad472bfbd Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 4 Oct 2023 13:54:32 +0100 Subject: [PATCH 2/3] add to README --- README.md | 37 +++++++++++++++++++++++++++++++++---- ci_verify.sh | 6 ++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c96bec..fa118a3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,37 @@ -ioc instance configuration for Beamline BL45P -============================================= +Beamline BL45P Reference Implementation of and epics-containers Beamline +======================================================================== -Note for example you can start an IOC locally like this +This repository contains the configuration files for the IOC instances +running on the test beamline BL45P at DLS. +It is a reference implementation of a beamline for +[epics-containers](https://github.com/epics-containers). + +Inside DLS you can experiment with BL45P by setting up your environment +as follows: + +```bash +# get bl45p environment file +curl https://raw.githubusercontent.com/epics-containers/bl45p/main/environment.sh -o ~/.local/bin/bl45p + +# start a new shell to pick up .local/bin in PATH +bash + +# set up the environment +source bl45p +``` + +Now if everythin is working you should be able to see the IOC instances +running on the bl45p kubernetes cluster: + +```bash +ec ps ``` -podman run -it --security-opt label=disable --entrypoint bash -v $(pwd)/iocs/bl45p-ea-ioc-01/config:/epics/ioc/config ghcr.io/epics-containers/ioc-adaravis-linux-runtime:23.9.2 + +And also take a look at what other commands are available: + +```bash +ec --help +ec ioc --help ``` + diff --git a/ci_verify.sh b/ci_verify.sh index 8227bd2..168fc86 100755 --- a/ci_verify.sh +++ b/ci_verify.sh @@ -5,8 +5,6 @@ THIS_DIR=$(dirname ${0}) set -ex -pip install --upgrade "epics-containers-cli>=2.0.0" - # setup environment for epics-containers-cli (ec) to work with BL45P source ${THIS_DIR}/environment.sh @@ -17,7 +15,7 @@ do fi # verify that the instance can generate a schema - ec dev launch --target runtime ${ioc} --execute \ + ec --log-level debug dev launch --target runtime ${ioc} --execute \ 'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' # verify that the instance can launch its IOC @@ -25,7 +23,7 @@ do # put the values.yaml file a test config directory with basic startup script cp -r ${ioc}/values.yaml ci_test/ # launch the generic IOC pointing at that config - container=$(ec dev launch --target runtime ci_test --args '-dit') + container=$(ec --log-level debug dev launch --target runtime ci_test --args '-dit') podman stop ${container} -t0 done From 9ae28b6e9759e0d772c0829ae8089ef8b53811a5 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 4 Oct 2023 14:41:36 +0100 Subject: [PATCH 3/3] use ec stop in CI --- ci_verify.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_verify.sh b/ci_verify.sh index 168fc86..c6dbb1b 100755 --- a/ci_verify.sh +++ b/ci_verify.sh @@ -24,6 +24,6 @@ do cp -r ${ioc}/values.yaml ci_test/ # launch the generic IOC pointing at that config container=$(ec --log-level debug dev launch --target runtime ci_test --args '-dit') - podman stop ${container} -t0 + ec --log-level debug dev stop ./ci_test/ done