Skip to content

Commit

Permalink
base: Added OPCUA and ether_ip IOC
Browse files Browse the repository at this point in the history
- Added opca and ether_ip IOC to epics-in-docker.
- New path for iocs built in epics-in-docker (opt/epics/iocs).
  • Loading branch information
guirodrigueslima committed Apr 15, 2024
1 parent ae16cc4 commit f983b12
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 14 deletions.
8 changes: 6 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions base/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt update -y && \
libtiff-dev \
libusb-1.0-0-dev \
libxml2-dev \
libssl-dev \
re2c \
wget \
ca-certificates
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions base/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
18 changes: 9 additions & 9 deletions base/install-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get_module_path() {
done
}

download_github() {
download_from_github() {
github_org=$1
module_name=$2
commit=$3
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion base/install_area_detector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
21 changes: 21 additions & 0 deletions base/install_iocs.sh
Original file line number Diff line number Diff line change
@@ -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
"
2 changes: 1 addition & 1 deletion base/install_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
"
Expand Down
2 changes: 1 addition & 1 deletion base/install_motor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f983b12

Please sign in to comment.