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

Add support for io.balena.update.requires-reboot label #2381

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

pipex
Copy link
Contributor

@pipex pipex commented Oct 24, 2024

This label can be used by user services to indicate that a reboot is required after the install of a service in order to fully apply an update. In particular, this will be used by hostOS updates when we add this feature on the supervisor.

Change-type: minor
Depends-on: #2389

Release notes

This release adds support for a new docker-compose label: io.balena.update.requires-reboot. When the label is present on a service, it tells the supervisor that a system reboot should be performed before starting the service for the first time.

When a target release is received that contains services with this label, the supervisor will

  • pull all target images
  • create and start containers for services without the label (in dependency order).
  • create containers for services with the label, but skip start
  • wait until locks are released to perform a system reboot

Note that the supervisor cannot distinguish between a first time install of the service or the container being re-created. This means that actions that re-create services will also require a reboot. Ex: restart service, purge data, disable local-mode will all re-create containers and hence require a reboot.

@pipex pipex marked this pull request as draft October 24, 2024 19:44
@pipex pipex force-pushed the reboot-required branch 2 times, most recently from 53d0fd3 to ad128fc Compare October 25, 2024 18:51
@pipex pipex force-pushed the reboot-required branch 3 times, most recently from 60e4011 to 1506adc Compare December 2, 2024 21:11
Copy link
Contributor

@cywang117 cywang117 left a comment

Choose a reason for hiding this comment

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

Looking good on initial pass. Will do another pass on Mon

src/device-state/index.ts Outdated Show resolved Hide resolved
src/compose/app.ts Outdated Show resolved Hide resolved
src/device-api/actions.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@cywang117 cywang117 left a comment

Choose a reason for hiding this comment

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

Did another pass -- the changes make sense. Great work 👍🏼

pipex added 2 commits January 9, 2025 14:31
Move the device-config module to the device-state folder and export only
those functions that are needed elsewhere in the codebase

This moves us closer to making the device-state module the only way to
modify application and configuration.

Change-type: patch
This was on device-config before, but we'll need to set the reboot
breadcrumb from the application-manager as well when we introduce
`requires-reboot` as a label.

Change-type: patch
@pipex pipex force-pushed the reboot-required branch 3 times, most recently from 6e1ce06 to e8ce10d Compare January 13, 2025 22:25
@pipex pipex changed the title Add support for io.balena.update.reboot-required label Add support for io.balena.update.requires-reboot label Jan 14, 2025
This label can be used by user services to indicate that a reboot is
required after the install of a service in order to fully apply an update.

Change-type: minor
@pipex pipex marked this pull request as ready for review January 14, 2025 14:21
@pipex pipex requested a review from cywang117 January 14, 2025 14:21
@flowzone-app flowzone-app bot enabled auto-merge January 14, 2025 15:08
Copy link
Contributor

@cywang117 cywang117 left a comment

Choose a reason for hiding this comment

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

Great work!

@flowzone-app flowzone-app bot merged commit bc306c1 into master Jan 14, 2025
59 checks passed
@flowzone-app flowzone-app bot deleted the reboot-required branch January 14, 2025 18:15
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