iotedgedev 3.3.4__zip → 3.3.6__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 (134) hide show
  1. s/.git/FETCH_HEAD +3 -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/revert-594-user/vikas_bug-pyopenssl +1 -0
  19. s/.git/logs/refs/remotes/origin/spmcdono/fix-pipeline-test-install +1 -1
  20. s/.git/logs/refs/remotes/origin/spmcdono/layered-deployments +1 -1
  21. s/.git/logs/refs/remotes/origin/spmcdono/pypi-package-test-pipeline +1 -1
  22. s/.git/logs/refs/remotes/origin/spmcdono/remove-py2 +1 -1
  23. s/.git/logs/refs/remotes/origin/spmcdono/remove-py2-dev +1 -1
  24. s/.git/logs/refs/remotes/origin/spmcdono/test-native-runtime-install +1 -1
  25. s/.git/logs/refs/remotes/origin/spmcdono/update-pipeline +1 -1
  26. s/.git/logs/refs/remotes/origin/user/marine/EliiseS/devcontainer +1 -1
  27. s/.git/logs/refs/remotes/origin/user/marine/fixsimver +1 -1
  28. s/.git/logs/refs/remotes/origin/user/marine/layereddeploymentsbuildtest +1 -1
  29. s/.git/logs/refs/remotes/origin/user/marine/master-to-main +1 -1
  30. s/.git/logs/refs/remotes/origin/user/marine/pipeline +1 -1
  31. s/.git/logs/refs/remotes/origin/user/vikas +1 -1
  32. s/.git/logs/refs/remotes/origin/user/vikas-bud-fix +1 -0
  33. s/.git/logs/refs/remotes/origin/user/vikas0212/verify-tests +1 -1
  34. s/.git/logs/refs/remotes/origin/user/vikas2 +1 -1
  35. s/.git/logs/refs/remotes/origin/user/vikas_bug-pyopenssl +1 -0
  36. s/.git/logs/refs/remotes/origin/user/vikas_pypi +1 -1
  37. s/.git/logs/refs/remotes/origin/user/vikas_pypi-1 +1 -1
  38. s/.git/logs/refs/remotes/origin/user/vikas_supplychain-issue1 +1 -0
  39. s/.git/logs/refs/remotes/origin/user/vikas_testing +1 -1
  40. s/.git/logs/refs/remotes/origin/user/vikas_trigger +1 -0
  41. s/.git/logs/refs/remotes/origin/user/vikas_trigger_new +1 -0
  42. s/.git/logs/refs/remotes/origin/user/xinzed/dps_conn_str +1 -1
  43. s/.git/logs/refs/remotes/origin/user/xinzed/update-python-docker +1 -1
  44. s/.git/logs/refs/remotes/origin/vikas/azure +1 -1
  45. s/.git/logs/refs/remotes/origin/vikas/dependebot +1 -1
  46. s/.git/logs/refs/remotes/origin/vikas-triggers +1 -0
  47. s/.git/logs/refs/remotes/origin/xinzed/3_1_0rc1 +1 -1
  48. s/.git/logs/refs/remotes/origin/xinzed/update-runtime +1 -1
  49. s/.git/objects/pack/pack-b6923255c7f7ef51c11dbd2c8db7ce310d4daf99.idx +0 -0
  50. s/.git/objects/pack/{pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.pack → pack-b6923255c7f7ef51c11dbd2c8db7ce310d4daf99.pack} +0 -0
  51. s/.git/refs/remotes/origin/dependabot/pip/cookiecutter-2.1.1 +1 -0
  52. s/.git/refs/remotes/origin/main +1 -1
  53. s/.git/refs/remotes/origin/revert-594-user/vikas_bug-pyopenssl +1 -0
  54. s/.git/refs/remotes/origin/user/vikas-bud-fix +1 -0
  55. s/.git/refs/remotes/origin/user/vikas_bug-pyopenssl +1 -0
  56. s/.git/refs/remotes/origin/user/vikas_supplychain-issue1 +1 -0
  57. s/.git/refs/remotes/origin/user/vikas_trigger +1 -0
  58. s/.git/refs/remotes/origin/user/vikas_trigger_new +1 -0
  59. s/.git/refs/remotes/origin/vikas-triggers +1 -0
  60. s/.git/refs/tags/v3.3.5 +1 -0
  61. s/.git/refs/tags/v3.3.6 +1 -0
  62. s/.github/ISSUE_TEMPLATE/01_bug_report.yml +55 -0
  63. s/.github/ISSUE_TEMPLATE/02_feature_request.yml +14 -0
  64. s/.github/pull_request_template.md +35 -0
  65. s/.github/workflows/wiki.yml +1 -1
  66. s/.vscode/launch.json +2 -2
  67. s/.vscode/settings.json +2 -1
  68. s/CHANGELOG.md +68 -4
  69. s/CONTRIBUTING.md +30 -97
  70. s/Makefile +1 -2
  71. s/README.md +16 -169
  72. s/SECURITY.md +41 -0
  73. s/build/lib/iotedgedev/__init__.py +1 -1
  74. s/build/lib/iotedgedev/azurecli.py +47 -4
  75. s/build/lib/iotedgedev/cli.py +98 -52
  76. s/build/lib/iotedgedev/connectionstring.py +10 -8
  77. s/build/lib/iotedgedev/edge.py +1 -1
  78. s/build/lib/iotedgedev/envvars.py +1 -0
  79. s/build/lib/iotedgedev/output.py +4 -0
  80. s/dist/iotedgedev-3.3.6-py3-none-any.whl +0 -0
  81. s/docker/tool/build-docker.sh +3 -3
  82. s/docker/tool/deps.txt +1 -1
  83. s/docker/tool/linux/Dockerfile.base +7 -4
  84. s/docker/tool/windows/Dockerfile.base +1 -1
  85. s/docs/_Sidebar.md +5 -4
  86. s/docs/{Azure-Setup.md → azure-setup.md} +19 -18
  87. s/docs/{Command-List.md → command-list.md} +1 -0
  88. s/docs/{Edge-Device-Setup.md → edge-device-setup.md} +5 -4
  89. s/docs/environment-setup/install-docker.md +9 -0
  90. s/docs/environment-setup/manual-dev-machine-setup.md +79 -0
  91. s/docs/{Python-Virtual-Environment-Setup.md → environment-setup/python-virtual-environment-setup.md} +7 -8
  92. s/docs/environment-setup/run-devcontainer-docker.md +24 -0
  93. s/docs/home.md +10 -0
  94. s/docs/{Migration-Guides.md → migration-guides.md} +26 -26
  95. s/docs/quickstart.md +152 -0
  96. s/docs/run-modules-on-simulator.md +18 -0
  97. s/docs/run-modules-on-vm.md +54 -0
  98. s/docs/{Troubleshooting.md → troubleshooting.md} +5 -4
  99. s/docs/{Usage.md → usage.md} +19 -20
  100. s/iotedgedev/__init__.py +1 -1
  101. s/iotedgedev/azurecli.py +47 -4
  102. s/iotedgedev/cli.py +98 -52
  103. s/iotedgedev/connectionstring.py +10 -8
  104. s/iotedgedev/edge.py +1 -1
  105. s/iotedgedev/envvars.py +1 -0
  106. s/iotedgedev/output.py +4 -0
  107. s/iotedgedev.egg-info/PKG-INFO +1 -1
  108. s/iotedgedev.egg-info/SOURCES.txt +2 -1
  109. s/iotedgedev.egg-info/requires.txt +2 -2
  110. s/requirements.txt +3 -3
  111. s/setup.cfg +1 -1
  112. s/setup.py +5 -3
  113. s/tests/__init__.py +1 -1
  114. s/tests/assets/test_solution_shared_lib/deployment.template.json +1 -1
  115. s/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json +43 -9
  116. s/tests/test_iotedgedev_iothub_deploy.py +0 -1
  117. s/tests/test_iotedgedev_solution.py +3 -4
  118. s/tests/test_iotedgedev_solution_build.py +0 -19
  119. s/tests/test_iotedgedev_solution_deploy.py +197 -0
  120. s/tests/test_iotedgedev_solution_init.py +34 -0
  121. s/.git/logs/refs/remotes/origin/eliises/add-device-tagging-docs +0 -1
  122. s/.git/objects/pack/pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.idx +0 -0
  123. s/.git/refs/remotes/origin/eliises/add-device-tagging-docs +0 -1
  124. s/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
  125. s/.github/ISSUE_TEMPLATE/feature_request.md +0 -7
  126. s/dist/iotedgedev-3.3.4-py3-none-any.whl +0 -0
  127. s/docs/Home.md +0 -10
  128. s/docs/Manual-Dev-Machine-Setup.md +0 -77
  129. s/docs/Quickstart-with-IoT-Edge-Dev-Container.md +0 -145
  130. s/pull_request_template.md +0 -9
  131. s/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json +0 -12
  132. /s/docs/{Command-Tips.md → command-tips.md} +0 -0
  133. /s/docs/{Overview.md → overview.md} +0 -0
  134. /s/docs/{Test-Coverage.md → test-coverage.md} +0 -0
