Using Pycharm with Greengrass Components

0

Starting to develop applications to be deployed via Greengrass V2, and I'm rapidly finding the dev / test workflow to be somewhat problematic - I've either been deploying to a dev device and running a script to use the greengrass-cli to re-import it as a component, or a similar script to shoot it onto our AWS dev environment with a new version number each time.

Is there a way to get access to the Greengrass provided IPC pathways in my local dev environment, so I can debug apps in Intelij or PyCharm as I normally would?

已提問 2 年前檢視次數 309 次
2 個答案
1

Let me first address the first part of your question around the development workflow. The Greengrass Development SDK GDK addresses most of the problems you mention:

  • The GDK automates the packaging, S3 upload and component registration in AWS IoT, and can also automatically increment the component version if you want by setting the version value to NEXT_PATCH GDK CLI configuration file
  • It supports also local deployments, the GDK packages the component into the local project folder greengrass-build before upload. When you create the local deployment with the Greengrass CLI, specify greengrass-build/recipes as the recipes folder and greengrass-build/artifacts as the artifacts folder. If you want to use local deployments, don't set the component version to NEXT_PATCH but use a semantic version number.

For the second part of your questions, I'm not aware of any IDE integration to streamline the Greengrass development. Greengrass expose a local component and management API over IPC. So technically it is feasible to create such an IDE plugin.

To debug your component code just follow the instructions of your preferred IDE to attach the debugger to a running process. In Visual Code for example, you just modify the Component recipe and launch your python script like this:

python3 -m debugpy --listen 5678 --wait-for-client -u {artifacts:decompressedPath}/HelloWorld/main.py

This will launch your component script in debug mode using debugpy , and you can now attach the VC IDE debugger to your component process on port 5678.

profile pictureAWS
專家
Jan_B
已回答 2 年前
  • This is really helpful. Is there an example on how to pull existing components and start publishing them from the CLI? Do you need to make the dev PC an edge device as well with GG installed?

0

This is really helpful. Is there an example on how to pull existing components and start publishing them from the CLI? Do you need to make the dev PC an edge device as well with GG installed?

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南