Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new core with own certificates #467

Open
abroekhuis opened this issue Jan 14, 2020 · 13 comments
Open

Adding new core with own certificates #467

abroekhuis opened this issue Jan 14, 2020 · 13 comments

Comments

@abroekhuis
Copy link

Perhaps this is possible, and am I looking in the wrong places. But I would like to be able to setup multiple cores in a same group, and so that each core has an own certificate.

As far as I can tell the created scripts creates a core with a name similar to the group and with one fixed certificate. Is it possible to easily setup multiple cores?

@timmattison
Copy link
Contributor

timmattison commented Jan 23, 2020 via email

@abroekhuis
Copy link
Author

abroekhuis commented Jan 23, 2020

Well, naming itself is not really the biggest issue, although it would be nice to have the possibility to specify a specific name.
I guess the underlying issue here is the lack of individually controlling a core. In our case I would like to be able to control (eg) the shadow of one specific core. This could be a core specific name, but also other configurations.
For example, currently I am playing with a setup where I use a Greengrass core with an attached Pi Camera. This core streams the video to a Kinesis Video Stream. The idea is to have a setup with multiple devices, where each stream needs to be processed separately. If there is only one core for a group, I'm either limited to a configuration for all devices using the same setup (core), or forced to create a new group for each specific instance. Since all instances are (code-wise) the same, this does not feel right to me.
All together I am a bit confused about how this could be done with AWS IoT and Greengrass. Perhaps I have a lack of understanding how I should look at cores/groups and greengrass wrt these concepts. But I always assumed, based on prior similar (non-aws) systems, that a group can have multiple cores. And each core can have a deployment, either via the group (same deployment for all cores), or individually. And on top of that the possibility to control the core's shadow for core specific setup (configuration etc).

This issue also describes the problem I have: https://forums.aws.amazon.com/thread.jspa?messageID=862606&tstart=0

Note: when I mention a core, I mean an actual running instance, and not necessarily a core in AWS IoT.

@timmattison
Copy link
Contributor

timmattison commented Jan 23, 2020 via email

@abroekhuis
Copy link
Author

abroekhuis commented Jan 23, 2020

This already sounds like a great start! If this would be possible, I can probably already do a lot of what I would like to do.
Extra customisations are not yet fully clear, so solving those in a possibly second (or third ;)) step makes sense to me.

Note: does this provide some useful input for a solution? https://github.com/awslabs/aws-greengrass-group-setup

@timmattison
Copy link
Contributor

OK, this is not the first time I've gotten this request. :D I need to think about it a bit more. Reading the repo you linked made me think that I might want to also look into doing it with CloudFormation.

Essentially GGP could run in a mode where you create a "template", the template becomes a CloudFormation stack, for new groups you can reference the CloudFormation stack and it'll use everything defined there.

The challenge is that the CloudFormation stack won't update the dependent groups automatically by default. It's possible though that I could put something together with Lambda that would do that. Then you could operate on the CloudFormation stack and updates would roll down to the groups that reused it.

It's a lot of work but could be well worth it.

Related, do you have any code for the Pi camera + KVS that could go in the example functions repo? Many people ask for a sample of that and I just don't have one. I can help get it in the GGP format if that helps.

@abroekhuis
Copy link
Author

Interesting to see what comes out of this :). I know about the group setup and cloudformation, but have not yet used it in any kind of way.

Regarding the Pi camera, I have a working example based on the CDDBaseline which uses the kinesis gstreamer plugin and gstreamer-java.
If a CDD example is good enough, I can create a PR I think. I need to clean up the code and take out specific (own) parts that I cannot share.

@timmattison
Copy link
Contributor

Based on CDD? Even better! Please submit a PR and include any notes about things you'd like to clean up. I'd love to take a look and help out. Then I can finally test my own Pi camera...

@abroekhuis
Copy link
Author

abroekhuis commented Jan 23, 2020

Already updated the provisioner as well. I've created a PR with an example for Kinesis. I have not tested the code in the PR, since I don't have a Pi with me at the moment, so any feedback is
welcome!

Will do, just a few question. My current setup uses an older commit of the provisioner and aws-lambda functions. WIth my new clone (and as such head) of the lambda functions I now can't run ggp, it is missing REGION, and if set by hand to a region, it complains about "conf.core.roleName".
Is something changed so that I need to specify those myself, or should I update the provisioner as well? And if so, any risk of breaking something of my current (working) setup?

@timmattison
Copy link
Contributor

timmattison commented Jan 25, 2020 via email

@abroekhuis
Copy link
Author

I was using the head of the examples, with an older checkout of the provisioner. Updated that one as well to head, and it worked without any problems.
I don't think an issue is needed.

@timmattison
Copy link
Contributor

timmattison commented Jan 25, 2020 via email

@timmattison
Copy link
Contributor

Back to your original question regarding communicating with multiple cores. You can set up Lambda functions to listen on topics that contain the IoT thing name of each core. Here is one example:

https://github.com/aws-samples/aws-greengrass-lambda-functions/blob/8fb0291ec1192f17f9a0d27cfc50c59d93aefdd9/functions/CDDDMIJava/function.conf#L10

You can either use MQTT messages alone to send commands to a function or you can use the core's shadow and route the shadow messages to the functions in a similar way. Would that achieve what you were looking for?

@timmattison
Copy link
Contributor

Should we keep this open or create new issues to discuss the specifics of the different items?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants