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
@@ -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()
@@ -3,6 +3,11 @@ import socket
3
3
  import sys
4
4
 
5
5
  import click
6
+ import copy
7
+ import typing as t
8
+
9
+ from click import Command
10
+ from click import Group
6
11
  from fstrings import f
7
12
 
8
13
  from .azurecli import AzureCli
@@ -19,6 +24,16 @@ from .simulator import Simulator
19
24
  from .solution import Solution
20
25
  from .utility import Utility
21
26
 
27
+ # Extend click.Group#add_command(cmd, name) to take deprecated=bool flag by monkey patching.
28
+ def add_command_with_deprecation(self, cmd: Command, name: t.Optional[str] = None, deprecated = False):
29
+ # Directly changing the deprecated flag of the cmd has side-effects on the reference source.
30
+ # To avoid this, copy the cmd object with deepcopy.
31
+ copied_command = copy.deepcopy(cmd)
32
+ copied_command.deprecated = deprecated
33
+ self.add_command(copied_command, name)
34
+
35
+ Group.add_command_with_deprecation = add_command_with_deprecation
36
+
22
37
  CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'], max_content_width=120)
23
38
 
24
39
  output = Output()
@@ -84,14 +99,16 @@ def new(name, module, template, edge_runtime_version, group_id):
84
99
  sol = Solution(output, utility)
85
100
  sol.create(name, module, template, edge_runtime_version, group_id)
86
101
 
87
-
88
- main.add_command(new)
102
+ main.add_command_with_deprecation(new, deprecated=True)
89
103
 
90
104
 
91
105
  @solution.command(context_settings=CONTEXT_SETTINGS,
92
106
  help="Create a new IoT Edge solution and provision Azure resources",
93
107
  # hack to prevent Click truncating help messages
94
108
  short_help="Create a new IoT Edge solution and provision Azure resources")
109
+ @click.argument("name",
110
+ required=False,
111
+ default=".")
95
112
  @click.option("--edge-runtime-version",
96
113
  "-er",
97
114
  default="1.2",
@@ -100,28 +117,22 @@ main.add_command(new)
100
117
  help="Specify the IoT Edge Runtime Version. Currently available 1.0, 1.1, 1.2")
101
118
  @add_module_options(envvars, init=True)
102
119
  @with_telemetry
103
- def init(module, template, group_id, edge_runtime_version):
120
+ def init(name, module, template, group_id, edge_runtime_version):
104
121
  if edge_runtime_version is not None:
105
122
  if (str(edge_runtime_version) != "1.0" and str(edge_runtime_version) != "1.1" and str(edge_runtime_version) != "1.2"):
106
123
  output.info('-edge-runtime-version `{0}` is not valid. Currently supported versions are 1.0, 1.1, 1.2'.format(edge_runtime_version))
107
124
  sys.exit()
108
125
  utility = Utility(envvars, output)
109
126
 
110
- if template == "java":
111
- solcmd = "iotedgedev new . --module {0} --template {1} --edge-runtime-version {2} --group-id {3}".format(module, template, edge_runtime_version, group_id)
112
- else:
113
- solcmd = "iotedgedev new . --module {0} --template {1} --edge-runtime-version {2}".format(module, template, edge_runtime_version)
114
- output.header(solcmd)
115
- ret = utility.call_proc(solcmd.split())
127
+ sol = Solution(output, utility)
128
+ sol.create(name, module, template, edge_runtime_version, group_id)
116
129
 
117
- if ret == 0:
118
- azsetupcmd = "iotedgedev iothub setup --update-dotenv"
119
- output.header(azsetupcmd)
120
- # Had to use call_proc, because @click.invoke doesn't honor prompts
121
- utility.call_proc(azsetupcmd.split())
130
+ azsetupcmd = "iotedgedev iothub setup --update-dotenv"
131
+ output.header(azsetupcmd)
132
+ utility.call_proc(azsetupcmd.split())
122
133
 
123
134
 
124
- main.add_command(init)
135
+ main.add_command_with_deprecation(init, deprecated=True)
125
136
 
126
137
 
127
138
  @solution.command(context_settings=CONTEXT_SETTINGS, help="Push, deploy, start, monitor")
@@ -144,7 +155,7 @@ def add(name, template, group_id):
144
155
  mod.add(name, template, group_id)
145
156
 
146
157
 
147
- main.add_command(add)
158
+ main.add_command_with_deprecation(add, deprecated=True)
148
159
 
149
160
 
150
161
  @solution.command(context_settings=CONTEXT_SETTINGS, help="Build the solution")
@@ -186,7 +197,7 @@ def build(ctx, push, do_deploy, template_file, platform):
186
197
  ctx.invoke(deploy)
187
198
 
188
199
 
189
- main.add_command(build)
200
+ main.add_command_with_deprecation(build, deprecated=True)
190
201
 
191
202
 
192
203
  @solution.command(context_settings=CONTEXT_SETTINGS, help="Push module images to container registry")
@@ -227,7 +238,7 @@ def push(ctx, do_deploy, no_build, template_file, platform):
227
238
  ctx.invoke(deploy)
228
239
 
229
240
 
230
- main.add_command(push)
241
+ main.add_command_with_deprecation(push, deprecated=True)
231
242
 
232
243
 
233
244
  @solution.command(context_settings=CONTEXT_SETTINGS, help="Deploy solution to IoT Edge device")
@@ -245,7 +256,7 @@ def deploy(manifest_file):
245
256
  edge.deploy(manifest_file)
246
257
 
247
258
 
248
- main.add_command(deploy)
259
+ main.add_command_with_deprecation(deploy, deprecated=True)
249
260
 
250
261
 
251
262
  @iothub.command(
@@ -340,7 +351,7 @@ def genconfig(template_file, platform, fail_on_validation_error):
340
351
  mod.build_push(template_file, platform, no_build=True, no_push=True, fail_on_validation_error=fail_on_validation_error)
341
352
 
342
353
 
343
- main.add_command(genconfig)
354
+ main.add_command_with_deprecation(genconfig, deprecated=True)
344
355
 
345
356
 
346
357
  @simulator.command(context_settings=CONTEXT_SETTINGS,
@@ -363,7 +374,7 @@ def setup_simulator(gateway_host, iothub_connection_string):
363
374
  sim.setup(gateway_host, iothub_connection_string)
364
375
 
365
376
 
366
- main.add_command(setup_simulator)
377
+ main.add_command_with_deprecation(setup_simulator, deprecated=True)
367
378
 
368
379
 
369
380
  @simulator.command(context_settings=CONTEXT_SETTINGS,
@@ -438,7 +449,7 @@ def start_simulator(setup, solution, build, manifest_file, platform, verbose, in
438
449
  sim.start_single(inputs, port)
439
450
 
440
451
 
441
- main.add_command(start_simulator)
452
+ main.add_command_with_deprecation(start_simulator, deprecated=True)
442
453
 
443
454
 
444
455
  @simulator.command(context_settings=CONTEXT_SETTINGS,
@@ -450,7 +461,7 @@ def stop_simulator():
450
461
  sim.stop()
451
462
 
452
463
 
453
- main.add_command(stop_simulator)
464
+ main.add_command_with_deprecation(stop_simulator, deprecated=True)
454
465
 
455
466
 
456
467
  @simulator.command(context_settings=CONTEXT_SETTINGS,
@@ -490,7 +501,7 @@ def monitor(timeout):
490
501
  ih.monitor_events(timeout)
491
502
 
492
503
 
493
- main.add_command(monitor)
504
+ main.add_command_with_deprecation(monitor, deprecated=True)
494
505
 
495
506
 
496
507
  def ensure_azure_cli_iot_ext():
@@ -824,7 +835,7 @@ def log(show, save):
824
835
  dock.handle_logs_cmd(show, save)
825
836
 
826
837
 
827
- main.add_command(log)
838
+ main.add_command_with_deprecation(log, deprecated=True)
828
839
 
829
840
  if __name__ == "__main__":
830
841
  main()
@@ -2,8 +2,8 @@ from .utility import Utility
2
2
 
3
3
 
4
4
  class ConnectionString:
5
- def __init__(self, value):
6
- self.connection_string = value
5
+ def __init__(self, connection_string: str):
6
+ self.connection_string = connection_string
7
7
  self.data = dict()
8
8
 
9
9
  if self.connection_string:
@@ -22,25 +22,27 @@ class ConnectionString:
22
22
  else:
23
23
  # unexpected input of connection. Set to None and throw error
24
24
  self.connection_string = None
25
-
25
+
26
26
  def __getitem__(self, key):
27
27
  return self.data[key]
28
28
 
29
29
 
30
30
  class IoTHubConnectionString(ConnectionString):
31
- def __init__(self, value):
32
- ConnectionString.__init__(self, value)
31
+ def __init__(self, connection_string: str):
32
+ super().__init__(connection_string)
33
33
 
34
34
  if self.connection_string:
35
35
  self.shared_access_key_name = self["sharedaccesskeyname"]
36
36
 
37
37
 
38
38
  class DeviceConnectionString(ConnectionString):
39
- def __init__(self, value):
40
- ConnectionString.__init__(self, value)
39
+ def __init__(self, connection_string: str):
40
+ super().__init__(connection_string)
41
41
 
42
- if self.connection_string:
42
+ if("deviceid" in self.data):
43
43
  self.device_id = self["deviceid"]
44
+ else:
45
+ self.device_id = None
44
46
 
45
47
 
46
48
  class IoTHubHost:
@@ -14,7 +14,7 @@ class Edge:
14
14
  self.output.header("DEPLOYING CONFIGURATION")
15
15
 
16
16
  self.envvars.verify_envvar_has_val("IOTHUB_CONNECTION_STRING", self.envvars.IOTHUB_CONNECTION_INFO)
17
- self.envvars.verify_envvar_has_val("DEVICE_CONNECTION_STRING", self.envvars.DEVICE_CONNECTION_INFO)
17
+ self.envvars.verify_envvar_has_val("EDGE_DEVICE_ID", self.envvars.DEVICE_CONNECTION_INFO.device_id)
18
18
  self.envvars.verify_envvar_has_val("DEPLOYMENT_CONFIG_FILE", self.envvars.DEPLOYMENT_CONFIG_FILE)
19
19
 
20
20
  if self.azure_cli.set_modules(config=manifest_file,
@@ -15,7 +15,7 @@ fi
15
15
 
16
16
  # read IoTEdgeDev version from python __init__ file
17
17
 
18
- export VERSION=$(cat ../../iotedgedev/__init__.py | grep '__version__' | grep -oP "'\K[^']+")
18
+ export VERSION=$(cat ../../iotedgedev/__init__.py | grep '__version__' | awk '{print $3}' | sed "s;';;g")
19
19
 
20
20
  IMAGE_NAME="$1"
21
21
  PLATFORM="$2"
@@ -27,7 +27,7 @@ if [ "$IMAGE_NAME" = "--help" ]; then
27
27
  fi
28
28
 
29
29
  PYTHON2="2.7.14" #TODO READ FROM deps.txt
30
- PYTHON3="3.6.6"
30
+ PYTHON3="3.9.12"
31
31
 
32
32
  build_linux=1
33
33
  build_windows=1
@@ -165,4 +165,4 @@ fi
165
165
 
166
166
  if [ in_docker_folder = 0 ]; then
167
167
  cd original_folder
168
- fi
168
+ fi
s/docker/tool/deps.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  PYTHON2_VERSION=2.7.14
2
- PYTHON3_VERSION=3.6.5
2
+ PYTHON3_VERSION=3.9.12
3
3
  NODEJS_VERSION=8.11.1
4
4
  DOTNETCORESDK_VERSION=2.1.4
5
5
  DOCKER_VERSION=17.09.0
@@ -1,4 +1,4 @@
1
- FROM ubuntu:18.04
1
+ FROM mcr.microsoft.com/mirror/docker/library/ubuntu:20.04
2
2
  ENV DEBIAN_FRONTEND noninteractive
3
3
  ENV DOTNETCORESDK_VERSION 2.1
4
4
  ENV DOCKER_COMPOSE_VERSION 1.22.0
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y apt-transport-https ca-certificates cur
9
9
  apt-get update && \
10
10
  apt-get install -y docker-ce
11
11
  RUN apt-get install git gnupg gnupg2 gnupg1 -y && \
12
- apt-get install -y --no-install-recommends dialog apt-utils curl apt-transport-https python-pip python3-pip libltdl-dev && \
12
+ apt-get install -y --no-install-recommends dialog apt-utils curl apt-transport-https python3-pip libltdl-dev && \
13
13
  curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
14
14
  apt-get install -y nodejs
15
15
  RUN apt-get install -y wget && \
@@ -27,7 +27,10 @@ RUN apt-get update && \
27
27
  npm i npm@latest -g && \
28
28
  npm i -g azure-iothub yo generator-azure-iot-edge-module && \
29
29
  apt-get install -y --no-install-recommends python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev sudo
30
- RUN python3 -m pip install --upgrade pip && \
30
+ RUN apt install python3.9 -y && \
31
+ rm /usr/bin/python3 && \
32
+ ln -s /usr/bin/python3.9 /usr/bin/python3 && \
33
+ python3 -m pip install --upgrade pip && \
31
34
  pip3 install setuptools && \
32
35
  pip3 install cookiecutter
33
36
  RUN apt-get -y install openjdk-8-jdk
@@ -58,4 +61,4 @@ USER iotedgedev
58
61
  RUN az extension add --name azure-iot && \
59
62
  echo 'alias python=python3' >> ~/.bashrc && \
60
63
  echo 'alias pip=pip3' >> ~/.bashrc
61
- ENV DEBIAN_FRONTEND teletype
64
+ ENV DEBIAN_FRONTEND teletype
@@ -1,4 +1,4 @@
1
- FROM microsoft/windowsservercore:1709 AS base
1
+ FROM mcr.microsoft.com/windows/servercore:1709 AS base
2
2
  SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
3
3
  ARG PYTHON2_VERSION
4
4
  ARG PYTHON3_VERSION
s/docs/_Sidebar.md CHANGED
@@ -1,13 +1,14 @@
1
1
  * [Home](home)
2
2
  * Dev Machine Setup
3
- * [Quickstart with IoT Edge Dev Container](quickstart-with-iot-edge-dev-container)
4
- * [Manual Setup](manual-dev-machine-setup)
3
+ * [Quickstart](quickstart)
4
+ * [Manual Setup](environment-setup/manual-dev-machine-setup)
5
5
  * [Azure Setup](azure-setup)
6
6
  * [Edge Device Setup](edge-device-setup)
7
7
  * [Command List](command-list)
8
- * [Python Virtual Environment Setup](python-virtual-environment-setup)
8
+ * [Command Tips](command-tips)
9
+ * [Python Virtual Environment Setup](environment-setup/python-virtual-environment-setup)
9
10
  * [Test Coverage](test-coverage)
10
11
  * [Troubleshooting](troubleshooting)
11
12
  * [Contributing](https://github.com/Azure/iotedgedev/blob/main/CONTRIBUTING.md)
12
13
  * Misc
13
- * [Migration Guides for Public Preview Users](migration-guides)
14
+ * [Migration Guides for Public Preview Users](migration-guides)
@@ -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
+ ```
@@ -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) 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.