iotedgedev 3.3.4__zip → 3.3.5__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. s/.git/FETCH_HEAD +2 -1
  2. s/.git/HEAD +1 -1
  3. s/.git/hooks/fsmonitor-watchman.sample +3 -2
  4. s/.git/index +0 -0
  5. s/.git/logs/HEAD +1 -1
  6. s/.git/logs/refs/remotes/origin/EO +1 -1
  7. s/.git/logs/refs/remotes/origin/avagraw/security_fix +1 -1
  8. s/.git/logs/refs/remotes/origin/cherry-pick-rename +1 -1
  9. s/.git/logs/refs/remotes/origin/chyuan/fix-validation-not-fail-test +1 -1
  10. s/.git/logs/refs/remotes/origin/chyuan/update-linux-agent +1 -1
  11. s/.git/logs/refs/remotes/origin/dependabot/pip/cookiecutter-2.1.1 +1 -0
  12. s/.git/logs/refs/remotes/origin/dependabot/pip/pyyaml-5.4 +1 -1
  13. s/.git/logs/refs/remotes/origin/main +1 -1
  14. s/.git/logs/refs/remotes/origin/ray-deps +1 -1
  15. s/.git/logs/refs/remotes/origin/ray-dev-setup +1 -1
  16. s/.git/logs/refs/remotes/origin/ray-tox +1 -1
  17. s/.git/logs/refs/remotes/origin/release-pipeline-automation +1 -1
  18. s/.git/logs/refs/remotes/origin/spmcdono/fix-pipeline-test-install +1 -1
  19. s/.git/logs/refs/remotes/origin/spmcdono/layered-deployments +1 -1
  20. s/.git/logs/refs/remotes/origin/spmcdono/pypi-package-test-pipeline +1 -1
  21. s/.git/logs/refs/remotes/origin/spmcdono/remove-py2 +1 -1
  22. s/.git/logs/refs/remotes/origin/spmcdono/remove-py2-dev +1 -1
  23. s/.git/logs/refs/remotes/origin/spmcdono/test-native-runtime-install +1 -1
  24. s/.git/logs/refs/remotes/origin/spmcdono/update-pipeline +1 -1
  25. s/.git/logs/refs/remotes/origin/user/marine/EliiseS/devcontainer +1 -1
  26. s/.git/logs/refs/remotes/origin/user/marine/fixsimver +1 -1
  27. s/.git/logs/refs/remotes/origin/user/marine/layereddeploymentsbuildtest +1 -1
  28. s/.git/logs/refs/remotes/origin/user/marine/master-to-main +1 -1
  29. s/.git/logs/refs/remotes/origin/user/marine/pipeline +1 -1
  30. s/.git/logs/refs/remotes/origin/user/vikas +1 -1
  31. s/.git/logs/refs/remotes/origin/user/vikas0212/verify-tests +1 -1
  32. s/.git/logs/refs/remotes/origin/user/vikas2 +1 -1
  33. s/.git/logs/refs/remotes/origin/user/vikas_pypi +1 -1
  34. s/.git/logs/refs/remotes/origin/user/vikas_pypi-1 +1 -1
  35. s/.git/logs/refs/remotes/origin/user/vikas_supplychain-issue1 +1 -0
  36. s/.git/logs/refs/remotes/origin/user/vikas_testing +1 -1
  37. s/.git/logs/refs/remotes/origin/user/vikas_trigger +1 -0
  38. s/.git/logs/refs/remotes/origin/user/vikas_trigger_new +1 -0
  39. s/.git/logs/refs/remotes/origin/user/xinzed/dps_conn_str +1 -1
  40. s/.git/logs/refs/remotes/origin/user/xinzed/update-python-docker +1 -1
  41. s/.git/logs/refs/remotes/origin/vikas/azure +1 -1
  42. s/.git/logs/refs/remotes/origin/vikas/dependebot +1 -1
  43. s/.git/logs/refs/remotes/origin/vikas-triggers +1 -0
  44. s/.git/logs/refs/remotes/origin/xinzed/3_1_0rc1 +1 -1
  45. s/.git/logs/refs/remotes/origin/xinzed/update-runtime +1 -1
  46. s/.git/objects/pack/pack-7a60b35c219082b6cfceccd45f3712d11b9c0e3b.idx +0 -0
  47. s/.git/objects/pack/{pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.pack → pack-7a60b35c219082b6cfceccd45f3712d11b9c0e3b.pack} +0 -0
  48. s/.git/refs/remotes/origin/dependabot/pip/cookiecutter-2.1.1 +1 -0
  49. s/.git/refs/remotes/origin/main +1 -1
  50. s/.git/refs/remotes/origin/user/vikas_supplychain-issue1 +1 -0
  51. s/.git/refs/remotes/origin/user/vikas_trigger +1 -0
  52. s/.git/refs/remotes/origin/user/vikas_trigger_new +1 -0
  53. s/.git/refs/remotes/origin/vikas-triggers +1 -0
  54. s/.git/refs/tags/v3.3.5 +1 -0
  55. s/.github/ISSUE_TEMPLATE/01_bug_report.yml +55 -0
  56. s/.github/ISSUE_TEMPLATE/02_feature_request.yml +14 -0
  57. s/.github/pull_request_template.md +35 -0
  58. s/.github/workflows/wiki.yml +1 -1
  59. s/.vscode/launch.json +2 -2
  60. s/.vscode/settings.json +2 -1
  61. s/CHANGELOG.md +63 -4
  62. s/CONTRIBUTING.md +30 -97
  63. s/Makefile +1 -2
  64. s/README.md +16 -169
  65. s/SECURITY.md +41 -0
  66. s/build/lib/iotedgedev/__init__.py +1 -1
  67. s/build/lib/iotedgedev/azurecli.py +14 -4
  68. s/build/lib/iotedgedev/cli.py +36 -25
  69. s/build/lib/iotedgedev/connectionstring.py +10 -8
  70. s/build/lib/iotedgedev/edge.py +1 -1
  71. s/dist/{iotedgedev-3.3.4-py3-none-any.whl → iotedgedev-3.3.5-py3-none-any.whl} +0 -0
  72. s/docker/tool/build-docker.sh +3 -3
  73. s/docker/tool/deps.txt +1 -1
  74. s/docker/tool/linux/Dockerfile.base +7 -4
  75. s/docker/tool/windows/Dockerfile.base +1 -1
  76. s/docs/_Sidebar.md +5 -4
  77. s/docs/{Azure-Setup.md → azure-setup.md} +19 -18
  78. s/docs/{Edge-Device-Setup.md → edge-device-setup.md} +5 -4
  79. s/docs/environment-setup/install-docker.md +9 -0
  80. s/docs/environment-setup/manual-dev-machine-setup.md +79 -0
  81. s/docs/{Python-Virtual-Environment-Setup.md → environment-setup/python-virtual-environment-setup.md} +7 -8
  82. s/docs/environment-setup/run-devcontainer-docker.md +24 -0
  83. s/docs/home.md +10 -0
  84. s/docs/{Migration-Guides.md → migration-guides.md} +26 -26
  85. s/docs/quickstart.md +152 -0
  86. s/docs/run-modules-on-simulator.md +18 -0
  87. s/docs/run-modules-on-vm.md +54 -0
  88. s/docs/{Troubleshooting.md → troubleshooting.md} +5 -4
  89. s/docs/{Usage.md → usage.md} +19 -20
  90. s/iotedgedev/__init__.py +1 -1
  91. s/iotedgedev/azurecli.py +14 -4
  92. s/iotedgedev/cli.py +36 -25
  93. s/iotedgedev/connectionstring.py +10 -8
  94. s/iotedgedev/edge.py +1 -1
  95. s/iotedgedev.egg-info/PKG-INFO +1 -1
  96. s/iotedgedev.egg-info/SOURCES.txt +2 -1
  97. s/iotedgedev.egg-info/requires.txt +1 -1
  98. s/requirements.txt +2 -2
  99. s/setup.cfg +1 -1
  100. s/setup.py +4 -2
  101. s/tests/__init__.py +1 -1
  102. s/tests/assets/test_solution_shared_lib/deployment.template.json +1 -1
  103. s/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json +43 -9
  104. s/tests/test_iotedgedev_iothub_deploy.py +0 -1
  105. s/tests/test_iotedgedev_solution.py +3 -4
  106. s/tests/test_iotedgedev_solution_build.py +0 -19
  107. s/tests/test_iotedgedev_solution_deploy.py +197 -0
  108. s/tests/test_iotedgedev_solution_init.py +34 -0
  109. s/.git/logs/refs/remotes/origin/eliises/add-device-tagging-docs +0 -1
  110. s/.git/objects/pack/pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.idx +0 -0
  111. s/.git/refs/remotes/origin/eliises/add-device-tagging-docs +0 -1
  112. s/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
  113. s/.github/ISSUE_TEMPLATE/feature_request.md +0 -7
  114. s/docs/Home.md +0 -10
  115. s/docs/Manual-Dev-Machine-Setup.md +0 -77
  116. s/docs/Quickstart-with-IoT-Edge-Dev-Container.md +0 -145
  117. s/pull_request_template.md +0 -9
  118. s/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json +0 -12
  119. /s/docs/{Command-List.md → command-list.md} +0 -0
  120. /s/docs/{Command-Tips.md → command-tips.md} +0 -0
  121. /s/docs/{Overview.md → overview.md} +0 -0
  122. /s/docs/{Test-Coverage.md → test-coverage.md} +0 -0
