Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(containers): deployment state machine #818

Draft
wants to merge 3 commits into
base: feature/application-management
Choose a base branch
from

Conversation

lusergit
Copy link
Collaborator

@lusergit lusergit commented Feb 14, 2025

Based on #817

Currently deployments are updated when edgehog recives a trigger from astarte, while the caching resources are generated when deploying the release. This PR moves the deployment logic to a deployer state machine (an elixir GenStateMachine) which also reacts to messages on the pubsub which have as topic one of the releveant resources.

- Decouples the deployment state (created, sent, stopped, stopping, ...)
  and the underlying resources states (created images, created networks,
  ...) from each other.
- The deployment state gets updated when the device publishes on the
  appropriate interfaces. Its state is cached and persisted in the DB so
  we dont have to query the device every time we want to update the
  deployment resources state.

Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
Adds the necessary triggers for `AvailableImages`, `AvailableVolumes`,
`AvailableContainers` and `AvailableNetworks`

Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
@lusergit lusergit force-pushed the chore/deployment-state-machine branch 2 times, most recently from ffaeb7f to 46cd910 Compare February 17, 2025 15:30
The deployment of a release on a device is handled trough a state
machine, responsible for creating the cache resources and running the
ready actions once all the nested resources are available

Moving the delpoyment loginc into a `GenStateMachine`.
- States for deploying the resources named as `:deploy_{resource}`
- Uses pubsub to update the deployment status when a message with a
  relevant resource as topic is published.

Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
@lusergit lusergit force-pushed the chore/deployment-state-machine branch from 46cd910 to d0dbd1b Compare February 18, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant