Add os hook for interrupt signal while waiting for service to converge. #333
No reviewers
Labels
No Label
bug
build
ci/cd
contributing
design
documentation
duplicate
enhancement
help wanted
invalid
meta
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#333
Loading…
Reference in New Issue
No description provided.
Delete Branch "rix/abra:add-waiting-interrupt-handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
My attempt at fixing coop-cloud/organising#413 where Ctrl-C while waiting to converge would cause a success message to be printed. Now it prints a message similar to the timeout one where it just points out it was interrupted. I've also correctly a small grammar problem in the timeout message.
Amazing @rix, tysm! This is looking good. I won't be able to test rn but if you are feeling good about it, please merge away? One doubt is that ctrl-c means "i really want to cancel now" vs. "timed out but i still care" and perhaps the error message could also just be "bailing out, cancelled by user". No strong feelings on this tho.
Hi @decentral1se ,
I'm fine to change the message and correct me if I'm wrong but I don't think whether or not the app gets deployed depends on when the interrupt occurs.
So for a test I did the following:
run abra a deploy traefik.default
pause for a second until it's 'waiting to converge'
press ctrl+ c
run abra app ps traefik.default and get back output
run abra app undeploy traefik.default and successfully remove the app
run abra app ps traefik.default and be told the app is no longer installed
Full trace of that is below but basically it installed the app because it was already in progress in another thread and the only thing I interrupted was CLI process. If you want to make it so it actually stops/undeploys the app then that will require a bit more work to get doing. Let me know what you think.
@rix
Righhhhhht, true! Yes, so we maybe need to do some UI/UX experimenting here. It is indeed the case that a ctrl-c only stops the polling / checking logic not the actual deployment... and I was just talking to @knoflook how the whole text output of this post-deploy thing is a bit weird 😆
Like what the heck does "services converged" even mean? We take some effort to gloss over Docker terminology in places, so I don't know why we suddenly expose it here on a thing that you have to read loads of times a day 🙃
Anyway, take or leave as much of this as you like but I think maybe we could:
Add a "starting to poll deployment status" message before any of the output to make it clear what is exactly happening...
abra
is just a "front-end" to the docker daemon reports in this moment, so we're not controlling if the stack succeeeds or not directlyChange "services converged" to "successfully deploy x $domain" or something clear / simple
When ctrl-c'ing output something like "cancelling polling, deployment continues..." (potentially with a "maybe you want app undeploy if you wanna take it down?")
Up to you!
Ok that sounds good, it might be a day or two until I have enough time to make those mods but happy to do that as too literally have no idea what "services converging" means : )
1208438cba
to65fdaf43cc
Ok I've finally managed to get my deployments again and made those changes, here are the outputs now:
abra a deploy traefik.default
INFO[0002] Creating config traefik_default_entrypoint_v2
INFO[0002] Creating config traefik_default_traefik_yml_v17
INFO[0002] Creating config traefik_default_file_provider_yml_v8
INFO[0002] Creating service traefik_default_app
INFO[0003] Starting to poll for deployment status for: traefik.default
INFO[0041] Successfully deployed traefik.default
abra a deploy traefik.default (with interrupt)
INFO[0001] Creating config traefik_default_traefik_yml_v17
INFO[0001] Creating config traefik_default_file_provider_yml_v8
INFO[0001] Creating config traefik_default_entrypoint_v2
INFO[0002] Creating service traefik_default_app
INFO[0003] Starting to poll for deployment status for: traefik.default
^CFATA[0005]
Cancelling polling for traefik.default, deployment is still continuing.
If you want to stop the deployment try:
abra app undeploy traefik.default
I think that's it from my side but if you want me to make further changes then let me know and I should be able to get around to it this weekend : )
WIP: Add os hook for interrupt signal while waiting for service to converge.to Add os hook for interrupt signal while waiting for service to converge.And indeed the deployment continued!
The owncast instance seems exploded, but thinking / hoping that's unrelated 😬