Skip to content

Commit

Permalink
feat: Add new app-service: app-service-external-mqtt-trigger for TAF …
Browse files Browse the repository at this point in the history
…test

Signed-off-by: Cherry Wang <cherry@iotechsys.com>
  • Loading branch information
cherrycl committed Oct 20, 2021
1 parent 868db09 commit 41d885a
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 7 deletions.
25 changes: 22 additions & 3 deletions compose-builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define OPTIONS
- zmq-bus mqtt-bus mqtt-broker -
- taf-secty taf-no-secty taf-perf taf-perf-no-secty -
- ds-bacnet ds-camera ds-grove ds-modbus ds-mqtt ds-rest ds-snmp ds-virtual ds-llrp ds-coap ds-gpio -
- asc-http asc-mqtt asc-sample as-llrp -
- asc-http asc-mqtt asc-sample as-llrp asc-ex-mqtt -
- modbus-sim ui -
endef
export OPTIONS
Expand Down Expand Up @@ -388,6 +388,21 @@ ifeq (as-llrp, $(filter as-llrp,$(ARGS)))
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file)
endif
endif
ifeq (asc-ex-mqtt, $(filter asc-external-mqtt-trigger,$(ARGS)))
COMPOSE_FILES:=$(COMPOSE_FILES) -f add-asc-external-mqtt-trigger.yml
ifneq (no-secty, $(filter no-secty,$(ARGS)))
ifeq ($(TOKEN_LIST),"")
TOKEN_LIST:=app-external-mqtt-trigger
else
TOKEN_LIST:=$(TOKEN_LIST),app-external-mqtt-trigger
endif
# when no security mode (no-secty) not explicitly specified,
# then we also need to add the secure version on top of base yml by default.
extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-service-external-mqtt-trigger \
app-external-mqtt-trigger app-service-configurable)
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file)
endif
endif

# Add a MQTT Broker
ifeq (mqtt-broker, $(filter mqtt-broker,$(ARGS)))
Expand Down Expand Up @@ -426,7 +441,7 @@ endif

# Build compose for TAF secure testing (ignore all other compose file options)
ifeq (taf-secty, $(filter taf-secty,$(ARGS)))
TOKEN_LIST:=app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus
TOKEN_LIST:=app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus,app-external-mqtt-trigger
# Note that the services in this list should be separated by ';', but that causes issues with build scripts, so
# have to list them individually.
KNOWN_SECRETS_LIST:=redisdb[app-rules-engine],redisdb[app-http-export],redisdb[app-mqtt-export],redisdb[scalability-test-mqtt-export],redisdb[device-modbus],redisdb[device-rest],redisdb[device-virtual]
Expand All @@ -439,6 +454,7 @@ ifeq (taf-secty, $(filter taf-secty,$(ARGS)))
-f add-taf-app-services-secure.yml \
-f add-asc-http-export.yml \
-f add-asc-mqtt-export.yml \
-f add-asc-external-mqtt-trigger.yml \
-f add-device-virtual.yml \
-f add-device-rest.yml \
-f add-device-modbus.yml \
Expand All @@ -464,14 +480,16 @@ ifeq (taf-secty, $(filter taf-secty,$(ARGS)))
app-http-export app-service-configurable)
asc_mqtt_export_ext:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-service-mqtt-export \
app-mqtt-export app-service-configurable)
asc_external_mqtt_trigger_ext:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-service-external-mqtt-trigger \
app-external-mqtt-trigger app-service-configurable)
ds_rest_ext:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-rest)
# taf has its special place holder from taf-device-services-mods and thus we need to keep it
# and extend security related things on top of it
ds_virtual_ext:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-virtual \
device-virtual device-virtual ' -cp=consul.http:\/\/edgex-core-consul:8500 --registry --confdir=CONF_DIR_PLACE_HOLDER')
ds_modbus_ext:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-modbus \
device-modbus device-modbus ' -cp=consul.http:\/\/edgex-core-consul:8500 --registry --confdir=CONF_DIR_PLACE_HOLDER')
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(asc_http_export_ext) -f $(asc_mqtt_export_ext)
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(asc_http_export_ext) -f $(asc_mqtt_export_ext) -f $(asc_external_mqtt_trigger_ext)
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(ds_virtual_ext) -f $(ds_rest_ext) -f $(ds_modbus_ext)
else
# Build compose for TAF non-secure testing (ignore all other compose file options)
Expand All @@ -481,6 +499,7 @@ else
-f add-taf-app-services.yml \
-f add-asc-http-export.yml \
-f add-asc-mqtt-export.yml \
-f add-asc-external-mqtt-trigger.yml \
-f add-device-virtual.yml \
-f add-device-rest.yml \
-f add-device-modbus.yml \
Expand Down
6 changes: 6 additions & 0 deletions compose-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ This folder contains the following compose files:
Application Service Configurable **extending** compose file, which adds the **App Service MQTT Export** service.
- **add-app-rfid-llrp-inventory.yml**
Application Service Configurable **extending** compose file, which adds the **App RFID LLRP Inventory** service.
- **add-asc-external-mqtt-trigger.yml**
Application Service Configurable **extending** compose file, which adds the **App Service External MQTT Trigger** service.
- **add-service-secure-template.yml**
A template for a single service **extending** compose file from its base service for security mode,
and the service is enabled with secret store by default.
Expand Down Expand Up @@ -184,6 +186,7 @@ Options:
asc-mqtt: Runs with App Service MQTT Export included
asc-sample: Runs with App Service Sample included
as-llrp: Runs with App RFID LLRP Inventory included
asc-ex-mqtt: Runs with App Service External MQTT Trigger included
mqtt-broker: Runs with a MQTT Broker service included
mqtt-bus: Runs with services configure for MQTT Message Bus
zmq-bus: Runs with services configure for ZMQ Message Bus
Expand Down Expand Up @@ -223,6 +226,7 @@ Options:
asc-mqtt: Pull includes App Service MQTT Export
asc-sample: Pull includes App Service Sample
as-llrp: Pull includes App RFID LLRP Inventory
asc-ex-mqtt: Pull includes App Service External MQTT Trigger
mqtt-broker: Pull includes MQTT Broker service
mqtt-bus: Pull includes additional services for MQTT Message Bus
zmq-bus: Pull includes additional services for ZMQ Message Bus
Expand Down Expand Up @@ -259,6 +263,7 @@ Options:
asc-mqtt: Generates compose file with App Service MQTT Export included
asc-sample: Generates compose file with App Service Sample included
as-llrp: Generates compose file with App RFID LLRP Inventory included
asc-ex-mqtt: Generates compose file with App Service External MQTT Trigger included
mqtt-broker: Generates compose file with a MQTT Broker service included
mqtt-bus: Generates compose file with services configured for MQTT Message Bus
The MQTT Broker service is also included.
Expand Down Expand Up @@ -337,6 +342,7 @@ Options:
asc-mqtt: Generates compose file with App Service MQTT Export included
asc-sample: Generates compose file with App Service S included
as-llrp: Generates compose file with App RFID LLRP Inventory included
asc-ex-mqtt: Generates compose file with App Service External MQTT Trigger included
mqtt-broker: Generates compose file with a MQTT Broker service included
mqtt-bus: Generates compose file with services configure for MQTT Message Bus
The MQTT Broker service is also included.
Expand Down
44 changes: 44 additions & 0 deletions compose-builder/add-asc-external-mqtt-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# /*******************************************************************************
# * Copyright 2021 Intel Corporation.
# *
# * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# * in compliance with the License. You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software distributed under the License
# * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# * or implied. See the License for the specific language governing permissions and limitations under
# * the License.
# *
# *******************************************************************************/

version: '3.7'

