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

Edge device creation, configuration, and device bundles #591

Merged
merged 73 commits into from
Jan 10, 2023

Conversation

c-ryan-k
Copy link
Member

@c-ryan-k c-ryan-k commented Oct 27, 2022

Adds az iot edge devices create command that allows users to create and configure multiple edge device scenarios (and associated device configuration settings) using a configuration file (YAML or JSON) or inline device arguments.

The command performs the following actions after processing input:

  • Verify parent-child relationships between devices
  • [Optional] Delete all devices on the hub before creation
  • Create all new device-identities
  • Assign parent scopes to devices
  • Set deployments / modules on devices
  • Creates device config bundle (.tgz) that contains:
    • Device certificates
    • Root CA certificate (self-signed or imported)
    • Install script and readme

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Thank you for contributing to the IoT extension!

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

Intent for Production

  • It is expected that pull requests made to default or core branches such as dev or main are of production grade. Corollary to this, any merged contributions to these branches may be deployed in a public release at any given time. By checking this box, you agree and commit to the expected production quality of code.

Basic expectations

  • If introducing new functionality or modified behavior, are they backed by unit and/or integration tests?
  • In the same context as above are command names and their parameter definitions accurate? Do help docs have sufficient content?
  • Have all the relevant unit and integration tests pass? i.e. pytest <project root> -vv. Please provide evidence in the form of a screenshot showing a succesful run of tests locally OR a link to a test pipeline that has been run against the change-set.
  • Have linter checks passed using the .pylintrc and .flake8 rules? Look at the CI scripts for example usage.
  • Have extraneous print or debug statements, commented out code-blocks or code-statements (if any) been removed from the surface area of changes?
  • Have you made an entry in HISTORY.rst which concisely explains your user-facing feature or change?

Azure IoT CLI maintainers reserve the right to enforce any of the outlined expectations.

A PR is considered ready for review when all basic expectations have been met (or do not apply).

c-ryan-k and others added 28 commits October 6, 2022 12:34
Added help and examples for edge hierarchy commands

Modified inline device args to parse 'id' instead of 'device_id' for brevity, updated tests
reverted formatting changes to hub.py

removed comment from int test file
Certificate whitespace fixes

added all --device arg config values

Updated unit tests

Added device bundle checks to integration tests
Moved new tuples / classes to shared

Fixed linter issues and styling
azext_iot/iothub/params.py Outdated Show resolved Hide resolved
azext_iot/iothub/params.py Outdated Show resolved Hide resolved
Remnamed ca_cert input vars for create_ca_signed_certificate

Changed default value to 'n' for --clean

Updated help text and params with aka.ms link

Changed --device-template to --device-config-template
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@digimaun digimaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work and solid tests

Lets make sure to show evidence of full test pass prior to merge and capture follow ups on our backlog

@c-ryan-k
Copy link
Member Author

c-ryan-k commented Jan 10, 2023

First round of tests - have one final one (hopefully) coming that updates unit and integration tests so I'll have another run starting shortly.

https://dev.azure.com/azureiotdevxp/aziotcli/_build/results?buildId=7310&view=results

Makes paths inside config file relative to config file

Does not apply relative pathing to override params (CLI context)

Updates tests and adds nested folder for deployments to test pathing differences
@c-ryan-k
Copy link
Member Author

c-ryan-k commented Jan 10, 2023

Ok, one last full pipeline run to go once the PR pipeline passes, but here's some local testing evidence:
image
image

@c-ryan-k
Copy link
Member Author

Looks like tests were mostly successful, save some of our recent recurring issues. I'm good with this.

@c-ryan-k c-ryan-k changed the title Nested edge Hierarchy and Device Bundle creation Edge device creation, configuration, and device bundles Jan 10, 2023
Copy link
Member

@digimaun digimaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c-ryan-k c-ryan-k merged commit 2c5e705 into Azure:dev Jan 10, 2023
@c-ryan-k c-ryan-k deleted the nested_edge_device_bundle branch February 22, 2023 17:17
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.

3 participants