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?

asked 2 years ago301 views
2 Answers
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
EXPERT
Jan_B
answered 2 years ago
  • 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?

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions