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

[Draft] Adds nested Edge hierarchy creation command #580

Closed
wants to merge 14 commits into from

Conversation

c-ryan-k
Copy link
Member

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

Raising this PR in draft mode to get initial feedback while we discuss future enhancements.

  • Adds az iot edge hierarchy create experimental command that:
    • Allows users to create nested edge hierarchy configurations from inline --device arguments or with a YAML/JSON config file
    • Has switches for visualization of desired hierarchy and operation progress as well as whether or not to delete all hub devices before continuing
    • Performs the following operations on the hub:
      • (optional) Delete all existing device identities
      • Create new device identities
      • Set parents of devices according to hierarchy input
      • Set module deployments on devices as specified in input

New dependency: treelib - used as a helper for validating device hierarchies and visualization.

Unfinished tasks:

  • Currently only supports creating devices with default authentication method
  • Creation of 1000s of devices is possible with this command, which may significantly impact device identity registry quotas. We may want to discuss the possibility of limits / warnings for excessive amounts of devices.
  • Does not process additional edge configuration content / device TOML files / hostname configs or certificates.

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).

setup.py Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@@ -309,3 +309,32 @@ def load_iothub_help():
type: command
short-summary: Upload a local file as a device to a pre-configured blob storage container.
"""

helps["iot edge hierarchy"] = """
Copy link
Member

Choose a reason for hiding this comment

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

We should double-check the official terminology for this topic to ensure alignment...I've seen both "hierarchy" and "topology" being used.

elif devices:
# Process --device arguments
config = NestedEdgeConfig(
version="1.0",
Copy link
Member

Choose a reason for hiding this comment

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

We should ensure the "1.0" Nested Edge Config is documented somewhere.



@pytest.mark.usefixtures("set_cwd")
class TestNestedEdgeHierarchy(IoTLiveScenarioTest):
Copy link
Member

@digimaun digimaun Oct 13, 2022

Choose a reason for hiding this comment

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

Not strictly necessary for this PR, but at some point we need to converge on the new fixtures oriented test pattern for integration tests (as introduced in ADU CLI, and applied in this in-flight PR #582)

@c-ryan-k
Copy link
Member Author

Moved to feature branch / PR #591

@c-ryan-k c-ryan-k closed this Oct 27, 2022
@c-ryan-k c-ryan-k deleted the nested_edge_rebase 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.

2 participants