AWS on Air 2020: AWS What’s Next ft. AWS IoT Greengrass 2.0

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so we are live hello everybody and welcome back to aws what's next my name is boz and today i'm excited to host chase gosling a distinguished engineer in aws hi james how are you today well i'm doing good you know it's we could do with a little bit of rain but otherwise you know blue skies and happiness oh that's great and we are here because we would like to talk about one of our latest iot announcements the new aws iot green grass 2.0 so before we dive deep into the new announcement for those that are not familiar with greengrass james what is greengrass so green grass is it well it's really two things um one is a set of software that runs on a device that manages the device's relationship to the cloud and it's a it's a collection of components that could do things like managing secrets managing secure tokens streaming data out to the cloud um and the the particular form of that that's interesting is streaming data to the cloud when the when the network links are unreliable you know imagine queuing and all of that sort of stuff it manages the the life cycles of the components on the device um and which includes things like installing and air recovery and all of that um so that a lot of the the sort of stuff that everybody has to do on a device um it does um and all the the unique stuff about what you're trying to do with your device um it doesn't do and then the other side of that is the cloud which has itself is sort of broken down into things that you know the the the amazon term is the data plane which is all the data that you send out or bring up bring forward and then look at the control plane all of the the sort of management tasks you you have to do with devices like you know upgrading their software or changing some tuning parameter you know if you're um you know running air conditioners um and you're running out of power you know a power company can send out a command that says you know go into power conservation mode and and of course the thing that makes that all tricky is being able to do that over large fleets of devices yeah that's always a big challenge so which type of devices are we talking about you gave a few examples but can you share a bit more about what customers are doing with it um so it's all over the map so um you know at amazon we've got these two sort of embedded software stacks there's free rtos and there's green grass and the way to think about the difference between them is that green grass is for everything big enough to run linux and friar toss is about the rest of them as small as possible yeah um okay and and and and so we have this big challenge of you know what is a a an embedded device and they're all over the place right so um you know we we routinely test on on things like raspberry pi's um actually a raspberry pi is a large and luxurious machine for us i'm using it yeah so so so a pie three is large and um luxurious apply four is ballroom dancing um there there are people i know that run them on sort of pi zero scale devices um and and you know so so things down at that end but also people are are are using this on sort of larger industrial control machines so this could be you know if you go to uh a company like on logic who make these these um industrial controllers um you know for seven or eight hundred dollars you can get something with with a with a few gigs of ram and um a real processor and you know not too long ago those things would have been you know major super computers but now they're just something that you bolt to the wall to you know control a certain machine and expensive in some cases but anywhere that basically can run linux can run green grass right if you can run linux you can run green grass and it's not just linux um you know we've um you know on some of the the things that are kind of close to linux um we've done some work so um yeah it's it's pretty broad okay so as i said before earlier this week we have launched greengrass 2.0 what's new in this version um so it was really a complete top to bottom rethink of of how the structure works and the best way to think of it is that it's really deeply all about modularity so um greengrass has um has been sort of broken down into a a group of tiny components in the middle there's this thing called the nucleus the nucleus does essentially nothing other than manage life cycles um and then everything is layered on top of that as as other components and you know there are sort of two two reasons for that one is it gives you the the flexibility to swap out different kinds of components so looking in greengrass v1 um there was an mqtt broker in greengrass v2 we don't have an mptv broker and yet um it's easy to install a new an mqtt broker so you can kind of pick well i want this mpg broker or that mpg broker you know so if you want to want one of the the the small tight compact ones like like moket or one of the the high volume ones like like mosquito or you want something that's like they you know an all-stinging all-dancing swiss army knife kind of message broker you can use something like revit mq um you know it's it's really it's all about choice right it's about giving you choice to have you know different installations of whatever right so you know based on my implementation based on my exact needs right right right right so so if you're doing something that that that requires mqtt but it's like a home automation thing then you can use a small mpgtt broker if if you're um doing some major industrial thing where you have a a large high volume fleet of devices then um you know use use mosquito use use you know and and if you want you can use one of the fault tolerant versions of it um a lot of these things have um you know the free version and the and the for money version um and we make it easy for you to just pick and choose okay so we're probably going to talk about some additional new features in the in the new version but how do you get started with greengrass 2.0 uh is it easy to begin using so it's it is really easy to use it so why don't we do a little demo okay i always like especially i always like demos okay so so the the the the blank looking region on the on the left hand side is is a terminal window and up there at the upper left hand side it says ssh a bunch of gobbledygook because i'm doing some uh port mapping and then to my nvidia jetson nano so i'll log in there and you can see i'm you know it's running that on a tegra 64-bit tegra which is the jetson nano um and then over here on the other side this is the getting started page for green grass um and and so i'm going to set up one core device um i'm going to give it a name george it's a jetson so it has to be named george although that that that joke has been getting really tired um i'm not going to put it in a group because you don't have to um then there's a bunch of preconditions you have to have set up the device a little bit you so long as you can ssh to the device and and do sudo and have sudo not ask you for a password then everything is easy um [Music] so i'm going to copy the download command so just to compare it to the first version if people are not are not familiar with how it used to be installing green grass on on your device how different it is from installing version two well so version one got quite a bit better um up until recently version one was taking a long time i know the first time i tried installing version one i spent like four or five hours before i just gave up in a screaming fit because you had to set up all kinds of um security and authentication stuff um and that's all that's all been automated now so i'm gonna bring the the second line over and i'm gonna get rid of some of the little helpful bits just to make it a little more of a challenge and i like installing it in slash art so the first command is basically downloading the packages the second one is executing some scripts that will do the local installation and yeah yeah right and these are uglier than they should be um we'll get there um so now you can see it's getting certificates um creating an iot thing um and setting up uh token exchange policies and and identity and access management policies and configuring all kinds of stuff getting your root ca set up and that's all done you had to do it manually with universe one like download all the certificates including the root certificate place it in the cell place and title and that's and that's just like all done so um if you look in my iot things uh there's this thing called george and so the iot core has this notion of a thing that's things that it's tracks but greengrass is kind of a layer on top of that so it has these core devices which are things with a lot more texture so you can see here on the bottom that there's george and if i look at it it's got some things but i want to redo a do a deployment so i go down to deploy and so normally when you install things what you what you get is um just the basic nucleus so um i'm going to create a new um i'm going to call that i'm going to send it to a device george george um so while we're setting it up uh for our viewers on twitch if you have any questions you would like to ask us feel free to type in the chat we will try to take some of the questions later on yeah so yeah so so so when you're doing a deployment you can deploy software um that's either public components and there are a number of them in this the set of public components is going to get larger over time so one of them is a command line tool that you can use on the device if you're ssh into it um and another one is the debug view our debug console got that added so let's just so i'm going to deploy these guys and i'm going to hit next there they are next and it's same way if i wanted to add mqtt i would do it the same way right it's just adding a component yeah yeah so if you're using a pre-can component and right now the list is relatively limited but it's going to be growing pretty quickly and also you know people can contribute components and and um you can make your own components making components is is really easy and in a minute or two i'll i'll uh i'll i'll make some so i just uh deployed this um if i go back and look at george it's got those like redeployed now now the one of the tricky things is that so you see this guy the local debug console what it does is it actually injects a small http server into the device and so i'm going to go and go to localhost 1441 and there's this security thing we go through um one of the things about about green grass is that there's a huge amount of paranoia about security and that's that's a whole talk on its own so i'm just going to do a quick [Music] flash op slash [Music] green grass cli get debug so this whole debug password thing is all about proving to the web browser that you are able to ssh into the device okay so and the um it's generated a a password full of crypto and it generates new passwords on a pretty regular basis um so stealing a password isn't terribly hard so now you see this graph so when you build a component um it can have dependencies on other components so if we take a look at say the the debug console um so just just to just to to to reconfirm here so this web page is being displayed on a web browser that's running on my desktop machine but the the web page is coming from the device and it's giving me an overview of what's going on on the device right so if i take a look at device details it's running linux it's a tegra arch 64. um yada yada so we go back to the console here where we see this let's take a look at the local debug console and it's a plug-in component so plug-in components are slightly magical in that they get injected directly into the nucleus itself they're not just running on the device they get run in the address space of the nucleus and you know it's got a number of configuration parameters that you can that you can change and it's got a couple of dependencies one on the command line so that you you see there's these two arcs that come out of the console one that goes to the command line the other one that goes to the nucleus those are these dependencies those dashed lines are soft dependencies the soft dependency is one that um if the like if the cli component gets reinstalled um i don't have to restart the console um you know it's it's something that where where the the the the the depender um can adapt to changes in its in its um dependence um or dependencies um and and the the it just sort of tells the nucleus to sort of like back off because normally what would happen is if the the the command line gets gets reinstalled you install a new version of it then this guy would be restarted but because this guy's able to handle that you don't have to do that and so there's the cli which is also a plug-in um but now let's let's do the the interesting stuff let's let's build a component um so let's say uh how are we going to dua well the thing i like about using lua for demos is that it's well known enough that everybody knows it but weird enough that people are kind of surprised by it um and in and in particular um you know the fact that lua isn't installed on most things by default um so now if i say uh there's a there's a little command line tool that um it's not quite in the open source repositories yet but it's getting there um uh green grass quick templates hello.lua um so that is actually building the recipes building all of the the the components um and it's it's um deploying it you know from the command line right so so this over here is the command line on the device and you see that now you see on the dependency graph that that updated while we were watching and so and now they've they've both finished so so that hello world is when it just printed prints hello world and that's it it's done right so if we now look at at hello this is the recipe that was constructed it's got a hard dependency on the lure runtime and the only thing in this recipe is it's got a it's got a run phase in its in this life cycle and it just does it does its thing um the one that depends on lua um it's got a bunch of stuff to manage the installation of lua um and you know so it's it's like if you've got app get then it tries to use apt-get otherwise it tries to use yum and um you know it does you know all kind of all the the the obvious things so that reminds me of it a docker file maybe it's a good time to talk about containers yeah so so these these components can be kind of anything okay um so the ones that i'm i've just showed you are like naked naked processes they just run on the device for lots of situations that's you know the the thing that you want um but there are all kinds of other um encapsulation mechanisms for um for applications that you're going to run on devices right so some people want to run docker and we let you run docker it's all set up so that you can do that it's not right right now it's not as easy as we would like it to be but it's still pretty easy you can use snaps um you can use you can use virtual machines if you want right you know you can you can um um handle use use kvm right and so so i showed you this this um this recipe for lua you can write a symbol a similar recipe for docker um no i won't bother with that i was going to show you the the docker recipe but that would be silly um yeah i only got half an hour um yeah we have something like seven minutes left and there's actually the question from the audience uh uh antique 005 asked us do we need to install java before we execute uh i assume that the answer for this is yes yeah it's it's yes right now um it it will it will automatically install it a little bit later but it will run on pretty much any version of java you know anything from jdk8 up i typically run on either 11 or 15 [Music] and and you know the one of the questions always comes up is what you know what's the memory footprint and that's a little hard to quantify because it depends on a certain amount of tuning you know if you just run it out of the box it uses the out of the box jvm tuning which you know assumes that you're going to be running on some like giant machine so it starts out just grabbing a whole lot of memory um but you can actually set the maximum heap size pretty small you know if you um i typically set it to like 20 or 30 megs and that's that's just fine um and if the footprint of the vm itself is is a little much you can use uh j-link uh j-link is a really nice tool that came out in jdk9 that lets you slice and dice the vm um and nami just said that that was going to be his next question about the footwork yeah yeah and and and if you're if you're really paranoid you can start using some of the static compilers like like uh grawl um although you lose i mean the problem with the static compiler is the use you end up losing a fair amount of the dynamic behavior um so things like plug-ins become more awkward um or if you're like like using um in embedded situations um there's a company called icus that has a vm it's called jamaica vm and they they they're essentially a static compiler and we've got some folks who have tried using using this on jamaica vm and it's it's it's it's been fine um and that makes it you know really quite tiny um but most of the time um certainly on like a a pi 3 level machine you know the out of the box jdks by just fine um they don't even use all that much resources the the sort of hotel load for for cpu consumption is doesn't you know it doesn't break one percent you know of a single core and on a four core machine you know it's it's just vanishingly lightweight um uh so i i see a lot of advantages i've been using greengrass uh the the previous version quite a lot and i see a lot of advantages moving to version two and i wonder what is the transition path for customers that just see this demo and would like to check the option to move from v1 to v2 uh what they should do echo compatibility uh is it supported how is it going yeah so so there were you know some things that we kind of had to break um but the you know if you were um if you had built a um a v1 uh app that that just just ran um just just ran as a linux process and wasn't running in a container then that's going to be pretty easy um the ones that they run as lambdas we actually have uh v1 lambda support and a bunch of the the the v1 api support um i can't quote you you know bible and verse or chapter and verse of the bible on just just which pieces work um but we're trying to get make it make it better um but you know one of the pieces of feedback that that we've we've heard pretty regularly lately is wow this let's lets me get rid of a whole bunch of workarounds um and you know that that that was that was sort of a goal right we spent you know the last four years hearing um issues from customers and so we decided to to fix them all and and a bunch of them ended up requiring that we commit a little bit of bit of breakage and and the the theme that sort of went went through all of these things was you know making the whole the whole system much more modular and much more flexible and much more scalable um so you know it's been uh it it's it's not as smooth a ride as it should be um and we will be smoothing things out some more but um generally it's pretty easy yeah i think this is a this is a good good call out uh to end this session saying that uh in general it's pretty easy to start with even easier than the green grass one that it was pretty easy maybe a longer installation maybe a bit less customized but still very very easy to start with uh so we are almost at the end of our session so thanks a lot james and i think uh our callout for today is going to be go build it's very very easy to start with uh especially with yeah it's it's easy to start with it's easy to develop from a command line there's actually some ide tools in the works um so you know we're really focused on making ease of use of development a a a real win here yeah so if you want to learn more about greengrass 2.0 check out iot 202 this is a session that james did earlier and it's going to be available on on demand soon on the platform of reinvent following this session we will have another aws what next session uh this time amazon managed services for gofano once again james thanks a lot for joining me today it was a real honor and thanks all of you for spending the last 30 minutes with us thank you very much all right thank you
Info
Channel: AWS Events
Views: 2,770
Rating: undefined out of 5
Keywords: AWS, Events, IoT, AWS on Air, AWS What's Next
Id: fBNG8OglRZQ
Channel Id: undefined
Length: 29min 53sec (1793 seconds)
Published: Thu Dec 31 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.