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?

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