From f983b12c2759be85b962f4e52c0df7abc18f9bbc Mon Sep 17 00:00:00 2001 From: Guilherme Rodrigues de Lima Date: Fri, 12 Apr 2024 09:37:41 -0300 Subject: [PATCH] base: Added OPCUA and ether_ip IOC - Added opca and ether_ip IOC to epics-in-docker. - New path for iocs built in epics-in-docker (opt/epics/iocs). --- CHANGES.md | 8 ++++++-- base/.env | 3 +++ base/Dockerfile | 11 +++++++++++ base/docker-compose.yml | 2 ++ base/install-functions.sh | 18 +++++++++--------- base/install_area_detector.sh | 2 +- base/install_iocs.sh | 21 +++++++++++++++++++++ base/install_modules.sh | 2 +- base/install_motor.sh | 2 +- 9 files changed, 55 insertions(+), 14 deletions(-) create mode 100755 base/install_iocs.sh diff --git a/CHANGES.md b/CHANGES.md index 6a9aef7..cdbc6e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,8 +8,12 @@ https://github.com/cnpem/epics-in-docker/pull/42 * ci: add reusable job for IOC images. by @ericonr in https://github.com/cnpem/epics-in-docker/pull/49 -* base: Created a new install_iocs() function and changed the function - name structure. by @guirodrigueslima in +* base: new functionality for installing iocs, this feature was + created to add default iocs to the epics-in-docker image and + be exported in the future as no-build, with this feature it was + necessary to change some function name structures in the + install-functions.sh file. + added OPCUA and ether_ip IOC. by @guirodrigueslima in https://github.com/cnpem/epics-in-docker/pull/57 ### Bug fixes diff --git a/base/.env b/base/.env index ee947ff..d089510 100644 --- a/base/.env +++ b/base/.env @@ -23,3 +23,6 @@ MOTOR_VERSION=R7-3-1 PMAC_VERSION=2-6-1 LIBSSCPIMEGA_VERSION=fb8acf533a7c01b5266bf32d60d1a5f923e19523 + +OPCUA_VERSION=0.9.4 +ETHER_IP_VERSION=ether_ip-3-3 diff --git a/base/Dockerfile b/base/Dockerfile index 1cbf43c..d540741 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -17,6 +17,7 @@ RUN apt update -y && \ libtiff-dev \ libusb-1.0-0-dev \ libxml2-dev \ + libssl-dev \ re2c \ wget \ ca-certificates @@ -27,6 +28,7 @@ COPY lnls-run.sh /usr/local/bin/lnls-run ARG EPICS_BASE_VERSION ENV EPICS_BASE_PATH /opt/epics/base ENV EPICS_MODULES_PATH /opt/epics/modules +ENV EPICS_IOCS_PATH /opt/epics/iocs ENV EPICS_RELEASE_FILE /opt/epics/RELEASE WORKDIR /opt/epics @@ -36,6 +38,7 @@ COPY backport-epics-base-musl.patch . COPY install_epics.sh . RUN ./install_epics.sh +ARG DEBIAN_VERSION ARG PVXS_VERSION ARG SEQUENCER_VERSION ARG CALC_VERSION @@ -66,3 +69,11 @@ RUN ./install_area_detector.sh COPY install_motor.sh . RUN ./install_motor.sh + +ARG OPCUA_VERSION +ARG ETHER_IP_VERSION + +WORKDIR ${EPICS_IOCS_PATH} + +COPY install_iocs.sh . +RUN ./install_iocs.sh diff --git a/base/docker-compose.yml b/base/docker-compose.yml index 16e8757..7469a01 100644 --- a/base/docker-compose.yml +++ b/base/docker-compose.yml @@ -29,3 +29,5 @@ services: PMAC_VERSION: ${PMAC_VERSION} LIBSSCPIMEGA_VERSION: ${LIBSSCPIMEGA_VERSION} RETOOLS_VERSION: ${RETOOLS_VERSION} + OPCUA_VERSION: ${OPCUA_VERSION} + ETHER_IP_VERSION: ${ETHER_IP_VERSION} diff --git a/base/install-functions.sh b/base/install-functions.sh index 74a3499..bfcf4c7 100644 --- a/base/install-functions.sh +++ b/base/install-functions.sh @@ -6,7 +6,7 @@ get_module_path() { done } -download_github() { +download_from_github() { github_org=$1 module_name=$2 commit=$3 @@ -36,12 +36,12 @@ install_module() { cd - } -install_iocs() { - iocs_name=$1 +install_ioc() { + ioc_name=$1 dependency_name=$2 release_modules="$3" - cd $iocs_name + cd $ioc_name get_module_path "$release_modules" > configure/RELEASE make -j${JOBS} install @@ -52,8 +52,8 @@ install_iocs() { # Install module from GitHub tagged versions or URL install_github() { if [ "$1" == "-i" ] - then iocs=1; shift - else iocs=0 + then is_ioc=true; shift + else is_ioc=false fi github_org=$1 @@ -62,9 +62,9 @@ install_github() { tag=$4 release_content="$5" - download_github $github_org $module_name $tag - if [[ iocs -eq 1 ]] - then install_iocs $module_name $dependency_name "$release_content" + download_from_github $github_org $module_name $tag + if $is_ioc + then install_ioc $module_name $dependency_name "$release_content" else install_module $module_name $dependency_name "$release_content" fi diff --git a/base/install_area_detector.sh b/base/install_area_detector.sh index 182352e..ef9cff4 100755 --- a/base/install_area_detector.sh +++ b/base/install_area_detector.sh @@ -99,7 +99,7 @@ make clean cd .. -download_github cnpem ssc-pimega $LIBSSCPIMEGA_VERSION +download_from_github cnpem ssc-pimega $LIBSSCPIMEGA_VERSION make -C ssc-pimega/c install install_github cnpem NDSSCPimega NDSSCPIMEGA $NDSSCPIMEGA_VERSION " diff --git a/base/install_iocs.sh b/base/install_iocs.sh new file mode 100755 index 0000000..e28af8a --- /dev/null +++ b/base/install_iocs.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -ex + +. /opt/epics/install-functions.sh + +#Build OPCUA IOC +lnls-get-n-unpack -l https://github.com/epics-modules/opcua/releases/download/v${OPCUA_VERSION}/IOC_opcua-${OPCUA_VERSION}_Base-${EPICS_BASE_VERSION}_debian${DEBIAN_VERSION%.*}.tar.gz +mv binaryOpcuaIoc opcua + +install_ioc opcua OPCUA " +EPICS_BASE +" + +EPICS_HOST_ARCH=`perl ${EPICS_BASE_PATH}/lib/perl/EpicsHostArch.pl` +ln -s ${EPICS_IOCS_PATH}/opcua/{opcuaIocApp/libopcua.so.0.9,lib/${EPICS_HOST_ARCH}/libopcua.so} + +#Build ether_ip IOC +install_github -i epics-modules ether_ip ETHER_IP $ETHER_IP_VERSION " +EPICS_BASE +" diff --git a/base/install_modules.sh b/base/install_modules.sh index 5386a63..403c173 100755 --- a/base/install_modules.sh +++ b/base/install_modules.sh @@ -43,7 +43,7 @@ EPICS_BASE SNCSEQ " -download_github ChannelFinder recsync $RECCASTER_VERSION +download_from_github ChannelFinder recsync $RECCASTER_VERSION install_module recsync/client RECCASTER " EPICS_BASE " diff --git a/base/install_motor.sh b/base/install_motor.sh index a027dd1..4db1f1e 100755 --- a/base/install_motor.sh +++ b/base/install_motor.sh @@ -39,7 +39,7 @@ make clean cd $EPICS_MODULES_PATH -download_github dls-controls pmac $PMAC_VERSION +download_from_github dls-controls pmac $PMAC_VERSION rm pmac/configure/RELEASE.local.linux-x86_64 rm pmac/configure/RELEASE.linux-x86_64.Common