Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker files and module.json file are missing for v7.0.0 #97

Open
AlexandrStarov opened this issue Dec 11, 2023 · 11 comments
Open

Docker files and module.json file are missing for v7.0.0 #97

AlexandrStarov opened this issue Dec 11, 2023 · 11 comments

Comments

@AlexandrStarov
Copy link

Some files are missing for a new solution. Can't follow this instruction https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4&tabs=csharp&pivots=iotedge-dev-ext.

image
@rido-min
Copy link
Member

thanks @AlexandrStarov for your feedback.

With .NET 7, we'd like to use the latest container builds that will simplify the process by do not requiring Dockerfiles, as described in https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container?pivots=dotnet-7-0

You are right, we need to update the docs accordingly, I'll keep this issue open until the docs reflect the current change.

We have removed the PrjectCapability to reflect that the VS support for IoTEdge modules is in maintenance mode microsoft/vs-azure-iot-edge-docs#42

@AlexandrStarov
Copy link
Author

In addition to the new documentation, it would be nice to have a working example of a project on GitHub, since today it is impossible to create a new project as described in the documentation. I will be very grateful if you can share it.

I also encountered the impossibility of creating a module and connecting a common project to it. This issue is described in this item Azure/iotedge#6606

@rido-min
Copy link
Member

good suggestion, we'll provide that sample to show the e2e flow to create and deploy IoTEdge modules based on the latest template.

I believe that by adopting the new "publish container" tooling it will fix the 6606 issue.

@Ilheu
Copy link

Ilheu commented Dec 13, 2023

I just realized this too. I'm used to module.json and dockerfiles way to work, what can I do now to build and push my module? Is there any tutorial? The Readme file is not helping me enough.

@rido-min
Copy link
Member

We will provide a sample with the complete flow, including how to debug from VS, or VSCode.

For now, you can create the docker image with

dotnet publish --os linux --arch x64 -c Release /t:PublishContainer

Here are the docs to use this new method https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container?pivots=dotnet-7-0

if you need further customization on the base image, you can create your own base image, and then use containerbaseimage

what is missing, is the use of module.json to produce the deploymentManifest, so for now you can use the portal to deploy.

@AlexandrStarov
Copy link
Author

@rido-min When can I expect new documentation?

@ridomin
Copy link
Contributor

ridomin commented Dec 28, 2023

Hi @AlexandrStarov

Checkout this article https://dev.to/ridomin/developing-iotedge-modules-32ag and let me know if you are missing anything.

@AlexandrStarov
Copy link
Author

AlexandrStarov commented Dec 28, 2023

Hi @ridomin

First of all, thanks for the article, it has become a little more transparent how to work with IoT edge.

Now I have several questions about this article:

  1. Unfortunately, there are no tips on how to transfer an existing solution to a new version. It would seem that these are big changes in the approach to how we need to work, but not a word about it. It's a pity. Is there a plan to add such an article to the site "https://learn.microsoft.com/en-us/azure/iot-edge/?view=iotedge-1.4"?
  2. In the article you suggest using aziotedge-modinit, which is not official from Microsoft. This means that there may be no more fixes and updates. It looks like there is currently no official solution that should replace outdated plugins for the Visual studio 2022 and Visual Code. Perhaps there will be some other improvements in the near future? Since now it does not seem rational to start a new commercial project with .Net 7.
  3. Is it now possible to run 2 virtual IoT edge devices locally on a work computer?
  4. Do I understand correctly that this is now a temporary version of the article, which will later be added to the site "https://learn.microsoft.com/en-us/azure/iot-edge/?view=iotedge-1.4"?

@ridomin
Copy link
Contributor

ridomin commented Dec 28, 2023

@AlexandrStarov I see your points, however the article is not a replacement of the current tooling, instead it shows how to develop (and debug) modules without any special tool. With this in mind:

  1. The tools are in maintenance mode, what means no further updates, including the docs.
  2. aziotedge-modinit is just a workaround to initialize $edgeHub. It's a simple app (just 2 HTTP calls), and I do not think it will require any update, and if it does, it's open source !!. Do not expect any updates in VS/Code plugins. The module template will be updated to target .NET8 shortly.
  3. Not sure I understand this question. there is no such thing as virtual IoT edge device. If you mean two instances of $edgeHub, I dont think so since the ports are hardcoded.
  4. I dont think so since the docs cover multiple languages, but this is only for dotnet.

If you are happy with the current tools in VS, Code or CLI, you can continue using those, and replace the dotnet projects with the updated version.

Also, keep in mind this repo only covers the dotnet template to scaffold a project to implement a module, and does not include any feature to deploy, since it should cover multiple modules and global configuration. What I usually do, is to configure the initial deployment from the portal to produce the deploymentManifest.json, so I can deploy from the CLI.

I believe the dockerfiles included in the previous version, are no longer required, since dotnet already has better docker integration story.

@AlexandrStarov
Copy link
Author

@ridomin Regarding point 3 in my previous comment. You are right, I meant to launch 2 $edgeHubs instances, which will be for two different devices.

I tried updating the projects for my current solution and updated the .Net version to 7. Fortunately, after the changes I can successfully launch using the tools in VS Code.

Unfortunately, I was unable to successfully apply your solution with "aziotedge-modinit" on my project. I understand the value of your example. But your example does not fully reflect step by step how to write such projects yourself.

Is there a publicly available roadmap for IoT products? What languages are preferable to use for writing modules? Because now it looks as if this direction is no longer planned to be developed.

@ridomin
Copy link
Contributor

ridomin commented Dec 29, 2023

I dont think you can run two instances of $edgeHub, since each one requires exclusive access to the same ports, and AFAIK those are not configurable.

aziotedge-modinit is only required to initialize the $edgeHub module in IoTHub to have a connection string, if you already have an IoTEdge device identity initialized you can omit this step. And if you have any issues with the tool, you can report it to https://github.com/ridomin/aziotedge-modinit

I'm guessing the step by step instructions you miss are for deployment rather than develop/debug.
Once you have the container image pushed to a container registry, you can follow this doc https://learn.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-portal?view=iotedge-1.4

I'm not aware of any roadmap at this point, but I've been told IoTEdge is feature complete, and we should not expect any new features, just security and bug fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants