forked from faucetsdn/udmi
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standalone single-docker image version of UDMIS (faucetsdn#931)
- Loading branch information
Showing
19 changed files
with
207 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash -e | ||
|
||
UDMI_ROOT=$(dirname $0)/.. | ||
source $UDMI_ROOT/etc/shell_common.sh | ||
|
||
[[ $# == 1 ]] || usage site_model | ||
|
||
site_model=$(realpath $1) | ||
shift | ||
|
||
cd $UDMI_ROOT | ||
|
||
docker rm udmis || true | ||
|
||
[[ -f $site_model/cloud_iot_config.json ]] || fail missing $site_model/cloud_iot_config.json | ||
|
||
IMAGE_TAG=ghcr.io/faucetsdn/udmi:latest | ||
docker inspect -f '{{.Id}}' --type=image udmis:latest && IMAGE_TAG=udmis:latest | ||
|
||
cmd="docker run -d --name udmis -p 8883:8883 \ | ||
-v $site_model:/root/site \ | ||
-v $PWD/var/etcd:/root/default.etcd \ | ||
-v $PWD/var/mosquitto:/etc/mosquitto \ | ||
$IMAGE_TAG udmi/bin/start_local block site/ //mqtt/localhost" | ||
|
||
echo exec: $cmd | ||
$cmd | ||
|
||
echo Waiting 30s for container startup... | ||
sleep 30 | ||
|
||
echo :::::::::::::: docker logs udmis | ||
docker logs udmis | ||
|
||
echo :::::::::::::: docker ps | ||
docker ps | ||
|
||
echo :::::::::::::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash -ex | ||
#!/bin/bash -e | ||
|
||
UDMI_ROOT=$(dirname $0)/.. | ||
cd $UDMI_ROOT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
#!/bin/bash -e | ||
|
||
IMAGE=quay.io/coreos/etcd:v3.5.13 | ||
BINDIR=/tmp/etcd | ||
|
||
docker kill etcd || true | ||
echo pwd: $(pwd) | ||
|
||
docker run -v /usr/share/ca-certificates/:/etc/ssl/certs \ | ||
-p 2379:2379 --rm --name etcd ${IMAGE} etcd --version | ||
udmis/bin/etcdctl version || ../bin/etcdctl version | ||
|
||
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs \ | ||
-p 2379:2379 --rm --name etcd ${IMAGE} etcd \ | ||
-listen-client-urls=http://0.0.0.0:2379 \ | ||
-advertise-client-urls=http://127.0.0.1:2379 | ||
$BINDIR/etcd -version | ||
|
||
$BINDIR/etcd -listen-client-urls=http://0.0.0.0:2379 \ | ||
-advertise-client-urls=http://127.0.0.1:2379 \ | ||
> etcd.log 2>&1 & | ||
ETCD_PID=$! | ||
|
||
echo Waiting 10s for etcd to start... | ||
sleep 10 | ||
[[ -d /proc/$ETCD_PID ]] || (cat etcd.log && fail starting etcd) | ||
|
||
echo Completed etcd startup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
set -o errexit -o nounset | ||
|
||
MANGO_VERSION=5.1.4 | ||
mkdir -p mango/data && cd mango | ||
curl -sSL https://store.mango-os.com/downloads/m2m2-udmi-${MANGO_VERSION}.zip -o udmi.zip | ||
unzip udmi.zip -d udmi && rm udmi.zip | ||
|
||
docker run --rm \ | ||
-p 8443:8443 \ | ||
-v data:/opt/mango-data \ | ||
-v udmi:/opt/mango/web/modules/udmi \ | ||
ghcr.io/radixiot/mango:${MANGO_VERSION} |
Oops, something went wrong.