Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit 08cd9e8

Browse files
feat: Add mqtt-broker option to generate compose (#405)
* feat: Add mqtt-broker option to generate compose Generates compose file with additional MQTT Broker service Previous `mqtt` option renamed `mqtt-bus` to be more explicit. closes #404 Signed-off-by: lenny <[email protected]>
1 parent 8289564 commit 08cd9e8

File tree

2 files changed

+95
-68
lines changed

2 files changed

+95
-68
lines changed

compose-builder/Makefile

+24-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@
1919
include .env
2020

2121
COMPOSE_FILES:=-f docker-compose-base.yml
22-
OPTIONS:=" arm64 no-secty mqtt dev app-dev taf-secty taf-no-secty taf-perf taf-perf-no-secty ui ds-bacnet ds-camera ds-grove ds-modbus ds-mqtt ds-random ds-rest ds-snmp ds-virtual modbus-sim asc-http asc-http-s asc-mqtt asc-mqtt-s " # Must have spaces around words for `filter-out` function to work properly
2322
TOKEN_LIST:=""
2423

24+
# Must have spaces around words for `filter-out` function to work properly.
25+
# Dashes at beginning & end of line ensure space before/after the first/last option on that line
26+
# and don't impact the option list
27+
define OPTIONS
28+
- arm64 no-secty dev app-dev -
29+
- mqtt-bus mqtt-broker -
30+
- taf-secty taf-no-secty taf-perf taf-perf-no-secty -
31+
- ds-bacnet ds-camera ds-grove ds-modbus ds-mqtt ds-random ds-rest ds-snmp ds-virtual -
32+
- asc-http asc-http-s asc-mqtt asc-mqtt-s -
33+
- modbus-sim ui -
34+
endef
35+
export OPTIONS
36+
37+
38+
2539
ARGS:=$(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
2640
$(eval $(ARGS):;@:)
2741

@@ -103,8 +117,14 @@ ifeq (asc-mqtt-s, $(filter asc-mqtt-s,$(ARGS)))
103117
COMPOSE_FILES:=$(COMPOSE_FILES) -f add-asc-mqtt-export-secure.yml
104118
endif
105119

120+
# Add a MQTT Broker
121+
ifeq (mqtt-broker, $(filter mqtt-broker,$(ARGS)))
122+
COMPOSE_FILES:=$(COMPOSE_FILES) -f add-mqtt-broker.yml
123+
MQTT:=-mqtt
124+
endif
125+
106126
# Add switch to use MQTT Message Bus
107-
ifeq (mqtt, $(filter mqtt,$(ARGS)))
127+
ifeq (mqtt-bus, $(filter mqtt-bus,$(ARGS)))
108128
COMPOSE_FILES:=$(COMPOSE_FILES) -f add-mqtt-messagebus.yml -f add-mqtt-broker.yml
109129
MQTT:=-mqtt
110130
endif
@@ -178,7 +198,7 @@ ifeq (ui, $(filter ui,$(ARGS)))
178198
UI:=-ui
179199
endif
180200

181-
SERVICES:=$(filter-out $(OPTIONS),$(ARGS))
201+
SERVICES:=$(filter-out ${OPTIONS},$(ARGS))
182202

183203
ifeq (true, $(DS_GROVE))
184204
ifneq (-arm64, $(ARCH))
@@ -192,6 +212,7 @@ ifneq (nexus, $(RELEASE))
192212
endif
193213

194214
help:
215+
echo ${OPTIONS}
195216
echo "See README.md in this folder"
196217

197218
portainer:

compose-builder/README.md

+71-65
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,21 @@ Options:
138138
ds-bacnet: Generates compose file with device-bacnet included
139139
ds-camera: Generates compose file with device-camera included
140140
ds-grove: Generates compose file with device-grove included (valid only with arm64 option)
141-
ds-modbus: Generates compose file with device-modbus included
142-
ds-mqtt: Generates compose file with device-mqtt included
143-
ds-random: Generates compose file with device-random included
144-
ds-rest: Generates compose file with device-rest included
145-
ds-snmp: Generates compose file with device-snmp included
146-
ds-virtual: Generates compose file with device-virtual included
147-
modbus-sim: Generates compose file with ModBus simulator included
148-
asc-http: Generates compose file with App Service HTTP Export included
149-
asc-http-s: Generates compose file with App Service HTTP Export Secrets included
150-
asc-mqtt: Generates compose file with App Service MQTT Export included
151-
asc-mqtt-s: Generates compose file with App Service MQTT Export Secrets included
152-
mqtt: Generates compose file with services configure for MQTT Message Bus
153-
ui: Generates stand-alone compose file for EdgeX UI
141+
ds-modbus: Generates compose file with device-modbus included
142+
ds-mqtt: Generates compose file with device-mqtt included
143+
ds-random: Generates compose file with device-random included
144+
ds-rest: Generates compose file with device-rest included
145+
ds-snmp: Generates compose file with device-snmp included
146+
ds-virtual: Generates compose file with device-virtual included
147+
modbus-sim: Generates compose file with ModBus simulator included
148+
asc-http: Generates compose file with App Service HTTP Export included
149+
asc-http-s: Generates compose file with App Service HTTP Export Secrets included
150+
asc-mqtt: Generates compose file with App Service MQTT Export included
151+
asc-mqtt-s: Generates compose file with App Service MQTT Export Secrets included
152+
mqtt-broker: Generates compose file with a MQTT Broker service included
153+
mqtt-bus: Generates compose file with services configure for MQTT Message Bus
154+
The MQTT Broker service is also included.
155+
ui: Generates stand-alone compose file for EdgeX UI
154156
```
155157

156158
```
@@ -177,53 +179,55 @@ Options:
177179
run [options] [services]
178180
Runs the EdgeX services as specified by:
179181
Options:
180-
no-secty: Runs in Non-Secure Mode, otherwise runs in Secure Mode
181-
arm64: Runs using ARM64 images
182-
dev: Runs using local dev built images from edgex-go repo's
183-
'make docker' which creates docker images tagged with '0.0.0-dev'
184-
app-dev: Runs using local dev built images from app-service-configurable repo's
185-
'make docker' which creates docker images tagged with 'master-dev'
186-
ds-modbus: Runs with device-modbus included
187-
ds-bacnet: Runs with device-bacnet included
188-
ds-camera: Runs with device-camera included
189-
ds-grove: Runs with device-grove included (valid only with arm64 option)
190-
ds-mqtt: Runs with device-mqtt included
191-
ds-random: Runs with device-random included
192-
ds-rest: Runs with device-rest included
193-
ds-snmp: Runs with device-snmp included
194-
ds-virtual: Runs with device-virtual included
195-
modbus-sim: Runs with ModBus simulator included
196-
asc-http: Runs with App Service HTTP Export included
197-
asc-http-s: Runs with App Service HTTP Export Secrets included
198-
asc-mqtt: Runs with App Service MQTT Export included
199-
asc-mqtt-s: Runs with App Service MQTT Export Secrets included
200-
mqtt: Runs using MQTT Message Bus
201-
ui: Runs only the EdgeX UI service. `ds-x`, 'mqtt', 'no-ds' & 'no-secty' are ignored. Typically used after the other Edgex Services have been started
182+
no-secty: Runs in Non-Secure Mode, otherwise runs in Secure Mode
183+
arm64: Runs using ARM64 images
184+
dev: Runs using local dev built images from edgex-go repo's
185+
'make docker' which creates docker images tagged with '0.0.0-dev'
186+
app-dev: Runs using local dev built images from app-service-configurable repo's
187+
'make docker' which creates docker images tagged with 'master-dev'
188+
ds-modbus: Runs with device-modbus included
189+
ds-bacnet: Runs with device-bacnet included
190+
ds-camera: Runs with device-camera included
191+
ds-grove: Runs with device-grove included (valid only with arm64 option)
192+
ds-mqtt: Runs with device-mqtt included
193+
ds-random: Runs with device-random included
194+
ds-rest: Runs with device-rest included
195+
ds-snmp: Runs with device-snmp included
196+
ds-virtual: Runs with device-virtual included
197+
modbus-sim: Runs with ModBus simulator included
198+
asc-http: Runs with App Service HTTP Export included
199+
asc-http-s: Runs with App Service HTTP Export Secrets included
200+
asc-mqtt: Runs with App Service MQTT Export included
201+
asc-mqtt-s: Runs with App Service MQTT Export Secrets included
202+
mqtt-broker: Runs with a MQTT Broker service included
203+
mqtt-bus: Runs with services configure for MQTT Message Bus
204+
ui: Runs only the EdgeX UI service. `ds-x`, 'mqtt', 'no-ds' & 'no-secty' are ignored. Typically used after the other Edgex Services have been started
202205
Services:
203206
<names...>: Runs only services listed (and their dependent services) where 'name' matches a service name in one of the compose files used
204207
```
205208
```
206209
pull [options] [services]
207210
Pulls the EdgeX service images as specified by:
208211
Options:
209-
no-secty: Pulls images for Non-Secure Mode, otherwise pull images for Secure Mode
210-
arm64: Pulls ARM64 version of images
211-
ds-bacnet: Pull includes device-bacnet
212-
ds-camera: Pull includes device-camera
213-
ds-grove: Pull includes device-grove (valid only with arm64 option)
214-
ds-modbus: Pull includes device-modbus
215-
ds-mqtt: Pull includes device-mqtt
216-
ds-random: Pull includes device-random
217-
ds-rest: Pull includes device-rest
218-
ds-snmp: Pull includes device-snmp
219-
ds-virtual: Pull includes device-virtual
220-
modbus-sim: Pull includes ModBus simulator
221-
asc-http: Pull includes App Service HTTP Export
222-
asc-http-s: Pull includes App Service HTTP Export Secrets
223-
asc-mqtt: Pull includes App Service MQTT Export
224-
asc-mqtt-s: Pull includes App Service MQTT Export Secrets
225-
mqtt: Pull includes additional service for MQTT Message Bus
226-
ui: Pulls only the EdgeX UI service image. `ds-x`, 'mqtt', 'no-ds' & 'no-secty' are ignored
212+
no-secty: Pulls images for Non-Secure Mode, otherwise pull images for Secure Mode
213+
arm64: Pulls ARM64 version of images
214+
ds-bacnet: Pull includes device-bacnet
215+
ds-camera: Pull includes device-camera
216+
ds-grove: Pull includes device-grove (valid only with arm64 option)
217+
ds-modbus: Pull includes device-modbus
218+
ds-mqtt: Pull includes device-mqtt
219+
ds-random: Pull includes device-random
220+
ds-rest: Pull includes device-rest
221+
ds-snmp: Pull includes device-snmp
222+
ds-virtual: Pull includes device-virtual
223+
modbus-sim: Pull includes ModBus simulator
224+
asc-http: Pull includes App Service HTTP Export
225+
asc-http-s: Pull includes App Service HTTP Export Secrets
226+
asc-mqtt: Pull includes App Service MQTT Export
227+
asc-mqtt-s: Pull includes App Service MQTT Export Secrets
228+
mqtt-broker: Pull includes MQTT Broker service
229+
mqtt-bus: Pull includes additional service for MQTT Message Bus
230+
ui: Pulls only the EdgeX UI service image. `ds-x`, 'mqtt', 'no-ds' & 'no-secty' are ignored
227231
Services:
228232
<names...>: Pulls only images for the service(s) listed
229233
```
@@ -241,18 +245,20 @@ Options:
241245
ds-bacnet: Generates compose file with device-bacnet included
242246
ds-camera: Generates compose file with device-camera included
243247
ds-grove: Generates compose file with device-grove included (valid only with arm64 option)
244-
ds-mqtt: Generates compose file with device-mqtt included
245-
ds-random: Generates compose file with device-random included
246-
ds-rest: Generates compose file with device-rest included
247-
ds-snmp: Generates compose file with device-snmp included
248-
ds-virtual: Generates compose file with device-virtual included
249-
modbus-sim: Generates compose file with ModBus simulator included
250-
asc-http: Generates compose file with App Service HTTP Export included
251-
asc-http-s: Generates compose file with App Service HTTP Export Secrets included
252-
asc-mqtt: Generates compose file with App Service MQTT Export included
253-
asc-mqtt-s: Generates compose file with App Service MQTT Export Secrets included
254-
mqtt: Generates compose file configured to use MQTT Message Bus
255-
ui: Generates stand-alone compose file for EdgeX UI
248+
ds-mqtt: Generates compose file with device-mqtt included
249+
ds-random: Generates compose file with device-random included
250+
ds-rest: Generates compose file with device-rest included
251+
ds-snmp: Generates compose file with device-snmp included
252+
ds-virtual: Generates compose file with device-virtual included
253+
modbus-sim: Generates compose file with ModBus simulator included
254+
asc-http: Generates compose file with App Service HTTP Export included
255+
asc-http-s: Generates compose file with App Service HTTP Export Secrets included
256+
asc-mqtt: Generates compose file with App Service MQTT Export included
257+
asc-mqtt-s: Generates compose file with App Service MQTT Export Secrets included
258+
mqtt-broker: Generates compose file with a MQTT Broker service included
259+
mqtt-bus: Generates compose file with services configure for MQTT Message Bus
260+
The MQTT Broker service is also included.
261+
ui: Generates stand-alone compose file for EdgeX UI
256262
```
257263
```
258264
get-token [options]

0 commit comments

Comments
 (0)