diff --git a/scripts/feed.sh b/scripts/feed.sh index 79808b8..80b12a8 100755 --- a/scripts/feed.sh +++ b/scripts/feed.sh @@ -1,3 +1,8 @@ +#!/bin/bash +# +# Run this script inside Vagrant VM, as SUDO, from /vagrant/scripts directory. +# It will be feeding images for GreengrassImageClassification Lambda. + files=(../images/*.jpg) RANDOM=$$$(date +%s) diff --git a/scripts/install.sh b/scripts/install.sh index bfbb949..8a5be00 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,3 +1,9 @@ +#!/bin/bash + +VERSION="1.8.0" +PLATFORM="x86-64" +GREENGRASS_RELEASE_URL=https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/${VERSION}/greengrass-linux-${PLATFORM}-${VERSION}.tar.gz + # Setup sudo adduser --system ggc_user sudo groupadd --system ggc_group @@ -6,20 +12,23 @@ sudo groupadd --system ggc_group sudo apt-get update sudo apt-get install -y sqlite3 python2.7 binutils curl -wget -O /vagrant/downloads/root.ca.pem http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem - -# Copy greengrass binaries -sudo tar -xzf /vagrant/downloads/greengrass-ubuntu-x86-64-1.5.0.tar.gz -C / +# Download and unpack greengrass binaries +wget $GREENGRASS_RELEASE_URL +GREENGRASS_RELEASE=$(basename $GREENGRASS_RELEASE_URL) +sudo tar -xzf $GREENGRASS_RELEASE -C / +rm $GREENGRASS_RELEASE # Install ML inference dependencies (MXNet) sudo apt-get install -y python-pip python-dev gcc sudo pip install mxnet sudo apt-get install -y python-opencv +# Get root certificate +wget -O /vagrant/certs/root.ca.pem http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem + # Copy certificates and configurations sudo cp /vagrant/certs/* /greengrass/certs sudo cp /vagrant/config/* /greengrass/config -sudo cp /vagrant/downloads/root.ca.pem /greengrass/certs # Create a source for images to map into the Lambda space later sudo mkdir /images diff --git a/scripts/update_ggc.sh b/scripts/update_ggc.sh index 70bc69e..d43adbe 100755 --- a/scripts/update_ggc.sh +++ b/scripts/update_ggc.sh @@ -1,3 +1,5 @@ +#!/bin/bash + echo "Reseting Greengrass Core for a new group." echo "Copy certificates..."