diff --git a/Dockerfile b/Dockerfile index 5cc4ae9..495cb60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,17 @@ -##### build stage ############################################################## - ARG TARGET_ARCHITECTURE ARG BASE=7.0.7ec2 ARG REGISTRY=ghcr.io/epics-containers +##### build stage ############################################################## + FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS developer -# get latest ibek while under dev. In future the epics-base version will be used +# Get latest ibek while in development. Will come from epics-base in future. RUN pip install --upgrade ibek -# the devcontainer mounts the project root to /epics/ioc-template -WORKDIR /epics/ioc-template/ibek-support +# The devcontainer mounts the project root to /epics/ioc-adsimdetector. Using +# the same location here makes devcontainer/runtime differences transparent. +WORKDIR /epics/ioc-adsimdetector/ibek-support # copy the global ibek files COPY ibek-support/_global/ _global @@ -18,12 +19,23 @@ COPY ibek-support/_global/ _global COPY ibek-support/iocStats/ iocStats RUN iocStats/install.sh 3.1.16 -################################################################################ -# TODO - Add futher support module installations here -################################################################################ +COPY ibek-support/asyn/ asyn/ +RUN asyn/install.sh R4-42 + +COPY ibek-support/autosave/ autosave/ +RUN autosave/install.sh R5-10-2 + +COPY ibek-support/busy/ busy/ +RUN busy/install.sh R1-7-3 + +COPY ibek-support/ADCore/ ADCore/ +RUN ADCore/install.sh R3-12-1 + +COPY ibek-support/ADSimDetector/ ADSimDetector/ +RUN ADSimDetector/install.sh R2-10 -# create IOC source tree / generate Makefile / compile -RUN ibek ioc compile +# Generate template IOC source tree / generate Makefile / compile +RUN ibek ioc build ##### runtime preparation stage ################################################ @@ -44,4 +56,4 @@ RUN ibek support apt-install --runtime ENV TARGET_ARCHITECTURE ${TARGET_ARCHITECTURE} -ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"] +ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 1494410..91039a7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,58 @@ -An epics-containers generic IOC source file. +ADSimDetector Generic IOC for epics-containers +============================================== -Generates a Generic IOC for running in a container. +Creates a generic IOC for ADSimDetector using GitHub Actions and +IOC Builder for EPICS and Kubernetes (ibek). -See the https://epics-containers.github.io +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. + +## Launching an IOC instance + +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`. + +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 + +## Related projects + +- [ibek](https://github.com/epics-containers/ibek) builds generic IOCs and +IOC instances. +- [ibek-support](https://github.com/epics-containers/ibek-support) tells ibek +how each EPICS support module is built. +- [epics containers documentation](https://epics-containers.github.io/) +explanations and tutorials for epics-containers. +- [epics-base](https://github.com/epics-containers/epics-base) the EPICS base +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.