Giter VIP home page Giter VIP logo

aws-iot-kickstart's Introduction

sputnik - The IoT Pilot Kickstart Solution

Note: The AWS IoT Kickstart project or Sputnik is currently being reworked to leverage CDK for deployments. Please bear with us while we make the necessary changes. In the meantime, feel free to look at the current implementation, it still works.

The IoT Pilot Kickstart solution has been designed to simplify getting started on AWS IoT, by providing you with a boilerplate, sample application to onboard and manage IoT devices with minimalistic realtime data visualization capabilities.

Project named Sputnik, after (one of?) the first satellites.

Sputnik's goal is to help you get started and connecting your IoT devices to AWS and start generating business value from your use-case.

As part of this first release, Sputnik can, in theory, support all types of devices, however as part of this first release, for now, we have only included blueprints for the Raspberry Pi, Intel Up2, Deeplens and a dummy ESP32 device. We will be including more device blueprints as we go along, and hope the community and the AWS partner eco-system will participate in the creation of these blueprints.

Also, as part of this first release, Sputnik only supports deployment to Greengrass based devices. Amazon FreeRTOS support currently is work in progress.

What is the IoT Pilot Kickstart Solution

High Level Architecture Diagram

How it works

The main goal of Sputnik is to make it easier for you to start generating business value from your IoT devices. For this, Sputnik has concepts of blueprints that describe a device's business outcome. You can then add and deploy as many of these "business outcome driven devices" as you want.

For example: a Truck that you can track on a map, and check it's location and status, is a "business outcome driven device". Sputnik through blueprints will hide the devices that define the truck (ECU, sensors etc ...) and let your users manage Trucks.

Example

Lets say you want to pilot (or POC) the monitoring of an industrial equipment. A converyor belt for example. Your machine requires 1x gateway device running Greengrass, and 3 unique sensors.

Your machine becomes: 1 Gateway + 3 Sensors = 4 devices.

Your users can then deploy as many machines. Lets say your pilot requires you to monitor 10x of these machines.

In sputnik, very easy.

  1. You'll first deploy sputnik into an AWS account
  2. You'll create a DeviceType template for your Gateway and Sensor (unless you want to use an already existing one available)
  3. You'll create a DeviceBlueprint for your Gateway's business logic (for example: a modbus converting lambda function)
  4. You'll create a DeviceBlueprint for your Sensor's business logic
  5. You'll create a SystemBlueprint that defines your machine as having 1 gateway device, and 3 sensor nodes
  6. You can then simply add as many machines as you want. Generate the certificates for your devices, and start seeing data flow into Sputnik

Steps

First you create Device Types.

A DeviceType is a physical electronic device (a Rapsberry Pi, a Deeplens). The DeviceType defines the unique specificicities of your electronic device. Information like specific hardware capabilities for example (GPU, Camera, GPIOs...)

Details on creating a DeviceType.

Second you create Device Blueprints.

A DeviceBlueprint defines the business logic that your Device runs. Example: a Raspberry Pi with a Camera is just a Rapsberry Pi with a Camera. A Raspberry Pi with a Camera that runs code to detect whether people are wearing safety hats, becomes a "Safety hat detecting Camera". The business logic of detecting whether or not someone is wearing a safety hat or not is defined by a DeviceBlueprint. And, in some cases, this business logic, or DeviceBlueprint, could run on multiple DeviceTypes.

Detecting whether or not someone is wearing their safety hat could run on a Deeplens, a Raspberry Pi with a camera, an Intel Up2 board with a webcam attached etc ...

Details on creating a DeviceBlueprint.

Third you create System Blueprints.

SystemBlueprints define how multiple Devices interact together to become a system. Example: a Truck is a system. Customers can deploy multiple trucks. A truck can consist of multiple devices (4 tire sensors, 1 central processing unit).

Details on creating a SystemBlueprint.

Known Limitations

For now, deployment of blueprints is only supported on Greengrass based devices. Amazon FreeRTOS deployments via OTA to be implemented soon...

Next steps wish list

Notes

Public access to the website has been disabled by default. In order to enable it, you need to un-comment the S3 policy in the s3bucket-website Cloudformation script: sputnik-s3bucket-website.yml

Deploy Sputnik in your AWS account

You can 1-click deploy this solution in your AWS Account by clicking the following button:

Region Launch Template
N. Virginia (us-east-1) Launch the Sputnik Stack into Virginia with CloudFormation

Customize your own and build for yourself

Want to customize Sputnik, and want to fiddle around with the code? No problem. Follow this guide.

Disclaimer

This project was designed from the ground up with the hope to help customers and partners get started on AWS IoT. The main goal being to simplify connecting your first devices to AWS IoT and start generating business value as fast as possible.

The project is the work of 1 person only, and comes as is, non tested. Use at your own risk. Feedback is more than welcome.

Reminder: The project does not have built in tests, do use at your own risk!

For simplicity, the front-end for the project re-uses the IoT Device Simulator from which this project took a lot of inspiration from and was completely rewritten on.




License

This project is licensed under the Apache-2.0 License.

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://www.apache.org/licenses/LICENSE-2.0

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

aws-iot-kickstart's People

Contributors

amazon-auto avatar dependabot[bot] avatar jeremyjonas avatar mirgj avatar sperka avatar teuteuguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-iot-kickstart's Issues

[SPIKE] Improve code coverage for all critical paths

Currently there is very little unit testing and zero integration testing. Before release we need to have at minimum all critical paths covered.

First step in this process is defining a list of all the critical paths that we need to have covered, and add them here.

  • TODO: add list of critical paths here, with issues created for each

WebUI - routing

WebUI routing doesn't work for homepage.

Current result:

  • url/ loads with empty page (when logged in), redirects to `url/#/
  • `url/#/ loads with empty page
  • url/#/devices loads fine (after manually editing address)

Expected result:

  • url/ loads the homepage
  • url/#/ loads the homepage

Make it possible to build on Linux

Bug
It's not possible to build on Linux
When I run ./build.sh s3-for-kickiot v1.0.0 I get:

------------------------------------------------------------------------------
[Dependencies]
jq version: jq-1.6
yarn version: 1.19.2
------------------------------------------------------------------------------

00-cleanup.sh-----------------------------------------------------------------
[Init] Clean old dist and old website dir
rm -rf /*/aws-iot-kickstart/deployment/dist
mkdir -p /*/aws-iot-kickstart/deployment/dist
------------------------------------------------------------------------------

01-prepare-cf.sh--------------------------------------------------------------
[Packing] Cloud formation template

Removing old /*/aws-iot-kickstart/deployment/dist/cf dir (rm -rf /*/aws-iot-kickstart/deployment/dist/cf)
Copying CF folder accross (cp -R /*/aws-iot-kickstart/deployment/../source/cf /*/aws-iot-kickstart/deployment/dist)
Updating code source bucket in templates with s3-for-kickiot and code source version in template with v1.0.0
sed -i '' -e s/%%BUCKET_NAME%%/s3-for-kickiot/g /*/aws-iot-kickstart/deployment/dist/cf/*.yml
sed: can't read : No such file or directory

[Wiki] Update and improve documentation

After major refactor, documentation is out dated. Additionally we decided to move docs for now to github wiki pages.

List is basic list of stuff to do/improve

  • General project documentation
  • Developer documentation
  • Quick start documentation
  • "Path to Production" documentation

@teuteuguy Will take a first pass at this and create TODO's with links to issues for others to fill in.

Investigate adopting nx.dev as project framework

The build framework https://nx.dev/ looks very promising for improving many aspects of this project and enable modularizing the UI components into web-components that could lead to decoupling from angular directly. The key benefit promoted by the project is improved build/test times by targeting only the "affected" code and deep control over the dependencies between packages with the workspace.

Key Benefits:

  • Improved build/test times by only targeting "affected" code base
  • Tools for building/integrating web-components, angular and react components
  • Developer tools and IDE integration

Implement "Defaults / Examples" in new modular Sputnik

The old version of Sputnik had the concept of "defaults" for defining Device Types, Blueprints, GG functions, etc, but it was tightly coupled to core stack and deployed along with it.

Ideally rather than "defaults" then would just be additional stack to define and deploy the metadata (Device Types, Blueprints, etc) and the lambda code to support them "as code", in an on-going fashion. Rather than an initial single deployment of adding this functionality to the service, it would be seen an codified implementation of the resources to define the specific use case that is used instead of the UI, and is preferred production grade example.

We need to completely re-architect the way we handle this and refactor existing examples into this new system.

Currently "defaults / examples" have been removed from the beta release until we do this refactor.

Risk: over-authorization of AWS IoT policy

We are a security research team and we recently discovered that there is an over-authorization security issue with this project's IoT policy.
The affected file is as following:

1. aws-iot-kickstart/source/cf/sputnik-cognito.yml

Beta Release Tracking

Beta release is major refactor of the Sputnik example code to make the project modular, API driven, increase code coverage, and generally make it easy to consume and integrate into actual solutions.

Attention: All versions of Sputnik are to be considered "example" code and are provided "AS IS" under the Amazon Software License.

The Beta Release is being tracking by the Sputnik Beta Release Project and will mark the first official release of the project.

Key Features/Requirements:

  • Refactor project to be modular
    • Enable using specific parts of the project rather than "all or nothing"
  • Refactor API (Schema First) (WIP)
    • Separate API schema and operations
    • Refactor API schema (WIP) #19
      • Consistent naming of types, querier, mutation, etc (WIP)
      • Consistent operation inputs and pagination (WIP)
      • Consistent mutation responses (WIP)
    • Refactor and optimize API operations #20
    • Use graphql codegen to auto generate everything
  • Refactor all CloudFormation templates into CDK (WIP) #21
  • Refactor / Fix angular web project (WIP)
    • Refactor all services to use new API and generated services (WIP) #22
    • Refactor all models to use generated types (WIP) #23
    • Make sure all subscriptions are wired up and working #24
    • Refactor and upgrade the amplify authentication flow and integration
    • ...
  • Improve code coverage for all critical paths #25
    • Infra (WIP)
    • Web
    • Api
    • Lambdas (WIP)
    • ...
  • Enable CI/CD deployments and publishing
  • Improve development and tooling
    • Consistent ESLint configuration project wide (WIP)
    • Efficient builds and tests
    • ...
  • Update documentation #26
    • General project documentation
    • Developer documentation
    • Quick start documentation
    • "Path to Production" documentation
    • ...
  • ...

Once all the above have been completed, depending on the level of code coverage and the stability of the project overall, the core contributor team will decide on either release v0 or v1. Anything prior to v1 will not follow Semver and may have breaking changes between minor/patch releases. However from v1 onward, the project will follow strict Semver releases and be considered "stable". Obviously, without comprehensive test coverage this is not possible to maintain, as such will stay in <= v0 until team is confident in ongoing maintainability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.