Integration testing #8
Closed
opened 2020-09-10 23:26:31 +00:00 by 3wordchant
·
12 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
No labels
enhancement
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/organising#8
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.
Holy shit, CI testing that sets up a swarm and deploys an app to it
Yeah, this would be quite cool to do. That one looks a bit hard to maintain and consider that we'll have a
.drone.ymlfor each application which will easily balloon and be a headache to take care of. Maybe this is a job for anotherabra-like script. The question is what is appropriate for testing? Spinning things up and checking that the URL comes up and maybe that all containers are definitely deployed? That'd be a good start.Plus your idea from the meeting: Yunohost-style central CI server running swarm, where stacks get torn down after runs.
One hurdle I can think of with this idea is that
docker stack rmsometimes takes a while to take down containers, which meansdocker stack rm demo_service && docker volume rm demo_service_vol ...fails whenever I've tried it.sleep 30could be an adequate workaround. Or maybe we'd be generating a unique stack name for each test run?Good point. I guess I wouldn't be too worried about tearing things down immediately. We can just
stack rmand then leave the hourly cron (or whatever) to rundocker system prune -ato clean up all volumes/networks/images/etc. that are not connected to a running container.I think the only thing stopping this ticket from being a cake-walk is the fact that managing the docker daemon certificates is still a PITA. We'll need to re-generate them all the time and re-load them into Drone so that it can make contact. Need to automate that somehow.
Some progress towards this here: https://drone.autonomic.zone/compose-stacks/wordpress/6/1/2
You need to manually deploy
traefikonswarm-test(or if we configured thetraefikrepo the same way aswordpress).Then, push to the
wordpressrepo, wait a little while, and you can reach the deployed application at https://wordpress.swarm-test.autonomic.zoneNot flipping this "more magic" switch until we have some authentication on the Wordpress instance by default or a method of regularly tearing down apps.
Also still in search of a Drone plugin to run some basic checks using cURL, or checking
docker stack pson the remote hostWe should maybe use this: https://github.com/issuu/sure-deploy for the CI. Comes from some $corp and does a bunch of stuff after deployment to check that things went well. I guess the engineering managers were like "wtf we're not using swarm until there is a --detach=false flag".
Could potentially bake that into stack-ssh-deploy?
Traefik is now also configured to auto-deploy to swarm-test.autonomic.zone; once autonomic-cooperative/stack-ssh-deploy#1 is fixed then this will give us basic safety checks on our stacks and we can move on to more CI excitement like:
shellcheckon custom entrypoints and.envrc.sample?yaml-linton compose files?)OK nice. The next thing I will work on is then the issue regarding the fact that when we know want to deploy these stacks onto a fresh slate each time. That is different from before because we usually assume that the stack is already up (along with its secrets) and then we're just updating it. We're going want to deploy as a fresh stack, and update now. Soooo, we need to integrate dummy secret creation for the CI. We're thinking along the lines of integrating abra into the stack-ssh-deploy plugin or something that lines up with what we do ourselves. In the meantime, if you want to just get moving, you can manually create the secrets on the swarm-test machine.
OK sitrep is now that we put secret generation and cleaning up into
stack-ssh-deployso this means that we can move on with getting CI setup for all the compose stacks we care about.Question: auto-creating networks? e.g. my
postfix-relaybuild is failing because themailnetwork doesn't exist: https://drone.autonomic.zone/compose-stacks/postfix-relay/2/1/2Could just create it on the test server, or make it part of
abra context init, but wondering if we want to automate this to make it more reproducible.@3wordchant maybe let's add a config for
stack-ssh-deploy:And just pick the default as
--driver overlayuntil we need something otherwise?Tight, I'll do that now 👌
@decentral1se should we close this or is there anything you wanna see done (aside from coop-cloud/traefik#6) before declaring testing "ready(ish")?