0

I have a compiled file of C/C++, and I want to deploy this file to core device in Greengrass V2. If I use GUI, what do I need to change in recipe.YAML file to deploy successfully?

For Example: After compiled C/C++ file I have helloworld.out file, how can I deploy helloworld.out file and make it run in core device of Greengrass V2. With Python, I just deploy normally but with C/C++ I don't know how to do it?

Sorry for my English.

Linh.Pham
  • 1
  • 2

2 Answers2

0

With Greengrass v2, you need to put in the recipe yaml file the command to execute your C++ application. For python you might have done this:

Lifecycle:
  Run: |
    python3 -u {artifacts:path}/hello_world.py

Well in C++, something like this should work:

Lifecycle:
  Run: |
    ./{artifacts:path}/helloworld.out
brushtakopo
  • 1,238
  • 1
  • 3
  • 16
  • Thank you. But I changed recipe file as your tutorial but the output is always not found. – Linh.Pham Jul 12 '22 at 01:26
  • You can change this: `./{artifacts:path}/helloworld.out` by the absolute path on your drive. – brushtakopo Jul 12 '22 at 08:05
  • Thanks for your help. I solved this problem. But it is not `./{artifacts:path}/helloworld.out`, it must be `/{artifacts:path}/./helloworld.out` and must change Execute from None to All in Permission part. – Linh.Pham Jul 13 '22 at 00:22
0

After read document carefully and have some advice I could solve my problem.

I changed Lifecycle part in recipe file:

Lifecycle:
   Run: | 
      /{artifacts:path}/./helloworld.out

And Don't forget to change Execute Part from None to All(or Owner). If not you will get error about Permission.

Linh.Pham
  • 1
  • 2