Add os hook for interrupt signal while waiting for service to converge. #333
Merged
3wordchant
merged 7 commits from 2023-08-04 19:22:51 +00:00
rix/abra:add-waiting-interrupt-handling into main
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#333
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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...
abrais 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 : )
1208438cbato65fdaf43ccOk 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 : )
And indeed the deployment continued!
The owncast instance seems exploded, but thinking / hoping that's unrelated 😬