@@ -1,4 +1,4 @@
1
- #### Automated Setup
1
+ ## Automated Setup
2
2
 
3
3
  The following will show you how to setup your Azure Resources via the CLI instead of using the Portal.
4
4
 
@@ -16,7 +16,7 @@ Here are all the `iotedgedev iothub setup` command options:
16
16
 
17
17
  > You can override all of these parameters with environment variables. Please see the .env file in your solution for details.
18
18
 
19
- ```
19
+ ```sh
20
20
  iotedgedev iothub setup
21
21
  --credentials USERNAME PASSWORD
22
22
  --service-principal USERNAME PASSWORD TENANT
@@ -31,7 +31,7 @@ iotedgedev iothub setup
31
31
 
32
32
  You can use the following `az cli` command to create a service principal:
33
33
 
34
- ```
34
+ ```sh
35
35
  az ad sp create-for-rbac -n "iotedgedev01"
36
36
  ```
37
37
 
@@ -39,17 +39,17 @@ az ad sp create-for-rbac -n "iotedgedev01"
39
39
 
40
40
  Alternatively, you can deploy the IoT Hub **and** Container Registry with this **Deploy to Azure** template:
41
41
 
42
- [![Azure Deployment](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedgedev%2Fmaster%2Fassets%2Fdeploy%2FARMDeployment%2Fazuredeploy.json)
42
+ [![Deploy to Azure Button](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedgedev%2Fmain%2Fassets%2Fdeploy%2FARMDeployment%2Fazuredeploy.json)
43
43
 
44
44
  > Note: If you do not need a Container Registry, or are planning to use a local registry, then you should run the **iotedgedev iothub setup** command instead of running this **Deploy to Azure** template, because the template includes a Container Registry.
45
45
 
46
- #### Manual Setup
47
- 1. [**Create Azure IoT Hub**](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-getstarted#create-an-iot-hub)
48
- 1. **Create Edge Device** using the Azure Portal
49
- - In your IoT Hub, click "IoT Edge", then click "Add IoT Edge Device"
46
+ ## Manual Setup
50
47
 
51
- 1. **Container Registry**
52
- When you develop for IoT Edge, you need to host your images in a container registry, which the IoT Edge runtime will fetch the modules images from when it starts.
48
+ 1. [**Create Azure IoT Hub**](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-getstarted#create-an-iot-hub)
49
+ 2. **Create Edge Device** using the Azure Portal
50
+ - In your IoT Hub, click "IoT Edge", then click "Add IoT Edge Device"
51
+ 3. **Container Registry**
52
+ When you develop for IoT Edge, you need to host your images in a container registry, which the IoT Edge runtime will fetch the modules images from when it starts.
53
53
 
54
54
  > By default, the IoT Edge Dev Tool will use the Local Registry.
55
55
 
@@ -59,35 +59,36 @@ Alternatively, you can deploy the IoT Hub **and** Container Registry with this *
59
59
 
60
60
  Set `CONTAINER_REGISTRY_SERVER` to `localhost:5000` and leave `CONTAINER_REGISTRY_USERNAME` and `CONTAINER_REGISTRY_PASSWORD` blank.
61
61
 
62
- ```
62
+ ```sh
63
63
  CONTAINER_REGISTRY_SERVER="localhost:5000"
64
64
  ```
