Skip to content

Commit 1ea5368

Browse files
authored
This PR tracks the implementation of ZMQ store in issue #104 DNM (#126)
This PR tracks the implementation of ZMQ store in issue #104
1 parent 229ecc3 commit 1ea5368

File tree

7 files changed

+39
-18
lines changed

7 files changed

+39
-18
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ scripts/admin/config\.json
128128

129129
core-store/
130130

131-
\.resolv\.conf
132-
133131
core-network/
132+
133+
\.resolv\.conf

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,26 @@ cd databox
2929
```
3030
The above script pulls Databox pre-build images published on [Docker hub](<https://hub.docker.com/r/databoxsystems>) and run Databox in your local machine.
3131

32-
Once it's started, point a web browser at <https://127.0.0.1:8989> to access Databox UI.
32+
Once it's started, point a web browser at <http://127.0.0.1:8448> and follow the instructions to configure your HTTPS certificates to access Databox UI securely (using a web browser <http://127.0.0.1:8989>, or the IOS and android app).
3333

3434
To stop databox and clean up,
3535
```
3636
./databox-stop
3737
```
3838

39+
# Upgrading from 0.2.0 to 0.3.0
40+
41+
It is recommended to remove the ./certs directory before upgrading. Use the following commands in the root databox directory:
42+
43+
```
44+
45+
./databox-stop
46+
rm -rf ./certs
47+
git pull
48+
./databox-start
49+
50+
```
51+
3952
# Development
4053

4154
## Get Started with the Graphical SDK
@@ -78,7 +91,7 @@ To develop on the platform and core components run the data-box start script wit
7891
```
7992

8093
Unlike using the pre-build images, this will clone all the relevant source repositories locally, and build them into the
81-
required Docker images.
94+
required Docker images.
8295

8396
When you start in development mode only the `core-components` are built from source. If you wish to develop one of the available apps or drivers then you can add them to you local install using:
8497

databox-components

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ core-export-service https://github.com/me-box/core-export-service.git master
33
store-json https://github.com/me-box/store-json.git master
44
core-store https://github.com/me-box/core-store.git master
55
platform-app-server https://github.com/me-box/platform-app-server.git master
6-
core-container-manager https://github.com/ktg/core-container-manager master
6+
core-container-manager https://github.com/me-box/core-container-manager master
77
core-network https://github.com/me-box/core-network.git master

databox-start

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ if [ ! -d "node_modules" ]; then
131131
_exec npm install -loglevel silent
132132
fi
133133

134-
err "Starting the Databox swarm"
135-
docker swarm init --advertise-addr ${EXT_IP} > /dev/null
134+
136135
mkdir -p ./certs
137136

138137
err "Creating Certificates"
@@ -147,6 +146,9 @@ then
147146
assert_or_die $? 0 "Problem building core images"
148147
fi
149148

149+
err "Starting the Databox swarm"
150+
docker swarm init --advertise-addr ${EXT_IP} > /dev/null
151+
150152
err "Starting Databox"
151153

152154
docker network create -d overlay --attachable databox-system-net
@@ -160,11 +162,12 @@ assert_or_die $? 0 "Problem with docker stack deploy"
160162

161163
if [ "$DEV" == "1" ]
162164
then
163-
#source ./databox-install-component driver-sensingkit
164165
err "Sleeping..."
165166
sleep 10
166-
source ./databox-install-component driver-os-monitor
167-
source ./databox-install-component app-os-monitor
167+
./databox-install-component driver-sensingkit &
168+
./databox-install-component driver-os-monitor &
169+
./databox-install-component app-os-monitor &
170+
wait
168171
fi
169172

170173
err "Databox started! Visit http://localhost:8448"

databox-test

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash
22

