GithubHelp home page GithubHelp logo

kyopark2014 / iot-greengrass Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 751 KB

It describes IoT Greengrass in order to make edge environment for IoT devices.

Python 83.28% Shell 9.42% JavaScript 7.30%
aws edge-computing greengrassv2 iot ipc lambda pubsub

iot-greengrass's Introduction

IoT Greengrass

IoT Greengrass는 IoT를 위한 오픈소스 edge runtime으로서, Edge 디바이스의 Component를 build하고 deploy하며, manage하는 cloud 서비스입니다. 이를 이용하여 수백만개의 디바이스를 집, 공장, 자동차와 비지니스에서 활용할 수 있습니다. IoT Greengrass Basic에서 Greengress에 대해 설명합니다.

Greengrass Basic

Greengrass V2는 Java기반 Core를 사용하므로, 별도 컴파일 없이 구동 가능합니다. Greengrass는 Greengrass.jar와 components로 구성되는데, component에는 AWS가 제공하는 nucleus, streammanger 등이 있으며, 사용자가 compoenent를 recipe를 이용해 직접 정의 할 수 있습니다.

image

Components

Greengrass component는 Greengrass core device를 구동하는 소프트웨어입니다. Greengrass에서는 기본 기능(basic feature)과 공통 라이브러리(common library)를 비롯한 local 개발 툴을 components로 제공하며, Greengrass CLI를 이용하여 Local에서 core device를 개발하고 시험할 수 있습니다. 또는 Component는 cloud를 이용하여 다수의 device에 배포 할 수 있습니다.

Greengrass Communication

Greengrass의 Components들은 IPC 통신을 통해 Nucleus와 연결되고, Components 사이는 MQTT를 이용한 PUBSUB으로 메시지를 교환할 수 있습니다. Component들은 아래의 1,2,3과 같이 Greengrass 내부의 component들간에 local message를 교환할 수 있고, 1,2,4와 같이 IoT Core를 통해 메시지를 교환할 수 있습니다.

  • Pub/Sub IPC에서는 edge에 설치된 component들 끼리, Nucleus의 PubSub service를 이용하여 IPC로 통신하는 방법을 보여줍니다.

  • Pub/Sub IoT Core에서는 edge에 설치된 component가 Nucleus의 IoTMqttClient롤 IPC 통신을 하고, IoT Core와는 PUBSUB을 이용하여 MQTT로 통신하는 방법을 보여줍니다.

image

그림의 local PubSub의 IPC service identifier은 "aws.greengrass.ipc.pubsub"이고, IoTMQTTClient는 "aws.greengrass.ipc.mqttproxy" 입니다.

Component간 통신

Greengrass 디바이스에 설치된 component들은 IPC 통신을 이용하여 PubSub service에 메시지를 보내는 방식으로 통신합니다. 이때 receipe의 ComponentConfiguration에 아래와 같이 "aws.greengrass.ipc.pubsub"을 설정합니다.

"ComponentConfiguration": {
  "DefaultConfiguration": {
    "accessControl": {
      "aws.greengrass.ipc.pubsub": {
        "com.example.publisher:pubsub:1": {
          "policyDescription": "Allows access to publish to all topics.",
          "operations": [
            "aws.greengrass#PublishToTopic"
          ],
          "resources": [
            "*"
          ]
        }
      }
    }
  }
}  

Component와 IoT Core간 통신

Component가 IPC 통신으로 iotMqttClient service로 메시지를 보내면, 이 Topic을 Subscribe하고 있는 IoT Core로 메시지를 보낼 수 있습니다. 아래와 같이 recipe의 ComponentConfiguration에 "aws.greengrass.ipc.mqttproxy"을 설정합니다.

"ComponentConfiguration": {
    "DefaultConfiguration": {
      "accessControl": {
        "aws.greengrass.ipc.mqttproxy": {
          "com.example.publisher:mqttproxy:1": {
            "policyDescription": "Allows access to publish to all AWS IoT Core topics.",
            "operations": [
              "aws.greengrass#PublishToIoTCore"
            ],
            "resources": [
              "*"
            ]
          }
        }
      }
    }
  }

Local Component

CDK로 IPC Client V2 배포하기에서는 CDK로 Greengrass에서 IPC Client V2를 배포하는 방법에 대해 설명합니다.

Lambda Component

Container Component

Docker 이미지를 이용하여 Component를 생성할 수 있습니다.

CDK로 Container Conmponent 배포하기는 Greengrass에 Docker 환경을 구성하고 Component를 구성하는 방법에 대해 설명합니다.

Credentials Provider Workflow

Credentials Provider Workflow

Greengrass Security

Security에서는 Nucleus와 고정 IP 사용과 같은 Greengrass의 Security 이슈에 대해 설명합니다.

v2.0과 v1.0의 차이점

상세한 차이점은 Greengrass Version을 참고 바랍니다.

  • Core software
  • Components
  • Inter-process communication (IPC)
  • Docker containers
  • Nucleus and component security
  • Operating system integration and interaction

Greengrass Initialization

Greengrass 계정 생성

Greengrass 사용시 보안을 위하여 기능이 제한된 계정을 사용하여야 합니다. 이를 위해 Greengrass를 위한 계정 등록에 따라 계정을 생성합니다.

Greengrass 설치

Greengrass Preparation에 따라 greengrass 디바이스에 greengrass를 설치하고 core device로 등록합니다. Cloud9으로 개발환경을 구성시에는 Cloud9을 Greengrass 디바이스로 사용하기을 참조합니다.

Greengrass Commands와 Memo

유용한 Greengrass 명령어와 중요한 메모들를 정리하였습니다.

Greengress Workshop

  1. Workshop Greengrass을 따라서, Cloud9에 Greengrass V2를 설치하고, Local에서 배포를 수행합니다.

  2. Amazon S3를 이용하여 Greengrass Component를 배포하기에 따라, Amazon S3를 통해 배포환경을 구성 합니다.

  3. Greengrass device에서 ML Inference에 따라, ML source를 다운로드하여 Greengrass component로 배포할 수 있습니다.

  4. ML Component를 이용한 이미지 처리에서는 AWS Greengrass public component인 "DLRImageClassification"을 이용하여 이미지를 classification 하는 방법을 보여주고 있습니다.

EC2(Linux)에서 Greengrass 설치 및 배포

  1. EC2에 Greengrass 설치하기에 따라서 Greengrass를 설치합니다.

  2. Greengrass CLI 설치에 따라 Greengrass CLI를 설치합니다.

  3. Greengreen Component을 따라서, receipe와 artifact을 생성합니다.

  4. 디바이스에서의 ML Inference을 이용하여 ML을 실행할 수 있습니다.

Raspberry Pi에 Greengrass 설치 및 배포

Raspberry Pi에 Greengrass를 설치합니다.

Log Manager

Log Manager에 대해 설명합니다.

Reference

Workshop - AWS IoT Greengrass V2

Workshop - AWS IoT Greengrass V2 for beginners

Github - AWS IoT Greengrass

AWS re:Invent 2020: Dive deep and accelerate your implementation of AWS IoT Greengrass 2.0

Troubleshooting identity and access issues for AWS IoT Greengrass

Troubleshooting AWS IoT Greengrass V2

iot-greengrass's People

Contributors

kyopark2014 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.