65
65
 
66
- 1. Azure Container Registry
66
+ 2. Azure Container Registry
67
67
 
68
68
  You can create an [**Azure Container Registry**](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) and host your images there.
69
69
  - Make sure you enable Admin Access when you create the Azure Container Registry
70
70
 
71
71
  After created, open .env and set the following:
72
72
 
73
- ```
73
+ ```sh
74
74
  CONTAINER_REGISTRY_SERVER="ACR URI"
75
75
  CONTAINER_REGISTRY_USERNAME="ACR USERNAME"
76
76
  CONTAINER_REGISTRY_PASSWORD="ACR PASSWORD"
77
77
  ```
78
78
 
79
79
  Example:
80
- ```
80
+
81
+ ```sh
81
82
  CONTAINER_REGISTRY_SERVER="jong.azurecr.io"
82
83
  CONTAINER_REGISTRY_USERNAME="jong"
83
84
  CONTAINER_REGISTRY_PASSWORD="p@$$w0rd"
84
85
  ```
85
86
 
86
- 1. Docker Hub
87
+ 3. Docker Hub
87
88
 
88
89
  You can also host your images on Docker Hub. Create a Docker Hub account and then open .env and enter the following:
89
90
 
90
- ```
91
+ ```sh
91
92
  CONTAINER_REGISTRY_SERVER="DOCKER HUB USERNAME"
