Commit f5637895 authored by Yann Garcia's avatar Yann Garcia
Browse files

add oneM2M platform support as a meep go-app but not in .meepctl-repocfg.yaml...

add oneM2M platform support as a meep go-app but not in .meepctl-repocfg.yaml because it is scenario dependant
parent 754dba80
Loading
Loading
Loading
Loading

acme @ 845d4a60

Changes for go-apps/meep-iot-pltf/acme: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
Subproject commit 845d4a60cebdd5d1535973911146b2ee8e677bba
+71 −0
Changes for go-apps/meep-iot-pltf/tinyiot/Dockerfile: 71 added lines, 0 removed lines.
Original line number Diff line number Diff line
FROM ubuntu:22.04

ENV MEEP_MEP_NAME=""
ENV HTTP_PORT=""
ENV MQTT_SERVER=""
ENV MQTT_PORT=""
ENV MEC_SANDBOX_SERVER=""
ENV MEEP_MEP_NAME=""
ENV REGISTRAR_CSE_HOST=""
ENV REGISTRAR_CSE_PORT=""

RUN echo "acme-om2m" > /etc/hostname \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
      autoconf \
      bison \
      build-essential \
      cmake \
      curl \
      dos2unix \
      doxygen \
      emacs \
      expect \
      flex \
      g++ \
      gcc \
      git \
      gnutls-bin \
      iputils-ping \
      libedit2 \
      libedit-dev \
      libffi-dev \
      libglib2.0-dev \
      libgcrypt-dev \
      libjsoncpp-dev \
      libncurses5-dev \
      libpcap-dev \
      libssl-dev \
      libtool-bin \
      libtool \
      libxml2-dev \
      libxml2-utils \
      libyaml-dev \
      lsof \
      ntp \
      pkg-config \
      sudo \
      sshpass \
      tcpdump \
      tzdata \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && DEBIAN_FRONTEND=noninteractive apt-get clean

WORKDIR /usr/src/app

RUN git clone https://github.com/seslabSJU/tinyIoT.git tinyIoT

WORKDIR /usr/src/app/ACME-tinyIoT-CSE

# The commit is aligned wuth the changes pushed by the COPY
# The issue here is that applying patch with 
#RUN git checkout 43d4c7a

COPY . /usr/src/app/tinyIoT

RUN chmod +x entrypoint.sh

ENTRYPOINT ["entrypoint.sh"]
+18 −0
Changes for go-apps/meep-iot-pltf/tinyiot/dockerize.sh: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash

# Get full path to script directory
SCRIPT=$(readlink -f "$0")
BASEDIR=$(dirname "$SCRIPT")

echo ""
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo ">>> Dockerizing tinyIoT for oneM2M"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo ""

# Dockerize demo 
docker build --no-cache --rm -t meep-docker-registry:30001/tinyiot_om2m .
docker push meep-docker-registry:30001/tinyiot_om2m

echo ""
echo ">>> tinyIoT for oneM2M dockerize completed"
+63 −0
Changes for go-apps/meep-iot-pltf/tinyiot/entrypoint.sh: 63 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
set -e

echo "MEEP_HOST_URL: ${MEEP_HOST_URL}"
echo "MEEP_SANDBOX_NAME: ${MEEP_SANDBOX_NAME}"
echo "MEEP_MEP_NAME: ${MEEP_MEP_NAME}"

if [[ ! -z "${MEEP_MEP_NAME}" ]]; then
    svcPath="${MEEP_SANDBOX_NAME}/${MEEP_MEP_NAME}"
else
    svcPath="${MEEP_SANDBOX_NAME}"
fi

if [ "${MEEP_HOST_URL}" == "" ]
then
    echo "$0: MEEP_HOST_URL parameter is not set"
    MEEP_HOST_URL=mec-platform.etsi.org
fi
if [ "${HTTP_PORT}" == "" ]
then
    echo "$0: HTTP_PORT parameter is not set"
    HTTP_PORT=31110
fi
if [ "${MQTT_SERVER}" == "" ]
then
    echo "$0: MQTT_SERVER parameter is not set"
    MQTT_SERVER=test.mosquitto.org
fi
if [ "${MQTT_PORT}" == "" ]
then
    echo "$0: MQTT_PORT parameter is not set"
    MQTT_PORT=1883
fi
if [ "${REGISTRAR_CSE_HOST}" == "" ]
then
    echo "$0: REGISTRAR_CSE_HOST parameter is not set"
    REGISTRAR_CSE_HOST=lab-oai.etsi.org
fi
if [ "${REGISTRAR_CSE_PORT}" == "" ]
then
    echo "$0: REGISTRAR_CSE_PORT parameter is not set"
    REGISTRAR_CSE_PORT=31110
fi

echo "HTTP_PORT: ${HTTP_PORT}"
echo "MQTT_SERVER: ${MQTT_SERVER}"
echo "MQTT_PORT: ${MQTT_PORT}"
echo "REGISTRAR_CSE_HOST: ${REGISTRAR_CSE_HOST}"
echo "REGISTRAR_CSE_PORT: ${REGISTRAR_CSE_PORT}"

cd /usr/src/app

sed --in-place "s/REGISTRAR_CSE_HOST/${REGISTRAR_CSE_HOST}/g" acme.ini
sed --in-place "s/REGISTRAR_CSE_PORT/${REGISTRAR_CSE_PORT}/g" acme.ini
sed --in-place "s/HTTP_PORT/${HTTP_PORT}/g" acme.ini
sed --in-place "s/MQTT_SERVER/${MQTT_SERVER}/g" acme.ini
sed --in-place "s/MQTT_PORT/${MQTT_PORT}/g" acme.ini
sed --in-place "s/MEEP_HOST_URL/${MEEP_HOST_URL}/g" acme.ini
sed --in-place "s/MEEP_SANDBOX_NAME/${MEEP_SANDBOX_NAME}/g" acme.ini

sleep 10 # Wait for ETSI MEC Platform up and stable

python3 -m acme