3-
#include helper functions
4-
source ./scripts/utils.sh
5-
6-
73
function fail {
84
echo -e "[$( red FAILED )] ${1} \nERROR: ${2}"
95
#output debug information
@@ -25,6 +21,15 @@ function success {
2521
echo -e "[$( green OK )] $1"
2622
}
2723

24+
function test_assert {
25+
if [ "$1" != "$2" ]
26+
then
27+
fail "$3" "$1"
28+
else
29+
success "$3"
30+
fi
31+
}
32+
2833
#Start databox
2934
export DATABOX_TESTING=1
3035
source ./databox-start dev
@@ -47,13 +52,13 @@ RES=$(curl -sL --insecure "https://127.0.0.1:8989/arbiter/cat")
4752
test_assert "$RES" "$EXPECTED" "Is the arbiter cat endpoint is ok?"
4853

4954
#can we install the OS monitor driver
50-
PAYLOAD='{"manifest-version":1,"name":"driver-os-monitor","version":"0.1.0","description":"A Databox driver to monitor the local os","author":"Anthony Brown <[email protected]> ()","license":"MIT","databox-type":"driver","tags":["monitor","os"],"homepage":"https://github.com/me-box/driver-os-monitor","repository":{"type":"git","url":"git+https://github.com/me-box/driver-os-monitor.git"},"resource-requirements":{"store":"store-json"}}'
55+
PAYLOAD='{"manifest-version": 1,"name": "driver-os-monitor","version": "0.3.0","description": "A Databox driver to monitor the local os","author": "Anthony Brown <[email protected]> ()","license": "MIT","databox-type":"driver","tags": ["monitor","os"],"homepage": "https://github.com/me-box/driver-os-monitor","repository": {"type": "git","url": "git+https://github.com/me-box/driver-os-monitor.git"},"resource-requirements": { "store":"core-store"}}'
5156
RES=$(curl -s --insecure -H 'Content-Type: application/json' -X POST -d "${PAYLOAD}" -L 'https://127.0.0.1:8989/api/install')
5257
EXPECTED='{"status":200,"msg":"Success"}'
5358
test_assert "$RES" "$EXPECTED" "Can we install the driver-os-monitor?"
5459

5560
#can we install the OS monitor app
56-
PAYLOAD='{"manifest-version":1,"name":"app-os-monitor","databox-type":"app","version":"0.1.0","description":"An app in golang to plot the output of the os monitor driver.","author":"Tosh Brown <[email protected]>","license":"MIT","tags":["template","app","nodejs"],"homepage":"https://github.com/me-box/app-os-monitor","repository":{"type":"git","url":"git+https://github.com/me-box/app-os-monitor"},"packages":[{"name":"OS monitor Plotter","purpose":"To visualize your databox load and free memory","install":"required","risks":"None.","benefits":"You can see the data!","datastores":["loadavg1","loadavg5","loadavg15","freemem"],"enabled":true}],"allowed-combinations":[],"datasources":[{"type":"loadavg1","required":true,"name":"loadavg1","clientid":"loadavg1","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average 1 minuet"},{"rel":"urn:X-hypercat:rels:isContentType","val":"text/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg1"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg1"},{"rel":"urn:X-databox:rels:hasStoreType","val":"store-json"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"https://driver-os-monitor-store-json:8080/loadavg1"}},{"type":"loadavg5","required":true,"name":"loadavg5","clientid":"loadavg5","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average 5 minuets"},{"rel":"urn:X-hypercat:rels:isContentType","val":"text/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg5"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg5"},{"rel":"urn:X-databox:rels:hasStoreType","val":"store-json"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"https://driver-os-monitor-store-json:8080/loadavg5"}},{"type":"loadavg15","required":true,"name":"loadavg15","clientid":"loadavg15","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average 15 minuets"},{"rel":"urn:X-hypercat:rels:isContentType","val":"text/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg15"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg15"},{"rel":"urn:X-databox:rels:hasStoreType","val":"store-json"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"https://driver-os-monitor-store-json:8080/loadavg15"}},{"type":"freemem","required":true,"name":"freemem","clientid":"freemem","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Free memory in bytes"},{"rel":"urn:X-hypercat:rels:isContentType","val":"text/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"freemem"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"freemem"},{"rel":"urn:X-databox:rels:hasStoreType","val":"store-json"},{"rel":"urn:X-databox:rels:hasUnit","val":"bytes"}],"href":"https://driver-os-monitor-store-json:8080/freemem"}}],"export-whitelist":[{"url":"https://export.amar.io/","description":"Exports the calculated sentiment to amar.io"}],"resource-requirements":{}}'
61+
PAYLOAD='{"manifest-version":1,"name":"app-os-monitor","databox-type":"app","version":"0.3.0","description":"An app in golang to plot the output of the os monitor driver.","author":"Tosh Brown <[email protected]>","license":"MIT","tags":["template","app","nodejs"],"homepage":"https://github.com/me-box/app-os-monitor","repository":{"type":"git","url":"git https://github.com/me-box/app-os-monitor"},"packages":[{"name":"OS monitor Plotter","purpose":"To visualize your databox load and free memory","install":"required","risks":"None.","benefits":"You can see the data!","datastores":["loadavg1","loadavg5","loadavg15","freemem"],"enabled":true}],"allowed-combinations":[],"datasources":[{"type":"loadavg1","required":true,"name":"loadavg1","clientid":"loadavg1","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average 1 minute"},{"rel":"urn:X-hypercat:rels:isContentType","val":"application/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg1"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg1"},{"rel":"urn:X-databox:rels:hasStoreType","val":"ts"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"tcp://driver-os-monitor-core-store:5555/ts/loadavg1"}},{"type":"loadavg5","required":true,"name":"loadavg5","clientid":"loadavg5","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average over 5 minutes"},{"rel":"urn:X-hypercat:rels:isContentType","val":"application/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg5"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg5"},{"rel":"urn:X-databox:rels:hasStoreType","val":"ts"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"tcp://driver-os-monitor-core-store:5555/ts/loadavg5"}},{"type":"loadavg15","required":true,"name":"loadavg15","clientid":"loadavg15","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox load average over 15 minutes"},{"rel":"urn:X-hypercat:rels:isContentType","val":"application/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"loadavg15"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"loadavg15"},{"rel":"urn:X-databox:rels:hasStoreType","val":"ts"},{"rel":"urn:X-databox:rels:hasUnit","val":"%"}],"href":"tcp://driver-os-monitor-core-store:5555/ts/loadavg15"}},{"type":"freemem","required":true,"name":"freemem","clientid":"freemem","granularities":[],"hypercat":{"item-metadata":[{"rel":"urn:X-hypercat:rels:hasDescription:en","val":"Databox free memory in bytes"},{"rel":"urn:X-hypercat:rels:isContentType","val":"application/json"},{"rel":"urn:X-databox:rels:hasVendor","val":"Databox Inc."},{"rel":"urn:X-databox:rels:hasType","val":"freemem"},{"rel":"urn:X-databox:rels:hasDatasourceid","val":"freemem"},{"rel":"urn:X-databox:rels:hasStoreType","val":"ts"},{"rel":"urn:X-databox:rels:hasUnit","val":"bytes"}],"href":"tcp://driver-os-monitor-core-store:5555/ts/freemem"}}],"export-whitelist":[{"url":"https://export.amar.io/","description":"Exports the data to amar.io"}],"resource-requirements":{},"displayName":"os monitor","storeUrl":"http://localhost:8181/app/get/?name=app-os-monitor"}'
5762
RES=$(curl -s --insecure -H 'Content-Type: application/json' -X POST -d "${PAYLOAD}" -L 'https://127.0.0.1:8989/api/install')
5863
EXPECTED='{"status":200,"msg":"Success"}'
5964
test_assert "$RES" "$EXPECTED" "Can we install the app-os-monitor?"

docker-core-network.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.2'
22

33
services:
44
databox-network:
5-
image: ${DOCKER_REPO}core-network
5+
image: ${DOCKER_REPO}core-network:${DATABOX_CORE_IMAGE_VERSION}
66
networks:
77
databox-system-net:
88
aliases:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "container-manager",
3-
"version": "0.1.0",
3+
"version": "0.3.0",
44
"description": "Databox OS container manager and dashboard server",
55
"scripts": {
66
"test": "./node_modules/mocha/bin/mocha",

0 commit comments

Comments
 (0)