Skip to content

Commit

Permalink
Release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
predix-adoption-bot committed Jul 30, 2018
1 parent 8a83c0c commit 1178be0
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 24 deletions.
17 changes: 6 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@
version: '3'

services:
predix-edge-broker:
image: "dtr.predix.io/predix-edge/predix-edge-mosquitto-amd64:latest"
hostname: 127.0.0.1
ports:
- 1883:1883
- 9001:9001 # Websocket port
edge-hello-world:
image: "predixadoption/edge-hello-world:latest"
hostname: 127.0.0.1
depends_on:
- predix-edge-broker
environment:
- UPDATE_RATE_SEC=1.0
- TURBINE_IN_CHANNEL=turbine_control
- TURBINE_OUT_CHANNEL=turbine_measurement
- WEATHER_OUT_CHANNEL=weather
- CDP_CONFIG=/opt/app_config/cdp_config.json
- CDP_CONFIG=/config/cdp_config.json
ports:
- "9098:9005"
volumes:
- ./config:/opt/app_config
networks:
- predix-edge-broker_net
networks:
predix-edge-broker_net:
external: true
Empty file modified scripts/docker-windows.txt
100644 → 100755
Empty file.
9 changes: 0 additions & 9 deletions scripts/package.sh

This file was deleted.

132 changes: 132 additions & 0 deletions scripts/quickstart-deploy-to-edgeos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#!/bin/bash

set -e

trap "trap_ctrlc" 2

ROOT_DIR=$(pwd)
SKIP_BROWSER="0"
function local_read_args() {
while (( "$#" )); do
opt="$1"
case $opt in
-h|-\?|--\?--help)
PRINT_USAGE=1
QUICKSTART_ARGS="$SCRIPT $1"
break
;;
-b|--branch)
BRANCH="$2"
QUICKSTART_ARGS+=" $1 $2"
shift
;;
-o|--override)
RECREATE_TAR="1"
QUICKSTART_ARGS=" $SCRIPT"
;;
--skip-setup)
SKIP_SETUP=true
;;
*)
QUICKSTART_ARGS+=" $1"
#echo $1
;;
esac
shift
done

if [[ -z $BRANCH ]]; then
echo "Usage: $0 -b/--branch <branch> [--skip-setup]"
exit 1
fi
}

if [[ $(docker pull dtr.predix.io/predix-edge/predix-edge-mosquitto-amd64:latest) ]]; then
echo "pull successfully"
else
read -p "Enter your DTR user name> " DTR_USERNAME
read -p "Enter your DTR password> " -s DTR_PASSWORD
docker login dtr.predix.io -u $DTR_USERNAME -p $DTR_PASSWORD
docker pull dtr.predix.io/predix-edge/predix-edge-mosquitto-amd64:latest
fi

#docker pull predixadoption/edge-hello-world:latest
pwd
if [[ "$RECREATE_TAR" == "1" || ! -e "images.tar" ]]; then
echo "Creating a images.tar with required images"
docker save -o images.tar predixadoption/edge-hello-world:latest
fi
if [[ "$RECREATE_TAR" == "1" || ! -e "app.tar.gz" ]]; then
rm -rf app.tar.gz
echo "Creating app.tar.gz with docker-compose.yml"
tar -czvf app.tar.gz images.tar docker-compose.yml
fi

if [[ "$RECREATE_TAR" == "1" || ! -e "config.zip" ]]; then
rm -rf config.zip
echo "Compressing the configurations."
cd config
zip -X -r ../config.zip *.json
cd ../
fi

read -p "Enter the IP Address of Edge OS> " IP_ADDRESS
read -p "Enter the username for Edge OS> " LOGIN_USER
read -p "Enter your user password> " -s LOGIN_PASSWORD

pwd
expect -c "
spawn scp -o \"StrictHostKeyChecking=no\" app.tar.gz config.zip scripts/quickstart-run-wind-workbench.sh $LOGIN_USER@$IP_ADDRESS:/mnt/data/downloads
set timeout 50
expect {
\"Are you sure you want to continue connecting\" {
send \"yes\r\"
expect \"assword:\"
send "$LOGIN_PASSWORD\r"
}
\"assword:\" {
send \"$LOGIN_PASSWORD\r\"
}
}
expect \"*\# \"
spawn ssh -o \"StrictHostKeyChecking=no\" root@$IP_ADDRESS
set timeout 5
expect {
\"Are you sure you want to continue connecting\" {
send \"yes\r\"
expect \"assword:\"
send \"$LOGIN_PASSWORD\r\"
}
"assword:" {
send \"$LOGIN_PASSWORD\r\"
}
}
expect \"*\# \"
send \"su eauser /mnt/data/downloads/quickstart-run-wind-workbench.sh\r\"
set timeout 50
expect \"*\# \"
send \"exit\r\"
"

# Automagically open the application in browser, based on OS
if [[ $SKIP_BROWSER == 0 ]]; then
app_url="http://$IP_ADDRESS:9098"

case "$(uname -s)" in
Darwin)
# OSX
open $app_url
;;
Linux)
# OSX
xdg-open $app_url
;;
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
# Windows
start "" $app_url
;;
esac
fi
########### custom logic ends here ###########

#scp app.tar.gz config.zip scripts/quickstart-run-wind-workbench.sh root@$IP_ADDRESS:/mnt/data/downloads
23 changes: 23 additions & 0 deletions scripts/quickstart-run-wind-workbench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

trap "trap_ctrlc" 2

ROOT_DIR=$(pwd)

APPLICATION_ID="edge-hello-world"

curl http://localhost/api/v1/applications --unix-socket /var/run/edge-core/edge-core.sock -X POST -F "file=@/mnt/data/downloads/app.tar.gz" -H "app_name: $APPLICATION_ID"

mkdir -p /var/lib/edge-agent/app/$APPLICATION_ID/conf/

unzip /mnt/data/downloads/config.zip -d /var/lib/edge-agent/app/$APPLICATION_ID/conf/

#chown -R eauser /var/lib/edge-agent/app/$APPLICATION_ID/

if [[ $(docker service ls -f "name=$APPLICATION_ID_edge-hello-world" -q | wc -l) > 0 ]]; then
/opt/edge-agent/app-stop --appInstanceId=$APPLICATION_ID
fi

/opt/edge-agent/app-start --appInstanceId=$APPLICATION_ID
Empty file modified scripts/quickstart-wind-workbench.bat
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Wind Workbench",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"dependencies": {
"local-setup": "https://github.com/PredixDev/local-setup#1.0.96",
"predix-scripts": "https://github.com/PredixDev/predix-scripts#1.1.146",
"wind-workbench": "https://github.com/PredixDev/wind-workbench#1.0.4"
"local-setup": "https://github.com/PredixDev/local-setup#1.0.99",
"predix-scripts": "https://github.com/PredixDev/predix-scripts#1.1.149",
"wind-workbench": "https://github.com/PredixDev/wind-workbench#1.0.5"
},
"author": "susheelchoudhari"
}

0 comments on commit 1178be0

Please sign in to comment.