|
1 | 1 | Create a new generic IOC image
|
2 | 2 | ==============================
|
3 |
| -Todo - will have a template repo for this |
| 3 | + |
| 4 | +Getting started |
| 5 | +--------------- |
| 6 | + |
| 7 | +You may need to create an IOC instance that depends on support modules |
| 8 | +that have not yet been published in a generic IOC image. In this case |
| 9 | +you will need to publish a new generic IOC image that provides the |
| 10 | +additional support. |
| 11 | + |
| 12 | +This requires building a new Dockerfile that describes the image. The |
| 13 | +Dockerfile will be hosted in a new source repository that includes any |
| 14 | +additional files for the image context. In epics-containers |
| 15 | +these repos are all called ioc-XXX where XXX is the name of the primary |
| 16 | +support module being containerized. |
| 17 | + |
| 18 | +To start a new ioc-XXX repo you can use the ioc-template project at |
| 19 | +https://github.com/epics-containers/ioc-template and click **Use Template**. |
| 20 | + |
| 21 | +If you search the resulting project for TODO this will give you hints |
| 22 | +on how to create your new generic IOC. |
| 23 | + |
| 24 | +All images will follow a very similar pattern, here is an example which builds |
| 25 | +the ADAravis support module for GigE cameras. |
| 26 | + |
| 27 | +.. code-block:: docker |
| 28 | +
|
| 29 | + # Add support for GigE cameras with the ADAravis support module |
| 30 | + ARG REGISTRY=ghcr.io/epics-containers |
| 31 | + ARG ADCORE_VERSION=3.10r2.0 |
| 32 | +
|
| 33 | + FROM ${REGISTRY}/epics-areadetector:${ADCORE_VERSION} |
| 34 | +
|
| 35 | + # install additional tools and libs |
| 36 | + USER root |
| 37 | +
|
| 38 | + RUN apt-get update && apt-get upgrade -y && \ |
| 39 | + apt-get install -y --no-install-recommends \ |
| 40 | + libglib2.0-dev \ |
| 41 | + meson \ |
| 42 | + intltool \ |
| 43 | + pkg-config \ |
| 44 | + xz-utils \ |
| 45 | + && rm -rf /var/lib/apt/lists/* |
| 46 | +
|
| 47 | + # build aravis library |
| 48 | + RUN cd /usr/local && \ |
| 49 | + git clone -b ARAVIS_0_8_1 --depth 1 https://github.com/AravisProject/aravis && \ |
| 50 | + cd aravis && \ |
| 51 | + meson build && \ |
| 52 | + cd build && \ |
| 53 | + ninja && \ |
| 54 | + ninja install && \ |
| 55 | + echo /usr/local/lib64 > /etc/ld.so.conf.d/usr.conf && \ |
| 56 | + ldconfig && \ |
| 57 | + rm -fr /usr/local/aravis |
| 58 | +
|
| 59 | + USER ${USERNAME} |
| 60 | +
|
| 61 | + # get additional support modules |
| 62 | + ARG ADARAVIS_VERSION=R2-2-1 |
| 63 | + ARG ADGENICAM_VERSION=R1-8 |
| 64 | +
|
| 65 | + RUN python3 module.py add areaDetector ADGenICam ADGENICAM ${ADGENICAM_VERSION} |
| 66 | + RUN python3 module.py add areaDetector ADAravis ADARAVIS ${ADARAVIS_VERSION} |
| 67 | +
|
| 68 | + # add CONFIG_SITE.linux and RELEASE.local |
| 69 | + COPY --chown=${USER_UID}:${USER_GID} configure ${SUPPORT}/ADGenICam-${ADGENICAM_VERSION}/configure |
| 70 | + COPY --chown=${USER_UID}:${USER_GID} configure ${SUPPORT}/ADAravis-${ADARAVIS_VERSION}/configure |
| 71 | +
|
| 72 | + # update the generic IOC Makefile to include the new support |
| 73 | + COPY --chown=${USER_UID}:${USER_GID} Makefile ${EPICS_ROOT}/ioc/iocApp/src |
| 74 | +
|
| 75 | + # update dependencies and build the support modules and the ioc |
| 76 | + RUN python3 module.py dependencies |
| 77 | + RUN make -j -C ${SUPPORT}/ADGenICam-${ADGENICAM_VERSION} && \ |
| 78 | + make -j -C ${SUPPORT}/ADAravis-${ADARAVIS_VERSION} && \ |
| 79 | + make -j -C ${EPICS_ROOT}/ioc && \ |
| 80 | + make -j clean |
| 81 | +
|
| 82 | +Changes to The Template Project |
| 83 | +------------------------------- |
| 84 | + |
| 85 | +:TODO: |
| 86 | + cover details of what is needed and how module.py works |
| 87 | + don't forget to include RELEASE.shell |
| 88 | + |
| 89 | +Build and Publish the Generic IOC Image |
| 90 | +--------------------------------------- |
| 91 | + |
| 92 | +:TODO: |
| 93 | + test build locally with docker build |
| 94 | + use CI to build and Publish on GitHub |
0 commit comments