services:
app-service-external-mqtt-trigger:
image: ${APP_SVC_REPOSITORY}/app-service-configurable${ARCH}:${APP_SERVICE_CONFIG_VERSION}${APP_SVC_DEV}
ports:
- 127.0.0.1:59706:59706/tcp
container_name: edgex-app-external-mqtt-trigger
hostname: edgex-app-external-mqtt-trigger
env_file:
- common.env
- asc-common.env
environment:
SERVICE_HOST: edgex-app-external-mqtt-trigger
EDGEX_PROFILE: external-mqtt-trigger
TRIGGER_EXTERNALMQTT_URL: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_TOPIC: edgex-export
WRITABLE_LOGLEVEL: INFO
depends_on:
- consul
- data
read_only: true
restart: always
networks:
- edgex-network
security_opt:
- no-new-privileges:true
user: "${EDGEX_USER}:${EDGEX_GROUP}"
66 changes: 64 additions & 2 deletions taf/docker-compose-taf-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,68 @@ networks:
edgex-network:
driver: bridge
services:
app-service-external-mqtt-trigger:
command: /app-service-configurable -cp=consul.http://edgex-core-consul:8500 --registry
--confdir=/res
container_name: edgex-app-external-mqtt-trigger
depends_on:
- consul
- data
- security-bootstrapper
entrypoint:
- /edgex-init/ready_to_run_wait_install.sh
environment:
API_GATEWAY_HOST: edgex-kong
API_GATEWAY_STATUS_PORT: '8100'
CLIENTS_CORE_COMMAND_HOST: edgex-core-command
CLIENTS_CORE_DATA_HOST: edgex-core-data
CLIENTS_CORE_METADATA_HOST: edgex-core-metadata
CLIENTS_SUPPORT_NOTIFICATIONS_HOST: edgex-support-notifications
CLIENTS_SUPPORT_SCHEDULER_HOST: edgex-support-scheduler
DATABASES_PRIMARY_HOST: edgex-redis
DATABASE_HOST: edgex-redis
EDGEX_PROFILE: external-mqtt-trigger
EDGEX_SECURITY_SECRET_STORE: "true"
PROXY_SETUP_HOST: edgex-security-proxy-setup
REGISTRY_HOST: edgex-core-consul
SECRETSTORE_HOST: edgex-vault
SECRETSTORE_PORT: '8200'
SERVICE_HOST: edgex-app-external-mqtt-trigger
STAGEGATE_BOOTSTRAPPER_HOST: edgex-security-bootstrapper
STAGEGATE_BOOTSTRAPPER_STARTPORT: '54321'
STAGEGATE_DATABASE_HOST: edgex-redis
STAGEGATE_DATABASE_PORT: '6379'
STAGEGATE_DATABASE_READYPORT: '6379'
STAGEGATE_KONGDB_HOST: edgex-kong-db
STAGEGATE_KONGDB_PORT: '5432'
STAGEGATE_KONGDB_READYPORT: '54325'
STAGEGATE_READY_TORUNPORT: '54329'
STAGEGATE_REGISTRY_HOST: edgex-core-consul
STAGEGATE_REGISTRY_PORT: '8500'
STAGEGATE_REGISTRY_READYPORT: '54324'
STAGEGATE_SECRETSTORESETUP_HOST: edgex-security-secretstore-setup
STAGEGATE_SECRETSTORESETUP_TOKENS_READYPORT: '54322'
STAGEGATE_WAITFOR_TIMEOUT: 60s
TRIGGER_EDGEXMESSAGEBUS_PUBLISHHOST_HOST: edgex-redis
TRIGGER_EDGEXMESSAGEBUS_SUBSCRIBEHOST_HOST: edgex-redis
TRIGGER_EXTERNALMQTT_URL: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_LOGLEVEL: INFO
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_TOPIC: edgex-export
hostname: edgex-app-external-mqtt-trigger
image: nexus3.edgexfoundry.org:10004/app-service-configurable-arm64:latest
networks:
edgex-network: {}
ports:
- 127.0.0.1:59706:59706/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
volumes:
- edgex-init:/edgex-init:ro,z
- /tmp/edgex/secrets/app-external-mqtt-trigger:/tmp/edgex/secrets/app-external-mqtt-trigger:ro,z
app-service-functional-tests:
command: /app-service-configurable -cp=consul.http://edgex-core-consul:8500 --registry
--confdir=/res
Expand Down Expand Up @@ -330,7 +392,7 @@ services:
entrypoint:
- /edgex-init/consul_wait_install.sh
environment:
ADD_REGISTRY_ACL_ROLES: app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus
ADD_REGISTRY_ACL_ROLES: app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus,app-external-mqtt-trigger
API_GATEWAY_HOST: edgex-kong
API_GATEWAY_STATUS_PORT: '8100'
EDGEX_GROUP: '2001'
Expand Down Expand Up @@ -1134,7 +1196,7 @@ services:
- vault
environment:
ADD_KNOWN_SECRETS: redisdb[app-rules-engine],redisdb[app-http-export],redisdb[app-mqtt-export],redisdb[scalability-test-mqtt-export],redisdb[device-modbus],redisdb[device-rest],redisdb[device-virtual]
ADD_SECRETSTORE_TOKENS: app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus
ADD_SECRETSTORE_TOKENS: app-http-export,app-mqtt-export,app-functional-tests,scalability-test-mqtt-export,device-modbus,app-external-mqtt-trigger
API_GATEWAY_HOST: edgex-kong
API_GATEWAY_STATUS_PORT: '8100'
EDGEX_GROUP: '2001'
Expand Down
34 changes: 34 additions & 0 deletions taf/docker-compose-taf-no-secty-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,40 @@ networks:
edgex-network:
driver: bridge
services:
app-service-external-mqtt-trigger:
container_name: edgex-app-external-mqtt-trigger
depends_on:
- consul
- data
environment:
CLIENTS_CORE_COMMAND_HOST: edgex-core-command
CLIENTS_CORE_DATA_HOST: edgex-core-data
CLIENTS_CORE_METADATA_HOST: edgex-core-metadata
CLIENTS_SUPPORT_NOTIFICATIONS_HOST: edgex-support-notifications
CLIENTS_SUPPORT_SCHEDULER_HOST: edgex-support-scheduler
DATABASES_PRIMARY_HOST: edgex-redis
DATABASE_HOST: edgex-redis
EDGEX_PROFILE: external-mqtt-trigger
EDGEX_SECURITY_SECRET_STORE: "false"
REGISTRY_HOST: edgex-core-consul
SERVICE_HOST: edgex-app-external-mqtt-trigger
TRIGGER_EDGEXMESSAGEBUS_PUBLISHHOST_HOST: edgex-redis
TRIGGER_EDGEXMESSAGEBUS_SUBSCRIBEHOST_HOST: edgex-redis
TRIGGER_EXTERNALMQTT_URL: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_LOGLEVEL: INFO
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_TOPIC: edgex-export
hostname: edgex-app-external-mqtt-trigger
image: nexus3.edgexfoundry.org:10004/app-service-configurable-arm64:latest
networks:
edgex-network: {}
ports:
- 127.0.0.1:59706:59706/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
app-service-functional-tests:
container_name: app-functional-tests
depends_on:
Expand Down
34 changes: 34 additions & 0 deletions taf/docker-compose-taf-no-secty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,40 @@ networks:
edgex-network:
driver: bridge
services:
app-service-external-mqtt-trigger:
container_name: edgex-app-external-mqtt-trigger
depends_on:
- consul
- data
environment:
CLIENTS_CORE_COMMAND_HOST: edgex-core-command
CLIENTS_CORE_DATA_HOST: edgex-core-data
CLIENTS_CORE_METADATA_HOST: edgex-core-metadata
CLIENTS_SUPPORT_NOTIFICATIONS_HOST: edgex-support-notifications
CLIENTS_SUPPORT_SCHEDULER_HOST: edgex-support-scheduler
DATABASES_PRIMARY_HOST: edgex-redis
DATABASE_HOST: edgex-redis
EDGEX_PROFILE: external-mqtt-trigger
EDGEX_SECURITY_SECRET_STORE: "false"
REGISTRY_HOST: edgex-core-consul
SERVICE_HOST: edgex-app-external-mqtt-trigger
TRIGGER_EDGEXMESSAGEBUS_PUBLISHHOST_HOST: edgex-redis
TRIGGER_EDGEXMESSAGEBUS_SUBSCRIBEHOST_HOST: edgex-redis
TRIGGER_EXTERNALMQTT_URL: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_LOGLEVEL: INFO
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS: tcp://MQTT_BROKER_ADDRESS_PLACE_HOLDER:1883
WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_TOPIC: edgex-export
hostname: edgex-app-external-mqtt-trigger
image: nexus3.edgexfoundry.org:10004/app-service-configurable:latest
networks:
edgex-network: {}
ports:
- 127.0.0.1:59706:59706/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
app-service-functional-tests:
container_name: app-functional-tests
depends_on:
Expand Down
Loading

0 comments on commit 41d885a

Please sign in to comment.