From 53c4222dfa4c2bb785f0be6b7b3ec6e84834dbe8 Mon Sep 17 00:00:00 2001 From: Guilherme Rodrigues de Lima Date: Wed, 24 Jul 2024 11:16:27 -0300 Subject: [PATCH] base: add SNMP module. Over time, several SNMP device support have been implemented, most (or all) of them derived from DESY's implementation, including one from Sheng Peng, Diamond's and NSCL/FRIB. By 2013, most were willing to test NSCL/FRIB's implementation or to switch to it [1]. Advantages by then were: - no memory leak (opposed to Sheng Peng's implementation) - easier to work with (compared to original DESY implementation) - supports SNMP writes (compared to Sheng's) - depends more heavily on libsnmp (compared to Diamond's implementation) Nowadays, Sheng Peng's implementation seems not to be developed anymore, as well as Diamond's. From all forks, NSCL/FRIB and SLAC are still around [2]. Between the two, slac-epics/snmp has been preferred over NSCL/FRIB module [3] (also forked in slac-epics/epics-snmp [4]) to be used here due to: - more record types being supported by the device support, including mbbo [5, 6], which is interesting for our IOCs; - its simpler repository structure and configuration, which can be easily integrated in our build system. Changing from one implementation to the other is a matter of changing the record DTYP used and restricting to the subset of supported record types. Beyond that, record API is the same. Therefore, changing the implementation in the future does have costs, but it should not be very high. Co-authored-by: Henrique F. Simoes [1]: https://epics.anl.gov/tech-talk/2013/msg00537.php [2]: https://epics.anl.gov/tech-talk/2024/msg00889.php [3]: https://groups.nscl.msu.edu/controls/files/devSnmp.html [4]: https://github.com/slac-epics/epics-snmp [5]: https://github.com/slac-epics/snmp/blob/134fbfd91ac83974730093330781cd1217017382/devSnmpApp/src/devSnmp.dbd [6]: https://github.com/slac-epics/epics-snmp/blob/12a9cfa7b5b07bee17ae8ba7a74b460dd72811e6/snmpApp/src/devSnmp.dbd --- CHANGES.md | 2 ++ base/.env | 1 + base/Dockerfile | 2 ++ base/docker-compose.yml | 1 + base/install_modules.sh | 4 ++++ base/musl/Dockerfile | 2 ++ base/musl/docker-compose.yml | 1 + 7 files changed, 13 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index bc4a688..4123797 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,8 @@ https://github.com/cnpem/epics-in-docker/pull/62 * base: add pyDevSup module. by @gustavosr8 in https://github.com/cnpem/epics-in-docker/pull/62 +* base: add SNMP module. by @guirodrigueslima in + https://github.com/cnpem/epics-in-docker/pull/67 ## v0.8.1 diff --git a/base/.env b/base/.env index eda31a1..d819b9f 100644 --- a/base/.env +++ b/base/.env @@ -19,6 +19,7 @@ ETHER_IP_VERSION=ether_ip-3-3 IOCSTATS_VERSION=3.2.0 IPMICOMM_VERSION=R4.6.0 PYDEVSUP_VERSION=1.2 +SNMP_VERSION=R2.5 AREA_DETECTOR_VERSION=R3-12-1 NDSSCPIMEGA_VERSION=1.0.0 diff --git a/base/Dockerfile b/base/Dockerfile index 0eec1f9..0a532cc 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -17,6 +17,7 @@ RUN apt update -y && \ libtiff-dev \ libusb-1.0-0-dev \ libxml2-dev \ + libsnmp-dev \ libssl-dev \ re2c \ wget \ @@ -57,6 +58,7 @@ ARG ETHER_IP_VERSION ARG IOCSTATS_VERSION ARG IPMICOMM_VERSION ARG PYDEVSUP_VERSION +ARG SNMP_VERSION COPY ipmicomm.patch . COPY caputlog-waveform-fix.patch . diff --git a/base/docker-compose.yml b/base/docker-compose.yml index b7f258a..c79b805 100644 --- a/base/docker-compose.yml +++ b/base/docker-compose.yml @@ -28,6 +28,7 @@ services: IOCSTATS_VERSION: ${IOCSTATS_VERSION} IPMICOMM_VERSION: ${IPMICOMM_VERSION} PYDEVSUP_VERSION: ${PYDEVSUP_VERSION} + SNMP_VERSION: ${SNMP_VERSION} AREA_DETECTOR_VERSION: ${AREA_DETECTOR_VERSION} NDSSCPIMEGA_VERSION: ${NDSSCPIMEGA_VERSION} LIBSSCPIMEGA_VERSION: ${LIBSSCPIMEGA_VERSION} diff --git a/base/install_modules.sh b/base/install_modules.sh index 9a7b222..3c30dca 100755 --- a/base/install_modules.sh +++ b/base/install_modules.sh @@ -81,3 +81,7 @@ echo PYTHON=python3 >> pyDevSup/configure/CONFIG_SITE install_module pyDevSup PYDEVSUP " EPICS_BASE " + +install_from_github slac-epics snmp SNMP $SNMP_VERSION " +EPICS_BASE +" diff --git a/base/musl/Dockerfile b/base/musl/Dockerfile index 6abc3aa..34d5b57 100644 --- a/base/musl/Dockerfile +++ b/base/musl/Dockerfile @@ -15,6 +15,7 @@ RUN apk add --no-cache \ make \ musl-dev \ ncurses-terminfo \ + net-snmp-dev \ patch \ perl \ rpcsvc-proto \ @@ -57,6 +58,7 @@ ARG ETHER_IP_VERSION ARG IOCSTATS_VERSION ARG IPMICOMM_VERSION ARG PYDEVSUP_VERSION +ARG SNMP_VERSION WORKDIR ${EPICS_MODULES_PATH} COPY ipmicomm.patch . diff --git a/base/musl/docker-compose.yml b/base/musl/docker-compose.yml index 0afbb41..dc1beba 100644 --- a/base/musl/docker-compose.yml +++ b/base/musl/docker-compose.yml @@ -28,3 +28,4 @@ services: IOCSTATS_VERSION: ${IOCSTATS_VERSION} IPMICOMM_VERSION: ${IPMICOMM_VERSION} PYDEVSUP_VERSION: ${PYDEVSUP_VERSION} + SNMP_VERSION: ${SNMP_VERSION}