techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

CI - Address Failures #132

Closed timothystewart6 closed 9 months ago

timothystewart6 commented 2 years ago

Expected Behavior

CI should not fail as often

Current Behavior

CI seems to fail quiet a bit and I think this is just a side effect of how slow the VMs are in GitHub.

I see a few possibilities here:

sleiner commented 2 years ago

I think this is just a side effect of how slow the VMs are in GitHub.

@timothystewart6 I assume you are talking about the "Test" workflow?

I did just take a look and found that out of the last 25 runs of the workflow, 12 runs failed:

So, let's look at the problems:

timothystewart6 commented 2 years ago

@sleiner Thank you for the analysis! I am going to spin up some self-hosted runners to see if that eases the failures due to performance.

RE: requirement.txt good to know! I will see if I can straighten this out. I am a fan of freezing the requirements however it might be causing too much churn having depdendabot looking at our child dependencies.

RE: molecule.yml schema, good to know. That's too bad we can't use anchors but I am ok with repeating since it's something that shouldn't change too often.

sleiner commented 2 years ago

RE: requirement.txt good to know! I will see if I can straighten this out. I am a fan of freezing the requirements however it might be causing too much churn having depdendabot looking at our child dependencies.

If we were not freezing dependencies right now, CI would be broken because of the schema changes in molecule 4.0.2, so I agree that this is sensible for this project. Just to make sure that we are on the same page: With pip-compile, you would still freeze the dependencies, but separate the frozen environment (requirements.txt) from your "known requirements" (requirements.in: only direct dependencies, usually only lower bounds on version numbers, except when you're sure a newer version would break something). Through that separation, you get multiple advantages, like...

sleiner commented 2 years ago

Also, if this was a "real Python project", one should probably use pyproject.toml instead of requirements.txt as well as a dependency manager that comes closer to the state of the art (in my experience, pdm is currently in the lead, other contestants are poetry and pipenv) - but for the scope of this project (we just need to install some Python tools), the really basic requirements.txt approach with pip-compile seems well-suited to me.

timothystewart6 commented 2 years ago

I think these can be addressed in separate PRs. Thank you again for your insight!

timothystewart6 commented 1 year ago

I decided not to pursue self-hosted runners, at least in Kubernetes and for now. https://github.com/techno-tim/k3s-ansible/pull/136

timothystewart6 commented 9 months ago

fixed by https://github.com/techno-tim/k3s-ansible/pull/389