Skip to content

Commit

Permalink
Merge pull request #7 from epics-containers/dev
Browse files Browse the repository at this point in the history
genericize genericizable files
  • Loading branch information
gilesknap authored Oct 4, 2023
2 parents 5722cf4 + 9ae28b6 commit edf7de2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```

20 changes: 9 additions & 11 deletions ci_verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@
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}/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'
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

# 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
container=$(ec --log-level debug dev launch --target runtime ci_test --args '-dit')
ec --log-level debug dev stop ./ci_test/

done
8 changes: 2 additions & 6 deletions bl45p → environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Empty file.

0 comments on commit edf7de2

Please sign in to comment.