Skip to content

Commit

Permalink
Merge pull request #16 from epics-containers/dev
Browse files Browse the repository at this point in the history
Latest ibek changes. New IOC instance example.
  • Loading branch information
gilesknap authored Nov 29, 2023
2 parents c548209 + 169255c commit d0c73fc
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ "${PUSH}" == 'true' ]] ; then EC_PUSH='--push' ; fi

THIS=$(dirname ${0})
set -xe
mkdir -p ${CACHE}
mkdir -p ${EC_CACHE}

# get the current version of ec CLI
pip install -r ${THIS}/../../requirements_ec.txt
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##### build stage ##############################################################

ARG TARGET_ARCHITECTURE
ARG BASE=7.0.7ec2
ARG BASE=7.0.7ec3
ARG REGISTRY=ghcr.io/epics-containers

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS developer
Expand Down Expand Up @@ -29,6 +29,12 @@ RUN autosave/install.sh R5-11
COPY ibek-support/busy/ busy/
RUN busy/install.sh R1-7-3

COPY ibek-support/sscan/ sscan/
RUN sscan/install.sh R2-11-6

COPY ibek-support/calc/ calc/
RUN calc/install.sh R3-7-5

COPY ibek-support/ADCore/ ADCore/
RUN ADCore/install.sh R3-12-1

Expand Down
50 changes: 16 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
ADSimDetector Generic IOC for epics-containers
==============================================
# ADSimDetector Generic IOC for epics-containers

Creates a generic IOC for ADSimDetector using GitHub Actions and
IOC Builder for EPICS and Kubernetes (ibek).

The Generic IOC built by CI is published to
[Github Packages](https://github.com/orgs/epics-containers/packages?repo_name=ioc-adsimdetector).

The registry provides a runtime
image for deploying to production and a dev image for testing,
debugging and developing new features. epics-containers implements
tools to launch IOCs in a Kubernetes cluster. But any container
runtime can be used to launch an IOC instance by mounting configuration
files into the container.
## How to test this container

## Launching an IOC instance
1. `git clone [email protected]:epics-containers/ioc-adsimdetector.git`
2. `git submodule update --init --recursive`
3. open the folder in vscode
4. reopen in container
5. optional - view log to see the build progress
6. open a terminal and perform the following inside the container

The Generic IOC can be launched as an IOC instance. To do this a
container runtime should load the above runtime image and mount
instance configuration files into the folder `/epics/ioc/config`.
- (TODO it would be nice to have a single ibek wrapper command for these
or maybe add them in as part of the 'ioc build' wrapper)
- `ibek ioc build`
- `ibek dev instance /epics/ioc-adsimdetector/ioc_examples/bl01t-ea-ioc-02`
- `cd /epics/ioc`
- `./start`
- `python -m http.server 8000 --directory /epics/opi`

Options for the configuration files are:-

- ioc.yaml:
- If the config folder contains an ioc.yaml file we invoke the ibek tool to
generate the startup script and database. Then launch with the generated
startup script.

- st.cmd + ioc.subst:
- If the config folder contains a st.cmd script and a ioc.subst file then
optionally generate ioc.db from the ioc.subst file and use the st.cmd script
as the IOC startup script. Note that the expanded database file will
be generated in /tmp/ioc.db

- start.sh:
- If the config folder contains a start.sh script it will be executed.
This allows the instance implementer to provide a completely custom
startup script.

- no mount:
- If the config folder is empty then this Generic IOC will launch the
example IOC instance
7. `phoebus.sh -resource 'http://localhost:8000/index.bob'`

## Related projects

Expand All @@ -55,4 +38,3 @@ container image upon which all Generic IOCs are built.
- [epics-containers-cli](https://github.com/epics-containers-cli) a command
line tool to assist with building and deploying epics-containers into
Kubernetes.

59 changes: 59 additions & 0 deletions ioc_examples/bl01t-ea-ioc-02/config/ioc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=https://github.com/epics-containers/ioc-adsimdetector/releases/download/2023.11.2/ibek.ioc.schema.json

ioc_name: bl01t-ea-ioc-02
description: Example simulated camera for BL01T

entities:
- type: ADSimDetector.simDetector
PORT: det.cam
P: BL01T-EA-TST-02
R: ":CAM:"

- type: ADCore.NDPvaPlugin
PORT: det.pva
PVNAME: BL01T-EA-TST-02:PVA:OUTPUT
P: BL01T-EA-TST-02
R: ":PVA:"
NDARRAY_PORT: det.cam

- type: ADCore.NDROI
NDARRAY_PORT: det.cam
P: BL01T-EA-TST-02
PORT: det.roi
R: ":ROI:"

- type: ADCore.NDStdArrays
FTVL: UCHAR
NDARRAY_PORT: det.roi
NELEMENTS: 1200000
P: BL01T-EA-TST-02
PORT: det.arr
R: ":ARR:"
TYPE: Int8

- type: ADCore.NDStats
HIST_SIZE: 256
NDARRAY_PORT: det.cam
P: BL01T-EA-TST-02
PORT: det.stat
R: ":STAT:"
XSIZE: 1292
YSIZE: 964

- type: ADCore.NDProcess
NDARRAY_PORT: det.cam
P: BL01T-EA-TST-02
PORT: det.proc
R: ":PROC:"

- type: ADCore.NDFileTIFF
NDARRAY_PORT: det.cam
P: BL01T-EA-TST-02
PORT: det.tiff
R: ":TIFF:"

- type: ADCore.NDFileHDF5
NDARRAY_PORT: det.cam
P: BL01T-EA-TST-02
PORT: det.hdf
R: ":HDF5:"
1 change: 1 addition & 0 deletions ioc_examples/bl01t-ea-ioc-02/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
image: ghcr.io/epics-containers/ioc-adsimdetector-linux-runtime:2023.10.7
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ibek==1.5.0
ibek==1.5.2
# to install direct from github during development in the dev branch:
#git+https://github.com/epics-containers/ibek.git@dev

0 comments on commit d0c73fc

Please sign in to comment.