@@ -1,9 +1,9 @@
1
1
  IoT Edge Dev Tool 0.82.0 provides support for the GA release of Azure IoT Edge and other new features, while on the other hand, introduces some breaking changes to better serve these new features. If you have used IoT Edge Dev Tool during the Azure IoT Edge public preview, this document will help you migrate your code and workflow to IoT Edge Dev Tool 0.82.0.
2
2
 
3
- ### Retirement of `iotedgectl`
3
+ ## Retirement of `iotedgectl`
4
4
  With the GA release of Azure IoT Edge, iotedgectl (a.k.a, [azure-iot-edge-runtime-ctl](https://pypi.org/project/azure-iot-edge-runtime-ctl/)) is retired. In IoT Edge Dev Tool 0.82.0, we replace `iotedgectl` with the IoT Edge Simulator provided by the [iotedgehubdev CLI](https://pypi.org/project/iotedgehubdev/). The `setup`, `start`, and `stop` commands will now control IoT Edge Simulator instead.
5
5
 
6
- ### Updated command list and options
6
+ ## Updated command list and options
7
7
  IoT Edge Dev Tool 0.82.0 comes with a new CLI UX. All commands are organized into four categories: `docker`, `iothub`, `simulator`, and `solution`. The general style is **iotedgedev _category_ _command_ --_parameter_**. For some frequently used commands, there is also an **iotedgedev _command_ --_parameter_** style shortcut (only if the shortcut won't cause confusion, similar to the relationship between `docker logs` and `docker container logs`). The shortcuts also add backward compatibility with some public preview style commands.
8
8
 
9
9
  Here is what you would see when you type `iotedgedev --help` (shortcuts are intentionally listed before the categories):
@@ -79,30 +79,30 @@ Options:
79
79
 
80
80
  Below is a full table of the public preview commands, new commands, and shortcuts (if applicable):
81
81
 
82
- Public Preview Command | New Command | Shortcut
83
- -- | -- | --
84
- `--set-config` | `solution genconfig` | `genconfig `
85
- `solution --create --module --template` | `solution new --module/-t --template/-t` | `new`
86
- `init` | `solution init` | `init`
87
- `e2e` | `solution e2e` |
88
- `addmodule --template` | `solution add --template/-t` | `add --template/-t`
89
- `build --push --deploy` | `solution build --push/-p --deploy/-d` | `build --push/-p --deploy/-d`
90
- `push --deploy --no-build` | `solution push --deploy/-d --no-build` | `push --deploy/-d --no-build`
91
- `deploy` | `solution deploy` | `deploy`
92
- `monitor --timeout` | `iothub monitor --timeout/-t` | `monitor --timeout/-t`
93
- `azure --setup --credentials --service-principal --subscription --resource-group-location --resource-group-name --iothub-sku --iothub-name --edge-device-id --update-dotenv` | `iothub setup --credentials --service-principal --subscription --resource-group-location --resource-group-name --iothub-sku --iothub-name --edge-device-id --update-dotenv/-u` |  
94
- `modules --add --template` | `solution add --template` | `add --template/-t`
95
- `modules --build --push --deploy` | `solution build --push/-p --deploy/-d` | `build --push/-p --deploy/-d`
96
- `modules --push --deploy` | `solution push --deploy/-d --no-build` | `push --deploy/-d --no-build`
97
- `modules --deploy` | `solution deploy` | `deploy`
98
- `runtime --setup` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |  
99
- `runtime --start` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |  
100
- `runtime --stop` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |  
101
- `runtime --restart` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |  
102
- `runtime --status` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |  
103
- `docker --setup-registry` | `docker setup` |  
104
- `docker --clean --remove-modules --remove-containers --remove-images` | `docker clean --modules/-m --containers/-c --image/-i` |  
105
- `docker --logs --show-logs --save-logs` | `docker log --show/-l --save/-s` | `docker log --show/-l --save/-s`
82
+ | Public Preview Command | New Command | Shortcut |
83
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
84
+ | `--set-config` | `solution genconfig` | `genconfig ` |
85
+ | `solution --create --module --template` | `solution new --module/-t --template/-t` | `new` |
86
+ | `init` | `solution init` | `init` |
87
+ | `e2e` | `solution e2e` |
88
+ | `addmodule --template` | `solution add --template/-t` | `add --template/-t` |
89
+ | `build --push --deploy` | `solution build --push/-p --deploy/-d` | `build --push/-p --deploy/-d` |
90
+ | `push --deploy --no-build` | `solution push --deploy/-d --no-build` | `push --deploy/-d --no-build` |
91
+ | `deploy` | `solution deploy` | `deploy` |
92
+ | `monitor --timeout` | `iothub monitor --timeout/-t` | `monitor --timeout/-t` |
93
+ | `azure --setup --credentials --service-principal --subscription --resource-group-location --resource-group-name --iothub-sku --iothub-name --edge-device-id --update-dotenv` | `iothub setup --credentials --service-principal --subscription --resource-group-location --resource-group-name --iothub-sku --iothub-name --edge-device-id --update-dotenv/-u` |
94
+ | `modules --add --template` | `solution add --template` | `add --template/-t` |
95
+ | `modules --build --push --deploy` | `solution build --push/-p --deploy/-d` | `build --push/-p --deploy/-d` |
96
+ | `modules --push --deploy` | `solution push --deploy/-d --no-build` | `push --deploy/-d --no-build` |
97
+ | `modules --deploy` | `solution deploy` | `deploy` |
98
+ | `runtime --setup` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |
99
+ | `runtime --start` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |
100
+ | `runtime --stop` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |
101
+ | `runtime --restart` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |
102
+ | `runtime --status` | *deprecated, see [Retirement of `iotedgectl`](#retirement-of-iotedgectl) section* |
103
+ | `docker --setup-registry` | `docker setup` |
104
+ | `docker --clean --remove-modules --remove-containers --remove-images` | `docker clean --modules/-m --containers/-c --image/-i` |
105
+ | `docker --logs --show-logs --save-logs` | `docker log --show/-l --save/-s` | `docker log --show/-l --save/-s` |
106
106
 
107
107
  ### Deployment manifest template
108
108
  IoT Edge Dev Tool 0.82.0 relies on the deployment manifest template to build the solution (see [Deprecation of `ACTIVE_MODULES`](#deprecation-of-active_modules) section for details). By default, it's the `deployment.template.json` file in the root of the solution folder, but you can also customize it with the `DEPLOYMENT_CONFIG_TEMPLATE_FILE` environment variable. The major difference between deployment manifest template and deployment manifest is that module image URLs in deployment manifest template can be placeholders (whose format looks like `${MODULES.filtermodule.amd64}`). The image placeholders can help you easily update the referenced module and image platform without typing lengthy image URLs. When building solutions, IoT Edge Dev Tool will parse the image placeholders, expand them with the actual image URLs and save the results in the deployment manifest in the config output folder. By default, it's the `deployment.json` file in the `config` folder, but you can also customize it with the `DEPLOYMENT_CONFIG_FILE` and `CONFIG_OUTPUT_DIR` environment variables. In addition, when adding modules, IoT Edge Dev Tool will add a corresponding section for the module in the deployment manifest template with `${MODULES.<module-name>.amd64}` as the image.
s/docs/quickstart.md ADDED
@@ -0,0 +1,152 @@
1
+ # Quickstart
2
+
3
+ This quickstart will run a container, create a solution, setup Azure resources, build and deploy modules to your device, setup and start the IoT Edge simulator, monitor messages flowing into IoT Hub, and finally deploy to the IoT Edge runtime.
4
+
5
+ At the end of this quickstart, you should have the following:
6
+
7
+ - Development environment.
8
+ - IoT Hub deployed in your Azure subscription.
9
+ - A directory with the [IoT edge deployment manifest](https://docs.microsoft.com/en-us/azure/iot-edge/module-composition?view=iotedge-2020-11), [.env file](.env.tmp) with the environment variables needed for the `iotedgedev` tool, and the source file of a custom IoT edge module (`filtermodule`).
10
+ - The docker image of the `filtermodule`.
11
+ - Deploying the IoT edge modules defined in the manifest on a VM or IoT Edge simulator.
12
+ - Monitoring the messages sent to the IoT Hub.
13
+ - Cleaning up the docker containers and images.
14
+
15
+ ## Pre-requisites
16
+
17
+ - Docker (see [Install Docker docs](environment-setup/install-docker) for details) and add user to `docker` Unix group (see [documentation](https://docs.docker.com/engine/install/linux-postinstall/)).
18
+
19
+ ## Quickstart steps
20
+
21
+ 1. Setup your environment
22
+
23
+ There are three options to setup your environment:
24
+
25
+ - Setup the development environment manually. Please follow the [Manual Development Machine Setup Wiki](environment-setup/manual-dev-machine-setup).
26
+ - Starting the devcontainer in VS Code (see [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers) for steps on how to do so).
27
+ - Starting the devcontainer with Docker. Please follow the [Run the IoT Edge Dev Container with Docker docs](environment-setup/run-devcontainer-docker).
28
+
29
+ 1. Initialize IoT Edge solution and setup Azure resources.
30
+
31
+ ```sh
32
+ iotedgedev init <foldername>
33
+ ```
34
+
35
+ > `iotedgedev init` will create a solution in a new folder and setup your Azure IoT Hub in a single command. The solution comes with a default C# module named `filtermodule`.
36
+
37
+ <details>
38
+ <summary>More information</summary>
39
+
40
+ 1. You will see structure of current folder like below:
41
+
42
+ ```tree
43
+ │ .env
44
+ │ .gitignore
45
+ │ deployment.debug.template.json
46
+ │ deployment.template.json
47
+ │
48
+ ├─.vscode
49
+ │ launch.json
50
+ │
51
+ └─modules
52
+ └─filtermodule
53
+ │ .gitignore
54
+ │ Dockerfile.amd64
55
+ │ Dockerfile.amd64.debug
56
+ │ Dockerfile.arm32v7
57
+ │ Dockerfile.windows-amd64
58
+ │ filtermodule.csproj
59
+ │ module.json
60
+ │ Program.cs
61
+ ```
62
+
63
+ 1. Open `.env` file, you will see the `IOTHUB_CONNECTION_STRING` and `DEVICE_CONNECTION_STRING` environment variables filled correctly.
64
+ 2. Open `deployment.template.json` file.
65
+ 1. You will see below section in the modules section:
66
+
67
+ ```json
68
+ "filtermodule": {
69
+ "version": "1.0",
70
+ "type": "docker",
71
+ "status": "running",
72
+ "restartPolicy": "always",
73
+ "settings": {
74
+ "image": "${MODULES.filtermodule}",
75
+ "createOptions": {}
76
+ }
77
+ }
78
+ ```
79
+
80
+ 1. Two default routes are added:
81
+
82
+ ```json
83
+ "routes": {
84
+ "sensorTofiltermodule": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/filtermodule/inputs/input1\")",
85
+ "filtermoduleToIoTHub": "FROM /messages/modules/filtermodule/outputs/* INTO $upstream"
86
+ }
87
+ ```
88
+
89
+ 3. You will see privacy statement like below:
90
+
91
+ ```txt
92
+ Welcome to iotedgedev!
93
+ -------------------------
94
+ Telemetry
95
+ ---------
96
+ The iotedgedev collects usage data in order to improve your experience.
97
+ The data is anonymous and does not include commandline argument values.
98
+ The data is collected by Microsoft.
99
+
100
+ You can change your telemetry settings by updating 'collect_telemetry' to 'no' in ~/.iotedgedev/setting.ini
101
+ ```
102
+
103
+ </details>
104
+
105
+ 3. Build IoT Edge module images.
106
+
107
+ ```sh
108
+ iotedgedev build
109
+ ```
110
+
111
+ > This step will build user modules in deployment.template.json targeting amd64 platform.
112
+
113
+ <details>
114
+ <summary>More information</summary>
115
+
116
+ 1. You will see a "BUILD COMPLETE" for each module and no error messages in the terminal output.
117
+ 2. Open `config/deployment.amd64.json` file, you will see the module image placeholders expanded correctly.
118
+ 3. Run `sudo docker image ls`, you will see the module images you just built.
119
+
120
+ </details>
121
+
122
+ 4. Run IoT Edge modules.
123
+
124
+ Edge modules can be started in two different ways using `iotedgedev`:
125
+
126
+ - Deploying them on a VM; please find the steps to do so in [Set up and start modules on a virtual machine](run-modules-on-vm);
127
+ - or in your own development machine using the `iotedgedev` simulator; please follow [Set up and start the IoT Edge Simulator](run-modules-on-simulator).
128
+
129
+ 5. Monitor messages sent from device to IoT Hub.
130
+
131
+ ```sh
132
+ iotedgedev monitor
133
+ ```
134
+
135
+ <details>
136
+ <summary>More information</summary>
137
+
138
+ 1. You will see your expected messages sending to IoT Hub
139
+ 2. Stopping the monitor doesn't stop the simulator. It will continue running until it is explicitely stopped using `iotedgedev stop` and at that time all containers used by the simulator will be cleaned up.
140
+
141
+ </details>
142
+
143
+ 6. Stop docker containers and remove images.
144
+
145
+ ```sh
146
+ # stop containers started by the simulator
147
+ iotedgedev stop
148
+ # remove stopped containers
149
+ iotedgedev docker clean -c
150
+ # remove docker images
151
+ iotedgedev docker clean -
152
+ ```
@@ -0,0 +1,18 @@
1
+
2
+ # Set up and start the IoT Edge Simulator
3
+
4
+ In order to run the modules defined in a deployment configuration (such as `config/deployment.amd64.json`) on your development machine using the `iotedgedev` simulator run the following command:
5
+
6
+ ```sh
7
+ iotedgedev start --setup --file config/deployment.amd64.json
8
+ ```
9
+
10
+ > The [IoT Edge Hub Simulator](https://github.com/Azure/iotedgehubdev) starts the containers defined in the IoT edge device manifest in your local machine.
11
+
12
+ <details>
13
+ <summary>More information</summary>
14
+
15
+ 1. You will see an "IoT Edge Simulator has been started in solution mode." message at the end of the terminal output
16
+ 2. Run ` docker ps`, you will see your modules running as well as an edgeHubDev container
17
+
18
+ </details>
@@ -0,0 +1,54 @@
1
+ # Set up and start modules on a virtual machine
2
+
3
+ 1. [**Set up virtual machine to run Azure IoT Edge**](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-ubuntuvm)
4
+ 2. **Create and configure an ACR (Azure Container Registry)**
5
+ 1. [Create an Azure Container Registry](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal)
6
+ 2. Configure `.env` that was generated in the `iotedgedev init` step with the ACR by modifying these lines with appropriate values:
7
+
8
+ ```sh
9
+ CONTAINER_REGISTRY_SERVER="localhost:5000"
10
+ CONTAINER_REGISTRY_USERNAME=""
11
+ CONTAINER_REGISTRY_PASSWORD=""
12
+ ```
13
+
14
+ 3. **Push modules to ACR with**
15
+
16
+ `iotedgedev push`
17
+
18
+ 4. **Add registry credentials to deployment manifest**
19
+
20
+ 1. Replace generated `deployment.template.json` field `registryCredentials` with
21
+
22
+ ```json
23
+ "registryCredentials": {
24
+ "privateAcr": {
25
+ "username": "$CONTAINER_REGISTRY_USERNAME",
26
+ "password": "$CONTAINER_REGISTRY_PASSWORD",
27
+ "address": "$CONTAINER_REGISTRY_SERVER"
28
+ }
29
+ }
30
+ ```
31
+
32
+ > Note: `privateAcr` can be renamed to anything else
33
+ 2. Regenerate the `config/deployment.amd64.json`
34
+
35
+ `iotedgedev genconfig`
36
+
37
+ 5. **Deploy modules to device**
38
+
39
+ `iotedgedev solution deploy`
40
+
41
+ 6. **Troubleshooting**
42
+
43
+ - Verify modules deployment status via executing:
44
+
45
+ ```bash
46
+ # Populate variables from .env
47
+ edge_device_id=$(dotenv get DEVICE_CONNECTION_STRING | grep -oP '(?<=DeviceId=).*(?=;Shared)')
48
+ iot_hub_connection_string=$(dotenv get IOTHUB_CONNECTION_STRING)
49
+ # Execute query
50
+ az iot hub module-identity list --device-id $edge_device_id --login $iot_hub_connection_string
51
+ ```
52
+
53
+ - [Troubleshoot IoT Edge devices from the Azure portal](https://docs.microsoft.com/en-us/azure/iot-edge/troubleshoot-in-portal)
54
+ - SSH into the virtual machine and follow [troubleshoot your IoT Edge device](https://docs.microsoft.com/en-us/azure/iot-edge/troubleshoot)
@@ -1,20 +1,21 @@
1
1
  1. `Invalid Reference Format`
2
- ```
2
+
3
+ ```sh
3
4
  500 Server Error: Internal Server Error for url: http+docker://localunixsocket/v1.30/images
4
5
  500 Server Error: Internal Server Error ("invalid reference format")
5
6
  ```
6
7
 
7
8
  Solution: You likely installed Docker via `sudo apt install docker.io`. Use the proper steps for [CE here](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce), or use the [convenience script](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-convenience-script).
8
9
 
9
- 1. `('Connection aborted.', error(2, 'No such file or directory'))`
10
+ 2. `('Connection aborted.', error(2, 'No such file or directory'))`
10
11
 
11
12
  This means that you have likely do not have `DOCKER_HOST` Environment Variable set.
12
13
 
13
- ```
14
+ ```sh
14
15
  ERROR: Could not login to Container Registry. Please verify your credentials in CONTAINER_REGISTRY_ environment variables.
15
16
  ```
16
17
 
17
- ```
18
+ ```sh
18
19
  ('Connection aborted.', error(2, 'No such file or directory'))
19
20
  ERROR: Could not connect to docker daemon.
20
21
  ERROR: Docker is unavailable
@@ -1,26 +1,26 @@
1
1
  # Usage
2
2
 
3
- You can use the IoT Edge Dev Tool container to avoid having to install all the dependencies on your local dev machine. The only thing you need to install is Docker. All of the other dev dependencies are included in the container. Please see the [Quickstart](quickstart-with-IoT-Edge-Dev-Container) to learn more.
3
+ You can use the IoT Edge Dev Tool container to avoid having to install all the dependencies on your local dev machine. The only thing you need to install is Docker. All of the other dev dependencies are included in the container. Please see the [Quickstart](quickstart) to learn more.
4
4
 
5
- To set up development machines manually instead of using the IoT Edge Dev Container, please see the [Manual Development Machine Setup Wiki](manual-Dev-Machine-Setup).
5
+ To set up development machines manually instead of using the IoT Edge Dev Container, please see the [Manual Development Machine Setup Wiki](environment-setup/manual-dev-machine-setup).
6
6
 
7
7
  If you are using a separate Edge device, like a Raspberry Pi, you do not need to run all of these steps on your IoT Edge device, you can install and setup Edge runtime directly on the device. See the [Edge Device Setup](edge-device-setup) wiki page for more information on setting up your Edge device.
8
8
 
9
- Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edge Dev Tool has been tested with.
9
+ **Note:** See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edge Dev Tool has been tested with.
10
10
 
11
11
  1. **Initialize IoT Edge solution and setup Azure resources**
12
12
 
13
13
  ```sh
14
- iotedgedev init
14
+ iotedgedev init <folder_name>
15
15
  ```
16
16
 
17
- `iotedgedev init` will run both `iotedgedev new .` and `iotedgedev iothub setup`, which will create a new solution and setup your Azure resources in a single command.
17
+ `iotedgedev init` will run both `iotedgedev new <folder_name>` and `iotedgedev iothub setup`, which will create a new solution and setup your Azure resources in a single command. If `<folder_name>` is not specified, it will default to `.`.
18
18
 
19
19
  If you want to use your existing IoT Hub and IoT Edge device, you can run `iotedgedev new .`, and update the `.env` file with the IoT Hub connection string and IoT Edge device connection string.
20
20
 
21
21
  `iotedgedev init` and `iotedgedev new .` will add a default C# module named `filtermodule` to the solution. To customize this behavior, append the parameters `--module <module-name--template <template>`.
22
22
 
23
- 1. **Add modules to IoT Edge solution**
23
+ 2. **Add modules to IoT Edge solution**
24
24
 
25
25
  ```sh
26
26
  iotedgedev add <module-name--template <template>
@@ -28,7 +28,7 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
28
28
 
29
29
  Currently the available template values are `c`, `csharp`, `java`, `nodejs`, `python`, `csharpfunction`. We are working on supporting more templates.
30
30
 
31
- 1. **Build IoT Edge module images**
31
+ 3. **Build IoT Edge module images**
32
32
 
33
33
  ```sh
34
34
  sudo iotedgedev build
@@ -38,7 +38,7 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
38
38
  * You are on Windows or macOS.
39
39
  * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
40
40
 
41
- 1. **Setup the [IoT Edge Simulator]((https://pypi.org/project/iotedgehubdev/).)**
41
+ 4. **Setup the [IoT Edge Simulator](https://pypi.org/project/iotedgehubdev/)**
42
42
 
43
43
  ```sh
44
44
  sudo iotedgedev setup
@@ -48,7 +48,7 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
48
48
 
49
49
  You can avoid `sudo` if you are on Windows, and running IoT Edge Dev Tool outside Docker container.
50
50
 
51
- 1. **Start the IoT Edge Simulator to run the solution**
51
+ 5. **Start the IoT Edge Simulator to run the solution**
52
52
 
53
53
  ```sh
54
54
  sudo iotedgedev start
@@ -60,13 +60,13 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
60
60
  * You are on Windows or macOS.
61
61
  * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
62
62
 
63
- 1. **Monitor messages sent from IoT Edge Simulator to IoT Hub**
63
+ 6. **Monitor messages sent from IoT Edge Simulator to IoT Hub**
64
64
 
65
65
  ```sh
66
66
  iotedgedev monitor
67
67
  ```
68
68
 
69
- 1. **Stop the IoT Edge Simulator**
69
+ 7. **Stop the IoT Edge Simulator**
70
70
 
71
71
  ```sh
72
72
  sudo iotedgedev stop
@@ -76,12 +76,12 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
76
76
  * You are on Windows or macOS.
77
77
  * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
78
78
 
79
- 1. **Setup the IoT Edge Runtime**
79
+ 8. **Setup the IoT Edge Runtime**
80
80
 
81
81
  1. Copy the device connection string from the `DEVICE_CONNECTION_STRING` environment variable in the `.env` file, [Azure Portal](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-register-device-portal#retrieve-the-connection-string), or [Azure CLI](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-register-device-cli#retrieve-the-connection-string).
82
- 1. Follow [Edge Device Setup](edge-device-setup) to setup and start the IoT Edge Runtime with the copied device connection string
82
+ 2. Follow [Edge Device Setup](edge-device-setup) to setup and start the IoT Edge Runtime with the copied device connection string
83
83
 
84
- 1. **Push IoT Edge module images**
84
+ 9. **Push IoT Edge module images**
85
85
 
86
86
  ```sh
87
87
  sudo iotedgedev push
@@ -91,7 +91,7 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
91
91
  * You are on Windows or macOS.
92
92
  * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
93
93
 
94
- 1. **Deploy modules to IoT Edge device**
94
+ 10. **Deploy modules to IoT Edge device**
95
95
 
96
96
  ```sh
97
97
  iotedgedev deploy
@@ -99,24 +99,23 @@ Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edg
99
99
 
100
100
  You can also combine push and deploy with `iotedgedev push --deploy`
101
101
 
102
- 1. **Deploy modules with automatic deployments to IoT Hub**
102
+ 11. **Deploy modules with automatic deployments to IoT Hub**
103
103
 
104
104
  ```sh
105
105
  iotedgedev iothub deploy --name TEXT --priority TEXT --target-condition TEXT
106
106
  ```
107
-
107
+
108
108
  You can also combine tagging the device and deploy with the `--device-tag TEXT` flag
109
109
 
110
110
  > More information on how automatic deployments work can be found here: <https://docs.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring?view=iotedge-2020-11>
111
111
 
112
- 1. **Tag IoT Edge Device**
112
+ 12. **Tag IoT Edge Device**
113
113
 
114
114
  ```sh
115
115
  iotedgedev solution tag --tags TEXT
116
116
  ```
117
117
 
118
-
119
- 1. **Monitor messages sent from IoT Edge Runtime to IoT Hub**
118
+ 13. **Monitor messages sent from IoT Edge Runtime to IoT Hub**
120
119
 
121
120
  ```sh
122
121
  iotedgedev monitor
s/iotedgedev/__init__.py CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  __author__ = 'Microsoft Corporation'
4
4
  __email__ = 'opencode@microsoft.com'
5
- __version__ = '3.3.4'
5
+ __version__ = '3.3.5'
6
6
  __AIkey__ = 'fed7fc65-5b4a-4e66-9d46-c5f016d4e2b4'
s/iotedgedev/azurecli.py CHANGED
@@ -148,10 +148,13 @@ class AzureCli:
148
148
  pass
149
149
  else:
150
150
  err = None
151
+ err_list = []
151
152
  try:
152
- err = stderr_queue.get_nowait()
153
+ while True:
154
+ err_list.append(stderr_queue.get_nowait())
153
155
  except Empty:
154
156
  pass
157
+ err = "\n".join(err_list)
155
158
  # Avoid empty sys.excepthook errors from underlying future
156
159
  # There is already a uAMQP issue in work for this
157
160
  # https://github.com/Azure/azure-uamqp-python/issues/30
@@ -465,9 +468,16 @@ class AzureCli:
465
468
  self.output.prompt(
466
469
  "Creating IoT Hub. Please wait as this could take a few minutes to complete...")
467
470
 
468
- result = self.invoke_az_cli_outproc(["iot", "hub", "create", "--name", value, "--resource-group",
469
- resource_group, "--sku", sku, "--query", "[].{\"IoT Hub\":name}", "--out", "table"],
470
- f("Could not create the IoT Hub {value} in {resource_group} with sku {sku}."), stdout_io=io, stderr_io=error_io)
471
+ cmd = ["iot", "hub", "create", "--name", value, "--resource-group", resource_group, "--sku", sku, "--query", "[].{\"IoT Hub\":name}", "--out", "table"]
472
+ if sku == "F1":
473
+ cmd = cmd + ["--partition-count", "2"]
474
+ # the default partition-count is 4, but F1 allows only 2
475
+ # from `az iot hub create --help`:
476
+ # The partition count is the number of partitions that the IoT Hub uses to distribute messages.
477
+ # The default value is 4.
478
+ # In Azure Portal the default and only value is 2.
479
+
480
+ result = self.invoke_az_cli_outproc(cmd, f("Could not create the IoT Hub {value} in {resource_group} with sku {sku}."), stdout_io=io, stderr_io=error_io)
471
481
  if not result and error_io.getvalue():
472
482
  self.output.error(error_io.getvalue())
473
483
  self.output.line()