Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
83 stars 65 forks source link

ADT: Model creation scalability - eliminate size restriction on input models set #531

Closed avagraw closed 2 years ago

avagraw commented 2 years ago

The model creation command (az dt model create) currently only supports input ontologies consisting of 250 models or lesser (This limit is enforced by the underlying API). This code change allows users to pass in ontologies of size constrained only by max number of models which can be stored on the ADT instance (default is 10,000 models). The logic takes care of figuring out the dependencies and creating batches (smaller or equal to the API limit) . Each batch is then processed by a separate API call. The batching logic ensures that the dependency of each model being processed is in the same batch or has already been created on the DT instance as a part of a previous batch.

TQDM integration allows users to monitor progress.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com 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

Basic expectations

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

avagraw commented 2 years ago

Pipeline testing evidence: https://dev.azure.com/azureiotdevxp/aziotcli/_build/results?buildId=5895&view=logs&j=e24f7e52-36f4-54e9-a8eb-6f10b62b4c84&t=85779272-bb12-5d7f-5c2e-f38ba3ce51f9

avagraw commented 2 years ago

Testing evidence with multiple ontologies: https://dev.azure.com/azureiotdevxp/aziotcli/_build/results?buildId=5914&view=logs&s=859b8d9a-8fd6-5a5c-6f5e-f84f1990894e

avagraw commented 2 years ago

More evidence - Tests process 3 ontologies: https://dev.azure.com/azureiotdevxp/aziotcli/_build/results?buildId=5922&view=logs&j=e24f7e52-36f4-54e9-a8eb-6f10b62b4c84&t=85779272-bb12-5d7f-5c2e-f38ba3ce51f9

digimaun commented 2 years ago

We should add a HISTORY.rst entry, and refresh the help to describe the improvements to this command. Users should be aware they can simply clone an ontology repository and upload all models in a single command -- and behavior if there is a failure during the process.

digimaun commented 2 years ago

It would be nice to improve this section in the contributing docs https://github.com/Azure/azure-iot-cli-extension/blob/dev/CONTRIBUTING.md#required-repositories to specifically to state clone commands including optionally fetching submodules to enable more tests.

digimaun commented 2 years ago

Has there been thought on including an enum based --failure-policy param that includes rollback or none options so the user can prevent the model deletion rollback behavior if desired?

avagraw commented 2 years ago

Has there been thought on including an enum based --failure-policy param that includes rollback or none options so the user can prevent the model deletion rollback behavior if desired?

Created a task for this: https://msazure.visualstudio.com/One/_sprints/taskboard/IoT-Platform-UPX/One/Custom/IoT/2207?workitem=14902067

avagraw commented 2 years ago

Latest testing evidence: https://dev.azure.com/azureiotdevxp/aziotcli/_build/results?buildId=6011&view=logs&j=e24f7e52-36f4-54e9-a8eb-6f10b62b4c84&t=85779272-bb12-5d7f-5c2e-f38ba3ce51f9