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

Version 2.0 #18

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open

Version 2.0 #18

wants to merge 39 commits into from

Conversation

dzimine
Copy link
Owner

@dzimine dzimine commented Jan 3, 2019

To keep up with new AWS Greengrass features, Greengo needs a better, more modular structure, and ~80% unit test coverage. Some smaller refactoring ideas piled up, too. Now it's time to do it. I am breaking it to modules, adding unit tests, while trying to make it simple.

Refactor goals:

  1. Major: reduce code duplication, modularize for testability. Write tests at ~80% coverage.
  2. Minor: introduce simple dependency management.

This PR/branch will stay until it reaches feature-parity with master.

Notes on new design:

  • Entity is a base class for Greengrass entities - Group, Subscriptions, Lambdas, etc. It contains shared logic for pre- and post- create and remove. Soon it will implement basic dependency management, something like this:

    1. On create: if dependencies (parents) are not yet created, notify and exit.
    2. On remove: if dependent entities (children) are not yet removed, remove them first, then remove the entity (chop the whole branch). May be give an option of auto-remove.
  • Concrete entities, like Group or Subscriptions, implement do_create and do_remove methods, as well as declare their upstream and downstream dependencies.

  • state is responsible for managing the state.

  • greengrass module implements CLI commands. Support 1) create/remove the whole shebang; 2) create/remove individual entities 3) go beyond Greengrass for convinient dev flow, like create/remove Lambda functions of topic rules.

Dmitri Zimine added 30 commits December 12, 2018 14:21
- create/remove group
- create/remove core_thing & details
- structure unittests
- bring in most utilities.
- group_definition_version functionality in Entity.
Only ‘create’ for now but happy to figure how to factor 
unit tests.
... and now it works end-to-end. 

While with that: logging level done right.
* Pretty-print State
* Implement full-remove
* Don’t fail if Lambda package zip not found, just warn
@dzimine
Copy link
Owner Author

dzimine commented Apr 24, 2019

Match v1 checklist

Main functions:

  • greengo create
    greengo create-group-version
  • greengo create-lambdas
  • greengo remove-lambdas
  • greengo create-loggers
  • greengo remove-loggers
  • greengo create-resources
  • greengo remove-resources
  • greengo create-subscriptions
  • greengo remove-subscriptions
  • greengo deploy
  • greengo group
  • greengo remove
  • greengo state
  • greengo update-lambda

Below the cutting line, aka lost & found (things I am not motivated to hold the release of V2 for...)

  • greengo create-root-key
  • greengo update
  • greengo create-connectors
  • greengo remove-connectors

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

Successfully merging this pull request may close these issues.

1 participant