rename influxdb application to influxdbApp in order to avoid confilicts on imports

This commit is contained in:
Christian Klopp 2018-06-20 12:45:31 +02:00
parent 99e895fe39
commit 482a2a0f3c
21 changed files with 93 additions and 33 deletions

View File

@ -8,8 +8,8 @@ before_script:
- "./create-binary-docker gateway -a arm"
- "./create-binary-docker orioncontextbroker"
- "./create-binary-docker orioncontextbroker -a arm"
- "./create-binary-docker influxdb"
- "./create-binary-docker influxdb -a arm"
- "./create-binary-docker influxdbapp"
- "./create-binary-docker influxdbapp -a arm"
- "./create-binary-docker cul868ipe"
- "./create-binary-docker cul868ipe -a arm"
script:
@ -17,8 +17,8 @@ script:
- docker tag openmtc/orioncontextbroker-arm openmtc/orion-context-broker-app-arm
- docker tag openmtc/cul868ipe-amd64 openmtc/cul868-ipe-amd64
- docker tag openmtc/cul868ipe-arm openmtc/cul868-ipe-arm
- docker tag openmtc/influxdb-amd64 openmtc/influxdb-app-amd64
- docker tag openmtc/influxdb-arm openmtc/influxdb-app-arm
- docker tag openmtc/influxdbapp-amd64 openmtc/influxdb-app-amd64
- docker tag openmtc/influxdbapp-arm openmtc/influxdb-app-arm
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker push openmtc/backend-amd64
- docker push openmtc/backend-arm

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
exec python -m influxdb $@

View File

@ -7,7 +7,7 @@ This App will subscribe to OpenMTC data and tranfer it to an instance of the Inf
You need a running instance of InfluxDB and configure the following parameters according to your setup.
```
apps/influx-db \
apps/influxdb-app \
--ep "http://127.0.0.1:8000" \
--influx_host "127.0.0.1" \
--influx-port "8086" \

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
exec python -m influxdbapp $@

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash
CONFIG_FILE="/etc/openmtc/influxdb/config.json"
CONFIG_FILE="/etc/openmtc/influxdbapp/config.json"
NAME=${NAME-"InfluxDB"}
NAME=${NAME-"InfluxdbApp"}
EP=${EP-"http://localhost:8000"}
CSE_BASE=${CSE_BASE-"onem2m"}
POAS=${POAS-'["http://auto:23706"]'}
@ -20,7 +20,7 @@ DBUSER=${DBUSER-"test"},
DBUSER_PW=${DBUSER_PW-"test"}
# defaults logging
LOGGING_FILE=${LOGGING_FILE-"/var/log/openmtc/influxdb.log"}
LOGGING_FILE=${LOGGING_FILE-"/var/log/openmtc/influxdbapp.log"}
LOGGING_LEVEL=${LOGGING_LEVEL-"ERROR"}
# ensure correct level
@ -40,7 +40,7 @@ HOST_NAME=${EXTERNAL_IP-${LOCAL_IP}}
# Configuration of the service.
CONFIG_TEMP=${CONFIG_FILE}".tmp"
echo -n "Configuring M2M influxdb..."
echo -n "Configuring M2M influxdbapp..."
JQ_STRING='.'
# basics
@ -70,4 +70,4 @@ mv ${CONFIG_TEMP} ${CONFIG_FILE}
echo "done"
exec python -m influxdb $@
exec python -m influxdbapp $@

View File

@ -0,0 +1,30 @@
############################################################
# Dockerfile to run openmtc influxdbapp binary
############################################################
# Set the base image to use openmtc/sdk
FROM openmtc/sdk-amd64:latest
ENV MOD_NAME=influxdbapp
# Set the file maintainer
MAINTAINER rst
# install openmtc dependencies
COPY tmp/$MOD_NAME-dependencies.txt /tmp/requirements.txt
RUN pip install --upgrade --requirement /tmp/requirements.txt
# install openmtc-influxdbapp
COPY tmp/openmtc-$MOD_NAME.tar.gz /tmp/openmtc-$MOD_NAME.tar.gz
RUN tar xzf /tmp/openmtc-$MOD_NAME.tar.gz -C / \
--owner root --group root --no-same-owner --no-overwrite-dir \
--transform 's/json\.dist/json/' --show-transformed
RUN mkdir -p /var/log/openmtc
# add change config
COPY configure-$MOD_NAME-and-start /usr/local/bin/configure-and-start
# entry point
ENTRYPOINT ["/usr/local/bin/configure-and-start"]
CMD [""]

View File

@ -0,0 +1,30 @@
############################################################
# Dockerfile to run openmtc influxdbapp binary
############################################################
# Set the base image to use openmtc/sdk
FROM openmtc/sdk-arm:latest
ENV MOD_NAME=influxdbapp
# Set the file maintainer
MAINTAINER rst
# install openmtc dependencies
COPY tmp/$MOD_NAME-dependencies.txt /tmp/requirements.txt
RUN pip install --upgrade --requirement /tmp/requirements.txt
# install openmtc-influxdbapp
COPY tmp/openmtc-$MOD_NAME.tar.gz /tmp/openmtc-$MOD_NAME.tar.gz
RUN tar xzf /tmp/openmtc-$MOD_NAME.tar.gz -C / \
--owner root --group root --no-same-owner --no-overwrite-dir \
--transform 's/json\.dist/json/' --show-transformed
RUN mkdir -p /var/log/openmtc
# add change config
COPY configure-$MOD_NAME-and-start /usr/local/bin/configure-and-start
# entry point
ENTRYPOINT ["/usr/local/bin/configure-and-start"]
CMD [""]

View File

@ -1,10 +1,10 @@
[Unit]
Description=OpenMTC InfluxDB
Description=OpenMTC InfluxdbApp
After=network.target
Wants=ntp.service
[Service]
ExecStart=/usr/local/bin/influx-db
ExecStart=/usr/local/bin/influxdb-app
[Install]
WantedBy=multi-user.target

View File

@ -8,7 +8,7 @@ import sys
from utils import get_packages, get_pkg_files, OpenMTCSdist, move_config_files
# name and dir
NAME = "influxdb"
NAME = "influxdbapp"
BASE_DIR = "."
# import pkg

View File

@ -3,7 +3,7 @@ Transfer OpenMTC Data to an InfluxDB
"""
__version__ = "0.1"
__description__ = "InfluxDB"
__description__ = "InfluxdbApp"
__author_name__ = "Christian Klopp"
__author_mail__ = "christian.klopp@fokus.fraunhofer.de"
__requires__ = ['influxdb']

View File

@ -2,17 +2,17 @@ from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
from openmtc_app.util import prepare_app, get_value
from openmtc_app.runner import AppRunner as Runner
from .influx_db import InfluxDB
from .influxdb_app import InfluxdbApp
# defaults
default_name = "InfluxDB"
default_name = "InfluxdbApp"
default_ep = "http://localhost:8000"
default_labels = []
# args parser
parser = ArgumentParser(
description="An IPE called InfluxDB",
prog="InfluxDB",
description="An IPE called InfluxdbApp",
prog="InfluxdbApp",
formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument("-n", "--name", help="Name used for the AE.")
parser.add_argument("-s", "--ep", help="URL of the local Endpoint.")
@ -47,7 +47,7 @@ db_user = get_value("db_user", (unicode, str), "test", args, config)
db_pw = get_value("db_pw", (unicode, str), "test", args, config)
# start
app = InfluxDB(
app = InfluxdbApp(
name=nm, cse_base=cb, poas=poas,
labels=lbl,
originator_pre=originator_pre,

View File

@ -2,7 +2,7 @@ from openmtc_app.onem2m import ResourceManagementXAE
from connector import InfluxDBConnector
class InfluxDB(ResourceManagementXAE):
class InfluxdbApp(ResourceManagementXAE):
def __init__(
self,
@ -17,7 +17,7 @@ class InfluxDB(ResourceManagementXAE):
*args,
**kw
):
super(InfluxDB, self).__init__(*args, **kw)
super(InfluxdbApp, self).__init__(*args, **kw)
if isinstance(labels, basestring):
self.labels = {labels}
elif hasattr(labels, '__iter__') and len(labels):

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
cd $(dirname ${0})
. ./prep-env.sh
cd InfluxDB
PYTHONPATH=${PYTHONPATH}:src exec python -m influxdb $@

9
apps/influxdb-app Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
cd $(dirname ${0})
. ./prep-env.sh
cd InfluxdbApp
PYTHONPATH=${PYTHONPATH}:src exec python -m influxdbapp $@