dzimine / greengo Goto Github PK
View Code? Open in Web Editor NEWSimple YAML-based deployment framework for AWS Greengrass.
Home Page: http://greengo.io
License: MIT License
Simple YAML-based deployment framework for AWS Greengrass.
Home Page: http://greengo.io
License: MIT License
Please see this PR: #24
Basically, there is a floating point calculation inside a range()
in the implementation of deploy.
Now that Greengrass supports python3 lambda functions, and python 2 is on the path of deprecation, would be good to have greengo supports deploying python3 lambdas
any chance of adding in
if not os.path.isfile(self.group['certs']['keypath']+"/root-CA.crt"):
urllib.urlretrieve("https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem",self.group['certs']['keypath']+"/root-CA.crt")
save getting root certificate
Hi Dimitri,
First off thanks for the time taken to write greengo, I have used it and will be happy to contribute back if I can solve my issue. You mentioned in a aws forum creating devices and then having just one core.
This means I will then still need to pull down the pythonSDK for the device and then run a script to communicate with the lambda running on the core.
My hopes was to have a lambda that has all the SDKs in it and then just deploy these lambdas to all cores in the group.
You mentioned the one group/core with multiply devices in the post of the forum, I have picked apart the greengo code and have used a brief retooling to get a device created and the keys down.
However a overview of how this works still eludes me.
Are you suggesting
cloud->system->core->device->sensor
and duplicating this. Would the device just talk with core locally and core would communicate back to the cloud. If so I would need to write code for the devices and each device would communicate to the same core locally. That would mean all the deployed product would have exactly the same keys running exactly the same core, correct? I would need to set up subscriptions for every new device back to the core?
Sorry if this is confusing i'm still coming to grips with ggc and core iot for that matter.
I guess i'm dreaming of one set of lambdas with one subscription deploying to all cores
Hi Dmitri,
Loving you work and will be using greengo in our production devices.
What do you feel about using existing lambdas, as I deploy and manage all my lambdas with serverless, being able to use existing lambdas would be helpful something like;
ExistingLambdas:
- name: d1Site
aliasarn: arn:aws:lambda:<your lambda arn>
greengrassConfig:
MemorySize: 128000 # Kb, ask AWS why
Timeout: 10 # Sec
Pinned: True # Set True for long-lived functions
Environment:
AccessSysfs: False
# ResourceAccessPolicies:
# - ResourceId: 1_path_to_input
# Permission: 'rw'
Variables:
name: value
def create_fn_defn(self):
for l in self.group['ExistingLambdas']:
functions = []
functions.append({
'Id': l['name'],
'FunctionArn': l['aliasarn'],
'FunctionConfiguration': l['greengrassConfig']
})
fd = self._gg.create_function_definition(
Name=l['name'],
InitialVersion={'Functions': functions}
)
self.state['FunctionDefinition'] = rinse(fd)
_update_state(self.state)
fd_ver = self._gg.get_function_definition_version(
FunctionDefinitionId=self.state['FunctionDefinition']['Id'],
FunctionDefinitionVersionId=self.state['FunctionDefinition']['LatestVersion'])
self.state['FunctionDefinition']['LatestVersionDetails'] = rinse(fd_ver)
_update_state(self.state)
This way I could run greengo create_fn_defn
and I could deploy my existing lambda
This is a bit odd and may require me forking but worth raising anyho, what about the option to write to a dynamodb, as I keep a list of my device in a device-table for access via appsync and user mapping
something like
DynamoTable: gen-devices
# in __init__
self._dynamodb = s.resource('dynamodb')
# in create
if 'DynamoTable' in self.group:
self._create_table_entry()
#create table function
def _create_table_entry(self):
thingTable = self._dynamodb.Table(self.group['tables']['thingTable'])
self.group['thing']['id'] = self.id
thingTable.put_item(
Item=self.thing
)
Also while on odd user cases, the name for your group, anychance this could be auto generated, as we will deploy to potential thousands of devices and save adjusting the yaml everytime
something like
# in __init__
self.state = _load_state()
if self.state:
self.uuid = self.state['id']
else:
self.uuid = str(uuid.uuid4())
self.name = "G"+self.uuid
# in create
self.state['id'] = self.uuid
Just some ideas, I can fork when you finish v2 but it would be nice to keep using the original repo
What are your thoughts on having greengo auto creating the greengrass service role if it doesn't exist ?
REF
https://docs.aws.amazon.com/greengrass/latest/developerguide/service-role.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.