92
93
  CONTAINER_REGISTRY_USERNAME="DOCKER HUB USERNAME"
93
94
  CONTAINER_REGISTRY_PASSWORD="DOCKER HUB PASSWORD"
@@ -95,8 +96,8 @@ Alternatively, you can deploy the IoT Hub **and** Container Registry with this *
95
96
 
96
97
  Example:
97
98
 
98
- ```
99
+ ```sh
99
100
  CONTAINER_REGISTRY_SERVER="jongallant"
100
101
  CONTAINER_REGISTRY_USERNAME="jongallant"
101
102
  CONTAINER_REGISTRY_PASSWORD="p@$$w0rd"
102
- ```
103
+ ```
@@ -335,6 +335,7 @@ Options:
335
335
  --iothub-name TEXT The IoT Hub Name (Creates a new IoT Hub if not found). [required]
336
336
  --edge-device-id TEXT The IoT Edge Device Id (Creates a new Edge Device if not found). [required]
337
337
  -u, --update-dotenv If True, the current .env will be updated with the IoT Hub and Device connection strings. [default: False; required]
338
+ --create-edge-vm Create an Edge-enabled Virtual Machine by using <https://aka.ms/iotedge-vm-deploy>. [default: False; required]
338
339
  -h, --help Show this message and exit.
339
340
  ```
340
341
 
@@ -7,17 +7,18 @@ IoT Edge Dev Tool is intended to help with IoT Edge development and doesn't nece
7
7
 
8
8
  Having said that, there's nothing stopping you from deploying IoT Edge Dev Tool to your IoT Edge device. It may be helpful if you want to run the `iotedgedev docker clean` command to clean up Docker containers and images. Or if you want to run `iotedgedev docker log --show` to see all the log files on the device or `iotedgedev docker log --save` to output to the LOGS_PATH directory.
9
9
 
10
- > Please note that you will need .NET Core SDK 2.1 to add C# modules and C# Function modules on a Raspberry Pi. Check [Manual Dev Machine Setup](manual-dev-machine-setup#c-module-and-c-azure-functions-module) to learn how to install.
10
+ > Please note that you will need .NET Core SDK 2.1 to add C# modules and C# Function modules on a Raspberry Pi. Check [Manual Dev Machine Setup](environment-setup/manual-dev-machine-setup) to learn how to install.
11
11
 
12
12
  ### Raspberry Pi
13
13
 
14
- ##### Config Changes
14
+ #### Config Changes
15
+
15
16
  If you are running on Raspberry Pi you need to use the arm32v7 Dockerfile. Open `deployment.template.json`, find the JSON dictionary for `filtermodule`, and replace `"image": "${MODULES.filtermodule.amd64}",` with `"image": "${MODULES.filtermodule.arm32v7}",`
16
17
 
17
- ##### Environment Variable Change
18
+ #### Environment Variable Change
18
19
 
19
20
  Open your `.env` file and add `arm32v7` to your `ACTIVE_DOCKER_PLATFORMS` setting. This will tell the IoT Edge Dev Tool to also build the arm32v7 images.
20
21
 
21
- ```
22
+ ```sh
22
23
  ACTIVE_DOCKER_PLATFORMS="amd64,arm32v7"
23
24
  ```
