Skip to content

Greengrass V2: ComponentDependencies - Soft vs Hard

1

Currently running Greengrass v2 nucleus 2.8.1

In the following setup, I notice that with the following dependency chain Component 3 runs after Component 1 and 2 have been installed, but Component 1 is still in the starting state. C3 needs the service in C1 fully started in order to start itself, which in turn causes component 3 to enter a failed state. Should I make C3 hard depend on C1? What is the right way to set up the dependency chain?

[Component 1] --Hard Depend--> [Component 2] --Soft Depend--> [Component 3]

An incomplete yaml:

---
# Component 3
componentType: "GENERIC"
dependencies:
- "component2:SOFT"
lifecycle:
  Run:
    Script: "service.exe"
---
# Component 2
componentType: "GENERIC"
dependencies:
- "component1:HARD"
lifecycle:
  Startup:
    Script: "something.exe"
---
# Component 1
componentType: "GENERIC"
lifecycle:
  Install:
    Script: "install.exe"
  Startup:
    Script: "something-that-takes-long-to-start.exe"
asked 3 years ago747 views
2 Answers
1
Accepted Answer

SOFT dependencies will be downloaded before their dependent components. If the SOFT dependency dies, then its dependents will keep running. On the other hand, HARD dependencies will be downloaded, installed, and running before its dependent component will be allowed to start. If a HARD dependency dies, then its dependents will be shutdown and restarted once their HARD dependency has started up again.

Hope this clears things up. Cheers,

Michael

AWS
EXPERT
answered 3 years ago
AWS
EXPERT
reviewed 3 years ago
0

Ah, thanks for the clarification. So for startup:

SOFT = download only, no lifecycle steps are needed to proceed to dependents

HARD = component has to enter Startup->running or Run -> running/finished lifecycle to proceed

answered 3 years ago
  • Yes, that's right. For HARD, the component has to be in the RUNNING or FINISHED states.

  • Whoops, meant to reply - thanks for the clarification!

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.