feat: add support for singleton brick services#321
Conversation
a998121 to
31fb406
Compare
b5adca4 to
c476e10
Compare
…ain the service compose
If a brick requires a service when starting an app and the service is not in the index (i.e., the services folder does not exist), log the error.
lucarin91
left a comment
There was a problem hiding this comment.
LGTM, just some small issues
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
dido18
left a comment
There was a problem hiding this comment.
We need to get the service even in the logs endpoint to retrieve the compose services' logs.
Could you double-check it?
yeah we probably need to update the logs, but I would do it in a separate issue. I think we should get the services list from docker-compose instead of parsing the compose files of each brick. |
|
We should probably also load the brick services filtering them using the |
I am fine to address this in another PR. |
Motivation
A brick service is a singleton service that the
arduino-app-climust instantiate only once and shared among different bricks. A brick that needs a service, can define it in thebrick_config.yamlthis way:During the provisioning process of an app, the
arduino-app-clishould collect all the shared services needed to run the bricks and instantiate them all once.Change description
This PR introduces two main changes:
servicesIndexis created following the same principles of thebricksIndexandmodelsIndexAdditional Notes
Reviewer checklist
main.