From a09d6eb55a1559408fe18a0fe6aef7e0f4b3b40c Mon Sep 17 00:00:00 2001 From: Benny Itkin Date: Sun, 18 Feb 2024 21:18:48 +0200 Subject: [PATCH] WIP: remove ofed from NDT plugin --- plugins/UFM_NDT_Plugin/build/Dockerfile | 34 +++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/plugins/UFM_NDT_Plugin/build/Dockerfile b/plugins/UFM_NDT_Plugin/build/Dockerfile index 788df21e4..46ce7dbd5 100644 --- a/plugins/UFM_NDT_Plugin/build/Dockerfile +++ b/plugins/UFM_NDT_Plugin/build/Dockerfile @@ -1,14 +1,15 @@ FROM ubuntu:20.04 AS ndt_base_ubuntu20 -ENV TZ=Europe/Moscow -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -ARG MOFED_VER=5.9-0.5.6.0 -ARG MOFED_DIR=MLNX_OFED_LINUX-${MOFED_VER}-ubuntu20.04-x86_64 - +LABEL maintainer="atolikin@nvidia.com" +ARG _ARCH=x86_64 +ARG _DIST=ubuntu20.04 +ARG _OFED_VER=5.9-0.5.6.0 +ARG OFED_URL=http://nbu-nfs.mellanox.com/auto/sw/release/mlnx_ofed/MLNX_OFED/MLNX_OFED_LINUX-${_OFED_VER}/MLNX_OFED_LINUX-${_OFED_VER}-${_DIST}-${_ARCH}/DEBS +ARG NDT_OFED_DEP="libibumad3 libibverbs1 ibverbs-providers " ARG BASE_PATH=/opt/ufm/ufm_plugin_ndt -LABEL maintainer="atolikin@nvidia.com" +ENV TZ=Europe/Moscow +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && apt upgrade -y && apt-get -y install supervisor python3 python3-pip rsyslog mc wget cron logrotate vim libcap2 curl sudo @@ -24,14 +25,15 @@ COPY config/ndt_httpd_proxy.conf config/ndt.conf config/ufm_plugin_ndt_httpd.con RUN /ui_build.sh -RUN echo "wget -q https://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VER}/${MOFED_DIR}.tgz" -# Install OFED -RUN wget -q https://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VER}/${MOFED_DIR}.tgz && \ - tar xf ${MOFED_DIR}.tgz && \ - rm -f ${MOFED_DIR}.tgz && \ - cd ${MOFED_DIR} && \ - ./mlnxofedinstall --without-fw-update --user-space-only --skip-distro-check --skip-unsupported-devices-check --force && \ - cd ../ && \ - rm -rf ${MOFED_DIR} +RUN echo "Download ibdiagnet (${NDT_OFED_DEP}}) from mofed (${_OFED_VER}}) repo" && \ + mkdir /tmp/ofed_temp && pushd /tmp/ofed_temp && \ + # mofed deb is not a proper repository so cannot be added as a repo but needs to be downloaded and installed manually \ + for pkg in ${NDT_OFED_DEP}; do \ + full_pkg_name=$(curl ${OFED_URL}/ 2>&1| sed -n "s/.*>\s*\(${pkg}_.*deb\)<.*/\1/p" ); \ + curl ${OFED_URL}/${full_pkg_name} -O; \ + done && \ + apt-get install -y ./* && \ + popd && \ + rm -rf /tmp/ofed_temp CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]