@@ -0,0 +1,9 @@
1
+ # Install [Docker CE](https://docs.docker.com/install/)
2
+
3
+ - Windows
4
+ - Be sure to check whether you are running in Linux container mode or Windows container mode.
5
+ - Linux
6
+ - We've seen some issues with docker.io. If Edge doesn't run for you, then try installing Docker CE directly instead of via docker.io. Use the [CE install steps](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).
7
+ - By default, you need `sudo` to run `docker` commands. If you want to avoid this, please follow the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user).
8
+
9
+ Note: If the device is behind the proxy server, you can set the [proxy manually](https://docs.docker.com/network/proxy/#configure-the-docker-client).
@@ -0,0 +1,79 @@
1
+ Here is what you need to do to get Azure IoT Edge Dev Tool (aka `iotedgedev`) running on your dev machine manually instead of using the IoT Edge Dev Container.
2
+
3
+ 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.
4
+
5
+ > Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edge Dev Tool has been tested with.
6
+
7
+ 1. Install **Python 2.7+ or Python 3.6+** and **pip** (Python 3.6 is recommended)
8
+ - Windows: [Install from Python's website](https://www.python.org/downloads/)
9
+ - Linux: `sudo apt install python-pip` or `sudo apt install python3-pip`
10
+ - macOS: The OpenSSL used by the system built-in Python is old and vulnerable. Please use Python installed with [Homebrew](https://docs.brew.sh/Homebrew-and-Python)
11
+
12
+ 2. Install **[Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)**
13
+
14
+ 3. Install **[Azure CLI IoT extension](https://github.com/Azure/azure-iot-cli-extension/)**
15
+
16
+ - New Install: `az extension add --name azure-iot`
17
+ - Update Install: `az extension update --name azure-iot`
18
+
19
+ 4. (Python < 3.5 only) Install **[Node.js](https://nodejs.org/en/download/)** and the **`iothub-explorer`** package
20
+
21
+ - uamqp, which is needed by Azure CLI IoT extension for monitoring messages, is not supported in Python < 3.5. For Python < 3.5 users, please install [Node.js](https://nodejs.org/en/download/) and the `iothub-explorer` Node.js package: `npm i -g iothub-explorer`
22
+
23
+ 5. (Raspberry Pi only) Install extra system dependencies
24
+
25
+ ```sh
26
+ sudo apt-get install python2.7-dev libffi-dev libssl-dev -y
27
+ ```
28
+
29
+ 6. (Linux only) Install [Docker Compose](https://docs.docker.com/compose/)
30
+
31
+ ```sh
32
+ pip install -U docker-compose
33
+ ```
34
+
35
+ 7. Install **`iotedgedev`**
36
+
37
+ > You do not need to do this if you're going to be developing on iotedgedev
38
+
39
+ > You do not need to run this on the Edge device. See the [Edge Device Setup](edge-device-setup) page for more information on setting up your Edge device.
40
+
41
+ > You can also run under a Python Virtual Environment. See the [Python Virtual Environment Setup](python-virtual-environment-setup) instructions page for details on how to set that up.
42
+
43
+ > There is a known dependency conflict between `iotedgedev` and now-deprecated `azure-iot-edge-runtime-ctl`. Please make sure you have uninstalled `azure-iot-edge-runtime-ctl` before installing `iotedgedev`: `pip uninstall azure-iot-edge-runtime-ctl`, or use a clean virtual environment.
44
+
45
+ ```sh
46
+ pip install -U iotedgedev
47
+ ```
48
+
49
+ 8. Install module dependencies
50
+
51
+ - **C# module and C# Azure Functions module**
52
+
53
+ Install **[.NET Core SDK 2.1 or later](https://www.microsoft.com/net/download)**
54
+ > You need .NET Core SDK 2.1 or later to run it on ARM. There is no official document on installing .NET Core SDK on ARM yet, but you can follow the [ARM32v7 Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/src/sdk/3.1/buster/arm32v7/Dockerfile).
55
+
56
+ - **Python module**
57
+
58
+ 1. Install **[Git](https://git-scm.com/)**
59
+ 2. Install **[Cookiecutter](https://github.com/audreyr/cookiecutter)**
60
+
61
+ ```sh
62
+ pip install -U cookiecutter
63
+ ```
64
+
65
+ - **Node.js module**
66
+
67
+ 1. Install **[Node.js](https://nodejs.org/en/download/)**
68
+ 2. Install **[Yeoman](http://yeoman.io/)** and **[Azure IoT Edge Node.js module generator](https://github.com/Azure/generator-azure-iot-edge-module)** packages
69
+
70
+ ```sh
71
+ npm i -g yo generator-azure-iot-edge-module
72
+ ```
73
+
74
+ - **Java module**
75
+
76
+ 1. Install **[JDK](https://www.oracle.com/technetwork/java/javase/downloads/index.html)**
77
+ 2. Install **[Maven](https://maven.apache.org/)**
78
+
79
+ 9. Follow the [Usage Wiki](../usage.md) to learn the usage of IoT Edge Dev Tool
@@ -4,18 +4,17 @@ You can run IoT Edge Dev Tool inside a [Python Virtual Environment](https://docs
4
4
 
5
5
  `pip install virtualenv`
6
6
 
7
- 1. Create a virtual environment
7
+ 2. Create a virtual environment
8
8
 
9
9
  `virtualenv venv`
10
10
 
11
11
  > `venv` is just a env name that can be anything you want, but we recommend sticking with `venv` if you want to contribute to IoT Edge Dev Tool because the `.gitignore` file excludes it.
12
12
 
13
13
  > To create a virtual environment with a Python version different with your system default, just use the `--python/-p` option to specify the Python executable path, *e.g.*:
14
- > ```
15
- > virtualenv --python /usr/bin/python2.7 py27
16
- > ```
14
+ >
15
+ > `virtualenv --python /usr/bin/python2.7 py27`
17
16
 
18
- 1. Activate the virtual environment
17
+ 3. Activate the virtual environment
19
18
 
20
19
  - Windows
21
20
  - cmd.exe: `venv\Scripts\activate.bat`
@@ -24,11 +23,11 @@ You can run IoT Edge Dev Tool inside a [Python Virtual Environment](https://docs
24
23
  - Posix: `source venv/bin/activate`
25
24
  > It will be active until you deactivate it or close the terminal instance.
26
25
 
27
- 1. Install dependencies
26
+ 4. Install dependencies
28
27
 
29
- Continue with the instructions above starting with the [Manual Dev Machine Setup](manual-dev-machine-setup) -> Install Dependencies.
28
+ Continue with the instructions above starting with the [Manual Dev Machine Setup](Environment-Setup/manual-dev-machine-setup) -> Install Dependencies.
30
29
 
31
- 1. Deactivate the virtual environment
30
+ 5. Deactivate the virtual environment
32
31
 
33
32
  When you are done with your virtualenv, you can deactivate it with the follow command:
34
33
 
@@ -0,0 +1,24 @@
1
+ # Run the IoT Edge Dev Container with Docker
2
+
3
+ Before you run the container, you will need to create a local folder to store your IoT Edge solution files.
4
+
5
+ ## Windows
6
+
7
+ ```cmd
8
+ mkdir c:\temp\iotedge
9
+ docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v c:/temp/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev
10
+ ```
11
+
12
+ ## Linux
13
+
14
+ ```bash
15
+ sudo mkdir /home/iotedge
16
+ sudo docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v ~/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev
17
+ ```
18
+
19
+ ## macOS
20
+
21
+ ```bash
22
+ mkdir ~/iotedge
23
+ docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v ~/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev
24
+ ```
s/docs/home.md ADDED
@@ -0,0 +1,10 @@
1
+ Welcome to the IoT Edge Dev Tool wiki!
2
+
3
+ The **IoT Edge Dev Tool** greatly simplifies [Azure IoT Edge](https:/azure.microsoft.com/en-us/services/iot-edge/) development down to simple commands driven by environment variables.
4
+
5
+ - It gets you started with IoT Edge development with the [IoT Edge Dev Container](quickstart) and IoT Edge solution scaffolding that contains a default module and all the required configuration files.
6
+ - It speeds up your inner-loop dev (dev, debug, test) by reducing multi-step build & deploy processes into one-line CLI commands as well as drives your outer-loop CI/CD pipeline. _You can use all the same commands in both stages of your development life-cycle._
7
+
8
+ ## Issues
9
+
10
+ Please use the [GitHub issues page](https://github.com/azure/iotedgedev/issues) to report any issues.
@@ -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.md).
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.md).
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