-
Notifications
You must be signed in to change notification settings - Fork 63
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
/v2/applications/:appId/restart-service recreates the service #1116
Comments
[pdcastro] This issue has attached support thread https://jel.ly.fish/ca7430c4-a2cd-44e1-a234-7bd64d643231 |
For what it is worth (maybe not much), based on my playing with the web dashboard and ssh to a NUC device and tests on my laptop (but not having looked at supervisor source code), I gather that:
|
I am not sure about the design rationale behind removing + recreating containers on restart, but the docker restart command does not do this, so it would be better if we emulated this. The change would theoretically just be to add a
|
Closes: #1116 Change-type: patch Signed-off-by: Christina Wang <[email protected]>
EDIT: Not removing the above so that there's context, but my earlier statement is wrong. Currently, all restart routes recreate the service, and this is intended. Supervisor's default behavior when killing a container with the service-manager is to remove the container. Apologies for any misconceptions my earlier statement may have perpetuated. See the internal call documentation here for further clarification. |
Been a while since I raised this, but I'm also considering using balena for a project, and I'd like to know the rationale behind recreating the containers. Certainly when @CameronDiver and I originally discussed this, we agreed this was not ideal and was probably originally in error, because:
Thanks! |
Hi @hedss, thanks for bringing this point up. I realize that in my previous comment from May 5, I wasn't very clear about balena's rationale behind implementing restart as a recreate action. Let me try to explain, as I realize that the internal call documentation I linked may not be accessible to everyone: You mentioned that service recreation on restart may have originally been implemented in error. I don't believe any of the current Supervisor maintainers were there to see this implementation get merged, so I can't comment on that. However, in our previous internal call over this, we decided to stick with this implementation of the restart action recreating the containers, even if it's divergent from Docker's behavior. We discussed some points:
@dfunckt with an important reason:
@pdcastro weighed in with another important reason:
Note that users may temporarily stop a container without removing it by using the Supervisor API's /v2/applications/:appId/stop-service and /v2/applications/:appId/start-service endpoints (see here), or click the "stop" and "start" icons in the service table on the dashboard's device summary page. The Supervisor doesn't trigger these actions unless the user hits these API endpoints (via dashboard or Supervisor API), so this offers users a way of stopping without removing, if this suits a particular development workflow. Let us know if this works for you! |
Thanks for the followup @cywang117! I can completely understand the comments (and hello also to Akis and Paulo if you're reading, hope all is well!), especially the expectation from users in consistent behaviour. Whilst containers are meant to be ephemeral, Docker compose deals with large orchestrations (as does balena multicontainer projects) and part of the reason I originally raised this was that should I need to carry out development and debug of an entire system (eg. BoB, though I have no idea if you're still using that in your internal development workflow), I don't always want to 'start from scratch'. In Docker, I can simply In balena, that's not possible, the system as a whole is recreated and I have to start from scratch as the FS overlays have been wiped. This is particularly frustrating in stateful systems where I then need to go through all the steps to get to a particular state again to ensure I've fixed the problem with an individual service. And for clarity, I'm more interested in development (such as local) rather than production and uploading to the balena builder/registry. The workaround is to use Anyway, thanks for the update. I'd suggest closing this issue now if this is a 'No Fix'. Thanks! |
Thanks for the context @hedss. I can understand the frustration that comes with all your work being erased on restart in this scenario. Since you're more interested in local mode/livepush functionality that's currently lacking, would something like |
Hi @cywang117 ! Yep, that'd do it. Thanks! |
Whilst the
start
endpoint starts a service without recreating it, therestart
endpoint actually recreates the container. This isn't consistent, and potentially constitutes a problem.The text was updated successfully, but these errors were encountered: