ci: rearchitect and streamline CI - #143
Conversation
e92c0e5 to
e5324bc
Compare
deb13f1 to
f2974bf
Compare
509c444 to
ffb44b9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ffb44b9 to
61db7a3
Compare
61db7a3 to
61dd43e
Compare
61dd43e to
8c05983
Compare
| echo 'alias shasum="sha512sum"' >>~/.bashrc | ||
| # shellcheck disable=SC1090 # sourcing the user's own ~/.bashrc, not a repo file shellcheck can resolve | ||
| source ~/.bashrc |
There was a problem hiding this comment.
not super happy with this. this is pulling unknown stuff.
| echo "removing build/ if already present" | ||
| rm -rf build/ |
| IMAGE_REGISTRY_NAME_TAG=${IMAGE_REGISTRY}/${IMAGE_NAME_TAG} | ||
|
|
||
| # make -C implicitly enables --print-directory on some GNU Make versions | ||
| # (confirmed: not on this repo's dev-Mac Make 3.81, but yes on the Ubuntu |
|
|
||
| info "Verifying prerequisites" | ||
| #which aws > /dev/null || (echo "error: missing required command 'aws'" && exit 1) | ||
| which docker >/dev/null || (echo "error: missing required command 'docker'" && exit 1) |
There was a problem hiding this comment.
why bother? this will fail anyway later
| bootstrapKubeconfigPath, err := uniqueTempFilePath("bootstrap-kubeconfig-*") | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| defer func() { | ||
| if removeErr := os.Remove(bootstrapKubeconfigPath); removeErr != nil { |
There was a problem hiding this comment.
bootstrap kubeconfig is broken iirc?
| byoHostName1 = fmt.Sprintf("byohost1-%s", util.RandomString(6)) | ||
| byoHostName2 = fmt.Sprintf("byohost2-%s", util.RandomString(6)) |
There was a problem hiding this comment.
how can we verify we can re-use existing hostnames?
| byoHostName1 = fmt.Sprintf("byohost1-%s", util.RandomString(6)) | ||
| byoHostName2 = fmt.Sprintf("byohost2-%s", util.RandomString(6)) |
There was a problem hiding this comment.
how can we verify we can re-use existing hostnames?
There was a problem hiding this comment.
This needs to be a separate test where we test an explicit reuse.
| ) | ||
|
|
||
| var _ = Describe("When testing MachineDeployment scale out/in", func() { | ||
| var _ = Describe("When testing MachineDeployment scale out/in [MD-Scale]", func() { |
There was a problem hiding this comment.
can we avoid running scale tests in the github action?
| go run ./main.go | ||
|
|
||
| docker-build: ## Build docker image with the manager. | ||
| ifdef SKIP_BUILD |
There was a problem hiding this comment.
make was orignally built to handle build dependencies to avoid compiline and building files twice. This feels wrong
8c05983 to
84b0172
Compare
GINKGO_NODES runs multiple Ginkgo worker processes concurrently on the same runner, sharing one Docker daemon and filesystem (unlike a matrix-of-jobs design where each spec gets its own isolated VM). With hardcoded names like "byohost1" or "/tmp/host-agent1.log" shared across every spec file, two specs racing on the same runner would collide trying to create the same container or write the same log/kubeconfig path. Suffix host/container names and log file paths with a random string per spec, and generate the bootstrap kubeconfig's temp path via os.CreateTemp instead of a single hardcoded path, so concurrent nodes never step on each other's resources.
Split CI into 4 directly-triggered, standalone workflow files: - build-agent-bundle - build-controller-manager - unit-test - e2e The build workflows will only push from main. But otherwise, are pre-requisites for the E2E test, so that we do not rebuild the same artifact in E2E again, and instead can reuse it from the build's artifacts cache. We dont want to use GitHub's workflow_run, because it's not possible to show the status of the run on the PR / commit. As a result, use a standalone script to wait for the build workflows to complete.
84b0172 to
24806b9
Compare
With this PR, the GitHub CI will take ownership of building and pushing the agent bundle and controller-manager image directly to
quay.io/platform9/cluster-api-provider-bringyourownhost. Additionally, we'll tag each artifact with its own unique tag derived from its git commit.We also enable all the E2E suites to run in parallel, so some e2e specific changes were required here.
Note that: Now we run all E2E suites which was not the case previously. So E2E will now fail again from this PR onwards. To be fixed in follow ups.
Architecture
Stack created with GitHub Stacks CLI • Give Feedback 💬