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

feat(containers): deployment upgrade graphql api #728

Conversation

noaccOS
Copy link
Collaborator

@noaccOS noaccOS commented Nov 19, 2024

Previously #726
After irl discussion, will be changed to an update which will accept the existing deployment and the new release, and then both deploy and upgrade the release.

Will need to figure out how to handle both deployments existing on the device, probably our best option would be to send a delete after the new version has been started.

Implemented using a custom resource, DeploymentReadyAction, which must be called when the deployment status is updated to ready.
This must be done once #724 is merged

used to declare actions to run once the deployment hits `ready` state

mix ash.gen.resource Edgehog.Containers.DeploymentReadyAction.Upgrade \
    --default-actions read,destroy \
    --uuid-primary-key id \
    --relationship belongs_to:upgrade_target:Edgehog.Containers.Deployment:required \
    --domain Edgehog.Containers

mix ash.gen.resource Edgehog.Containers.DeploymentReadyAction \
    --uuid-primary-key id \
    --default-actions read,destroy \
    --relationship belongs_to:deployment:Edgehog.Containers.Deployment:required \
    --relationship belongs_to:upgrade_deployment:Edgehog.Containers.DeploymentReadyAction.Upgrade \
    --attribute action_type:atom:required

Signed-off-by: Francesco Noacco <[email protected]>
@noaccOS noaccOS force-pushed the feat/deployment_upgrade branch from 2494df5 to 9ccebf5 Compare November 19, 2024 19:09
mix ash_postgres.generate_migrations add_deployment_ready_actions

Signed-off-by: Francesco Noacco <[email protected]>
@noaccOS noaccOS force-pushed the feat/deployment_upgrade branch 2 times, most recently from 013f651 to 5cc2a50 Compare November 19, 2024 19:15
@noaccOS noaccOS marked this pull request as ready for review November 19, 2024 19:17
@noaccOS noaccOS requested a review from lusergit November 19, 2024 19:17
Copy link
Collaborator

@lusergit lusergit left a comment

Choose a reason for hiding this comment

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

Overall LGTM, I think we also want to send the update_application request to the device once the new deployment is created but overall is ok

- change the device action to work with deployments instead of releases
- move validations to the graphql api

Co-authored-by: Luca Zaninotto <[email protected]>
Signed-off-by: Francesco Noacco <[email protected]>
@noaccOS noaccOS force-pushed the feat/deployment_upgrade branch from 5cc2a50 to 1ac2f59 Compare November 20, 2024 11:15
@lusergit lusergit merged commit 10077d7 into edgehog-device-manager:feature/application-management Nov 20, 2024
8 checks passed
@noaccOS noaccOS deleted the feat/deployment_upgrade branch November 26, 2024 16:44
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.

2 participants