From 920c6bf32395afd1fc55cdaa2eba7f8c0f19676c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 15 Apr 2024 17:19:51 -0400 Subject: [PATCH 1/5] upgrade to core release-9.0.3 --- Dockerfile | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25362a2..497fb79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:22.04 LABEL maintainer "Daniel R. Kerr " ENV DEBIAN_FRONTEND noninteractive @@ -7,9 +7,9 @@ ENV TERM xterm # install core dependencies #--------------------------------------- RUN apt-get update -y \ - && apt-get install -qq -y libev-dev libpcap-dev libreadline-dev libtk-img libtool \ - && apt-get install -qq -y python3 python3-dev python3-pip python3-setuptools python3-tk \ - && apt-get install -qq -y autoconf automake gawk g++ gcc git pkg-config tk \ + && apt-get install -qq -y libev-dev libpcap-dev libreadline-dev libxml2-dev libxslt-dev libtk-img libtool \ + && apt-get install -qq -y python3 python3-dev python3-pip python3-setuptools python3-full python3-tk pipx \ + && apt-get install -qq -y autoconf automake gawk g++ gcc git pkg-config tk sudo \ && apt-get install -qq -y bridge-utils ebtables ethtool iproute2 radvd \ && apt-get clean \ && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* @@ -27,7 +27,7 @@ RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git /opt/osp --localstatedir=/var/run/quagga \ --sysconfdir=/usr/local/etc/quagga \ --with-cflags=-ggdb \ - && make \ + && make -j$(nproc) \ && make install \ && cd \ && rm -rf /opt/ospf-mdr @@ -36,34 +36,32 @@ RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git /opt/osp #--------------------------------------- RUN pip3 install --upgrade pip \ && pip3 install cython \ - && pip3 install dataclasses fabric grpcio==1.27.2 grpcio-tools==1.27.2 lxml mako netaddr netifaces Pillow poetry psutil pyyaml \ + && pip3 install dataclasses fabric grpcio==1.54.2 grpcio-tools==1.54.2 lxml mako netaddr netifaces Pillow poetry psutil pyyaml \ && pip3 install pyproj -RUN git clone -b release-7.4.0 https://github.com/coreemu/core.git /opt/core \ +RUN git clone -b release-9.0.3 https://github.com/coreemu/core.git /opt/core \ && cd /opt/core \ - && ./bootstrap.sh \ - && ./configure --prefix=/usr/local \ - && make -j$(nproc) \ - && make install \ + && ./setup.sh \ +# && source /root/.bashrc \ + && apt update \ + && inv install \ && mkdir -p /etc/core \ - && cp -n /opt/core/daemon/data/core.conf /etc/core \ - && cp -n /opt/core/daemon/data/logging.conf /etc/core \ - && cp /opt/core/daemon/scripts/core-cleanup /usr/local/bin/core-cleanup \ - && cp /opt/core/daemon/scripts/core-cli /usr/local/bin/core-cli \ - && cp /opt/core/daemon/scripts/core-daemon /usr/local/bin/core-daemon \ - && cp /opt/core/daemon/scripts/core-imn-to-xml /usr/local/bin/core-imn-to-xml \ - && cp /opt/core/daemon/scripts/core-manage /usr/local/bin/core-manage \ - && cp /opt/core/daemon/scripts/core-pygui /usr/local/bin/core-pygui \ - && cp /opt/core/daemon/scripts/core-route-monitor /usr/local/bin/core-route-monitor \ - && cp /opt/core/daemon/scripts/core-service-update /usr/local/bin/core-service-update \ - && cp /opt/core/daemon/scripts/coresendmsg /usr/local/bin/coresendmsg \ + && cp -n /opt/core/package/etc/core.conf /etc/core \ + && cp -n /opt/core/package/etc/logging.conf /etc/core \ + && cp /opt/core/venv/bin/core-cleanup /usr/local/bin/core-cleanup \ + && cp /opt/core/venv/bin/core-cli /usr/local/bin/core-cli \ + && cp /opt/core/venv/bin/core-daemon /usr/local/bin/core-daemon \ + && cp /opt/core/venv/bin/core-gui /usr/local/bin/core-gui \ + && cp /opt/core/venv/bin/core-player /usr/local/bin/core-player \ + && cp /opt/core/venv/bin/core-route-monitor /usr/local/bin/core-route-monitor \ + && cp /opt/core/venv/bin/core-service-update /usr/local/bin/core-service-update \ && cd /opt/core/daemon \ && poetry build -f wheel \ && pip3 install /opt/core/daemon/dist/* \ - && cd \ - && rm -rf /opt/core + && cd +# && rm -rf /opt/core -ENV PYTHONPATH "${PYTHONPATH}:/usr/local/lib/python3.6/site-packages" +ENV PYTHONPATH "${PYTHONPATH}:/usr/local/lib/python3.10/site-packages" # configure core #--------------------------------------- From 56424f5bf1ecf5feec5fb821cc8d87c4f27175b0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 15 Apr 2024 17:46:00 -0400 Subject: [PATCH 2/5] add docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 497fb79..638f66e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -y \ && apt-get install -qq -y libev-dev libpcap-dev libreadline-dev libxml2-dev libxslt-dev libtk-img libtool \ && apt-get install -qq -y python3 python3-dev python3-pip python3-setuptools python3-full python3-tk pipx \ && apt-get install -qq -y autoconf automake gawk g++ gcc git pkg-config tk sudo \ - && apt-get install -qq -y bridge-utils ebtables ethtool iproute2 radvd \ + && apt-get install -qq -y bridge-utils ebtables ethtool iproute2 radvd docker.io \ && apt-get clean \ && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* From 312126174e137cfdfdde45b84f026f961087a7b3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 16 Apr 2024 17:06:31 -0400 Subject: [PATCH 3/5] working with containers --- Dockerfile | 96 ++++++++++++++++++++++++++++-------------------- supervisord.conf | 5 ++- 2 files changed, 61 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index 638f66e..879b453 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,46 @@ +# syntax=docker/dockerfile:1 FROM ubuntu:22.04 LABEL maintainer "Daniel R. Kerr " +LABEL Description="CORE Docker Ubuntu Image" ENV DEBIAN_FRONTEND noninteractive ENV TERM xterm +ARG PREFIX=/usr/local +ARG BRANCH=master +ARG PROTOC_VERSION=3.19.6 +ARG ARCH=aarch_64 +#ARG ARCH=x86_64 +ARG VENV_PATH=/opt/core/venv +ENV PATH="$PATH:${VENV_PATH}/bin" +WORKDIR /opt + +# install system dependencies +#--------------------------------------- +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + git \ + sudo \ + wget \ + tzdata \ + libpcap-dev \ + libpcre3-dev \ + libprotobuf-dev \ + libxml2-dev \ + protobuf-compiler \ + unzip \ + uuid-dev \ + software-properties-common && \ + apt-get autoremove -y + # install core dependencies #--------------------------------------- RUN apt-get update -y \ && apt-get install -qq -y libev-dev libpcap-dev libreadline-dev libxml2-dev libxslt-dev libtk-img libtool \ && apt-get install -qq -y python3 python3-dev python3-pip python3-setuptools python3-full python3-tk pipx \ && apt-get install -qq -y autoconf automake gawk g++ gcc git pkg-config tk sudo \ - && apt-get install -qq -y bridge-utils ebtables ethtool iproute2 radvd docker.io \ + && apt-get install -qq -y bridge-utils ebtables ethtool iproute2 nftables radvd docker.io \ && apt-get clean \ && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* @@ -34,34 +64,33 @@ RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git /opt/osp # install core #--------------------------------------- -RUN pip3 install --upgrade pip \ - && pip3 install cython \ - && pip3 install dataclasses fabric grpcio==1.54.2 grpcio-tools==1.54.2 lxml mako netaddr netifaces Pillow poetry psutil pyyaml \ - && pip3 install pyproj - -RUN git clone -b release-9.0.3 https://github.com/coreemu/core.git /opt/core \ - && cd /opt/core \ - && ./setup.sh \ -# && source /root/.bashrc \ - && apt update \ - && inv install \ - && mkdir -p /etc/core \ - && cp -n /opt/core/package/etc/core.conf /etc/core \ - && cp -n /opt/core/package/etc/logging.conf /etc/core \ - && cp /opt/core/venv/bin/core-cleanup /usr/local/bin/core-cleanup \ - && cp /opt/core/venv/bin/core-cli /usr/local/bin/core-cli \ - && cp /opt/core/venv/bin/core-daemon /usr/local/bin/core-daemon \ - && cp /opt/core/venv/bin/core-gui /usr/local/bin/core-gui \ - && cp /opt/core/venv/bin/core-player /usr/local/bin/core-player \ - && cp /opt/core/venv/bin/core-route-monitor /usr/local/bin/core-route-monitor \ - && cp /opt/core/venv/bin/core-service-update /usr/local/bin/core-service-update \ - && cd /opt/core/daemon \ - && poetry build -f wheel \ - && pip3 install /opt/core/daemon/dist/* \ - && cd -# && rm -rf /opt/core +RUN git clone https://github.com/coreemu/core && \ + cd core && \ + git checkout ${BRANCH} && \ + ./setup.sh && \ + PATH=/root/.local/bin:$PATH inv install -v -p ${PREFIX} && \ + cd /opt && \ + rm -rf ospf-mdr -ENV PYTHONPATH "${PYTHONPATH}:/usr/local/lib/python3.10/site-packages" +# install emane +#--------------------------------------- +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip && \ + mkdir protoc && \ + unzip protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -d protoc && \ + git clone https://github.com/adjacentlink/emane.git && \ + cd emane && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j$(nproc) && \ + make install && \ + cd src/python && \ + make clean && \ + PATH=/opt/protoc/bin:$PATH make && \ + ${VENV_PATH}/bin/python -m pip install . && \ + cd /opt && \ + rm -rf protoc && \ + rm -rf emane && \ + rm -f protoc-${PROTOC_VERSION}-linux-${ARCH}.zip # configure core #--------------------------------------- @@ -74,17 +103,6 @@ RUN apt-get update -y \ && apt-get clean \ && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* -# install emanes -#--------------------------------------- -#RUN wget -O /opt/emane.tgz https://adjacentlink.com/downloads/emane/emane-1.2.5-release-1.ubuntu-18_04.amd64.tar.gz \ -# && cd /opt \ -# && tar xzf /opt/emane.tgz \ -# && cd /opt/emane-1.2.5-release-1/debs/ubuntu-18_04/amd64 \ -# && dpkg -i *.deb \ -# && apt-get install -f \ -# && cd /root \ -# && rm -rf /opt/emane.tgz /opt/emane-1.2.5-release-1 - # install and configure ssh #--------------------------------------- RUN apt-get update -y \ diff --git a/supervisord.conf b/supervisord.conf index aa5b98b..e347f38 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -1,5 +1,8 @@ [program:cored] -command=/usr/local/bin/core-daemon --grpc-address 0.0.0.0 --grpc-port 50051 +command=/opt/core/venv/bin/core-daemon --grpc-address 0.0.0.0 --grpc-port 50051 [program:sshd] command=/usr/sbin/sshd -D -e + +[program:dockerd] +command=/usr/bin/dockerd From 9baf85b1b19d2d57b7a1575746254c25f82f71e3 Mon Sep 17 00:00:00 2001 From: robertsmd Date: Wed, 17 Apr 2024 10:49:14 -0400 Subject: [PATCH 4/5] Update Dockerfile --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 879b453..bf34474 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,14 @@ ENV DEBIAN_FRONTEND noninteractive ENV TERM xterm ARG PREFIX=/usr/local -ARG BRANCH=master ARG PROTOC_VERSION=3.19.6 -ARG ARCH=aarch_64 -#ARG ARCH=x86_64 + +ARG BRANCH=master +# ARG BRANCH=release-9.0.3 + +# ARG ARCH=aarch_64 # for arm-based MacOS machines +ARG ARCH=x86_64 # for x86-based linux machines + ARG VENV_PATH=/opt/core/venv ENV PATH="$PATH:${VENV_PATH}/bin" WORKDIR /opt From 4013f83a2dcc45f9033947f90ecdbcee8e324cd1 Mon Sep 17 00:00:00 2001 From: robertsmd Date: Wed, 17 Apr 2024 10:49:40 -0400 Subject: [PATCH 5/5] pin to release-9.0.3 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf34474..b891927 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ ENV TERM xterm ARG PREFIX=/usr/local ARG PROTOC_VERSION=3.19.6 -ARG BRANCH=master -# ARG BRANCH=release-9.0.3 +# ARG BRANCH=master +ARG BRANCH=release-9.0.3 # ARG ARCH=aarch_64 # for arm-based MacOS machines ARG ARCH=x86_64 # for x86-based linux machines