-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for hand-over update strategy #8836
Conversation
An error occurred whilst building your landr site preview:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool @ramirogm !
Would you be able to extract some of this logic out to a separate file?
I think this might be a nice utility to make available via npm i the future, for when we start deploying more of our services to balenaCloud+AWS
@LucianBuzzo I've refactored the logic into a |
9c79ccf
to
6285ecc
Compare
There's a test repo for the library on https://github.com/ramirogm/handover-lib-test I haven't extracted it to its own repo yet - for now, is a copy-paste to test it while developing |
Interesting stuff. Just wanted to point out that this seems to assume a single instance and if we ever need to scale horizontally the handover algorithm will need to be revised. |
Hi @dfunckt thanks for your comment. Can you explain a bit what issues you
see? By "scale horizontally" you mean a fleet with several instances or
increasing the size of the fleet?
I now realize that I didn't test a fleet with more than one instance - I'll
test that next week when I'm back from vacation.
Ramiro
|
As it is, the handover algorithm can only handle one instance succeeding another because it's based on instance startup time which is impossible to control precisely. When you consider multiple instances, you quickly see that during deployment the system will never reach a steady state, because every instance will have slightly different startup time, and even if it did, it would re-enter that unstable state as soon as an instance crashed and restarted. |
How would this work around starting up multiple |
Hi @dfunckt I'd like to try this to understand the issue better. Initially, I thought we were talking of instances as multiple devices inside a fleet, but now I think you mean multiple instances of the same app in a docker-compose file? Using different service names on the docker-compose file ( like api1, api2 )? Or something else? |
Hi @ab77
I'm currently testing a reduced version of the JF setup: In this setup the supervisor replaces the
I'm pinging from another host, similar to what |
re-Correction. Found out there's a conflict between our goals of zero-downtime and orderly shutdown. |
f84b5e0
to
e218f53
Compare
This is now working with a library that implements the handover logic; See https://github.com/balena-io-playground/handover-lib |
I've done some testing on a test fleet with two devices: https://dashboard.balena-cloud.com/fleets/1949587 Some notes:
|
e218f53
to
6d05da8
Compare
6d05da8
to
62f76d6
Compare
@ramirogm Thanks for the fixes, LGTM |
0997c1f
to
bc135c2
Compare
Change-type: minor Signed-off-by: Ramiro Gonzalez <[email protected]>
bc135c2
to
8764f06
Compare
@balena-ci I self-certify! |
Change-type: patch
Signed-off-by: Ramiro Gonzalez [email protected]
Please remember to write tests for your changes. We aim to automatically
deploy
master
to production, and we can't safely do this without a solidtest suite!