Skip to content

feat: add support for singleton brick services#321

Merged
MatteoPologruto merged 18 commits intomainfrom
support-services
Apr 9, 2026
Merged

feat: add support for singleton brick services#321
MatteoPologruto merged 18 commits intomainfrom
support-services

Conversation

@MatteoPologruto
Copy link
Copy Markdown
Contributor

@MatteoPologruto MatteoPologruto commented Mar 30, 2026

Motivation

A brick service is a singleton service that the arduino-app-cli must instantiate only once and shared among different bricks. A brick that needs a service, can define it in the brick_config.yaml this way:

requires_services: ["arduino:genie"]

During the provisioning process of an app, the arduino-app-cli should collect all the shared services needed to run the bricks and instantiate them all once.

Change description

This PR introduces two main changes:

  • a servicesIndex is created following the same principles of the bricksIndex and modelsIndex
  • the services are collected and instantiated during the provisioning of the app

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@MatteoPologruto MatteoPologruto self-assigned this Mar 30, 2026
@MatteoPologruto MatteoPologruto added the enhancement New feature or request label Mar 30, 2026
@MatteoPologruto MatteoPologruto force-pushed the support-services branch 2 times, most recently from a998121 to 31fb406 Compare March 30, 2026 15:20
@MatteoPologruto MatteoPologruto marked this pull request as ready for review April 8, 2026 07:00
@MatteoPologruto MatteoPologruto requested a review from a team April 8, 2026 07:01
Copy link
Copy Markdown
Contributor

@lucarin91 lucarin91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some small issues

MatteoPologruto and others added 7 commits April 9, 2026 10:49
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>
Copy link
Copy Markdown
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to get the service even in the logs endpoint to retrieve the compose services' logs.

Could you double-check it?

@lucarin91
Copy link
Copy Markdown
Contributor

lucarin91 commented Apr 9, 2026

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.

@MatteoPologruto
Copy link
Copy Markdown
Contributor Author

MatteoPologruto commented Apr 9, 2026

We should probably also load the brick services filtering them using the supported_boards field like we are doing in #343. Should I apply this change here or should we merge and apply the change in the other PR? @lucarin91 @dido18

@dido18
Copy link
Copy Markdown
Contributor

dido18 commented Apr 9, 2026

We should probably also load the brick services filtering them using the supported_boards field like we are doing in #343. Should I apply this change here or should we merge and apply the change in the other PR? @lucarin91 @dido18

I am fine to address this in another PR.

Copy link
Copy Markdown
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to open a PR to check other usage of docker-compose services

@MatteoPologruto MatteoPologruto merged commit 7f78bdb into main Apr 9, 2026
12 checks passed
@MatteoPologruto MatteoPologruto deleted the support-services branch April 9, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants