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

Align ACME support on TinyIoT support; Add meep-cloud-mosquitto to deploy 2...

Align ACME support on TinyIoT support; Add meep-cloud-mosquitto to deploy 2 different MQTT broker into the same scenario
parent 72741081
Loading
Loading
Loading
Loading

acme @ 845d4a60

Changes for go-apps/meep-iot-pltf/acme: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
Subproject commit 845d4a60cebdd5d1535973911146b2ee8e677bba
+0 −69
Changes for go-apps/meep-iot-pltf/in-cse/Dockerfile: 0 added lines, 69 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 MQTT_ENABLE=""

RUN echo "in-cse" > /etc/hostname \
    && 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 \
      jq \
      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 \
      python3-dev \
      python3-pip \
      python3-setuptools \
      sudo \
      sshpass \
      tcpdump \
      tzdata \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && DEBIAN_FRONTEND=noninteractive apt-get clean \
    && pip3 install --no-cache-dir --upgrade pip

WORKDIR /usr/src/app

RUN git clone --branch development https://github.com/ankraft/ACME-oneM2M-CSE.git ACME-oneM2M-CSE

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

COPY ./data /usr/src/app/ACME-oneM2M-CSE

RUN chmod +x entrypoint.sh \
  && pip3 install --no-cache-dir -r requirements.txt

ENTRYPOINT ["./entrypoint.sh"]
+0 −58
Changes for go-apps/meep-iot-pltf/in-cse/acme.ini: 0 added lines, 58 removed lines.
Original line number Diff line number Diff line
; /home/etsi/frameworks/ACME-oneM2M-CSE/acme.ini
;
; Auto-generated configuration file for the [ACME] CSE.
;
; This file was created by the on-boarding process and can be modified manually by
; editing the values below, or by adding new sections to override the default values.
;
; The file is in the INI format. Lines starting with a semicolon (;) are comments.
; The configuration is divided into sections, each section starting with a section
; name in square brackets ([section.name]). The section name is followed by a list
; of key-value pairs, one per line, in the format key=value. The key and value are
; separated by an equal sign (=).
; 
; created: 2024-11-21 06:28:46
;
; CSE type: IN
; Environment: Development
;

[basic.config]
cseType=IN
cseID=id-in
cseName=cse-in
adminID=CAdmin
networkInterface=0.0.0.0
cseHost=${hostIPAddress}
httpPort=HTTP_PORT
databaseType=memory
logLevel=debug
consoleTheme=dark

[mqtt]
enable = MQTT_ENABLE
address = MQTT_SERVER
port = MQTT_PORT
listenIF = 0.0.0.0

[cse.registration]
; Edit this to add more allowed originators.
allowedCSROriginators=laboai-id-in,acme-mep-id-mn-cse,id-in,id-mn,id-asn

[textui]
startWithTUI=false

[cse.operation.requests]
enable=true

[http]
enableUpperTesterEndpoint=true
enableStructureEndpoint=true

[coap]
enable=true
port=5683

[websocket]
enable=true
port=8180
+0 −36
Changes for go-apps/meep-iot-pltf/in-cse/entrypoint.sh: 0 added lines, 36 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
set -e

echo "MEEP_HOST_URL: ${MEEP_HOST_URL}"
SERVER_IP="${MEEP_HOST_URL#http://}"; MEEP_HOST_URL="${MEEP_HOST_URL#https://}"

SERVICE_NAME="meep-mosquitto"
# Get the namespace from the service account
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
# Get the token from the service account
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
# NODE PORT
MOSQUITTO_NODE_PORT=$(curl -sSk \
  -H "Authorization: Bearer $TOKEN" \
  https://kubernetes.default.svc/api/v1/namespaces/$NAMESPACE/services/$SERVICE_NAME \
  | jq -r '.spec.ports[0].nodePort')
echo "External NodePort exposed for service [$SERVICE_NAME] in namespace [$NAMESPACE] is: $MOSQUITTO_NODE_PORT"

HTTP_PORT=${HTTP_PORT:-3003}
MQTT_SERVER=${SERVER_IP}
MQTT_PORT=${MOSQUITTO_NODE_PORT}
MQTT_ENABLE=${MQTT_ENABLE:-True}

echo "HTTP_PORT: ${HTTP_PORT}"
echo "MQTT_SERVER: ${MQTT_SERVER}"
echo "MQTT_PORT: ${MQTT_PORT}"
echo "MQTT_ENABLE: ${MQTT_ENABLE}"

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/MQTT_ENABLE/${MQTT_ENABLE}/g" acme.ini

sleep 10 # Wait for ETSI MEC Platform up and stable

python3 -m acme