-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(tests): Enable Kubernetes tests #1970
Conversation
Thanks @ktff, this looks great. We recently moved all of our build/test steps into this @a-rodin should we move this to the |
.github/workflows/ci.yaml
Outdated
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --release --no-default-features --features "sources-kubernetes transforms-kubernetes sinks-console" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could build Vector once for all of our tests, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in general we should have a check job that just runs check which should be fast and good for quick feedback.
Then one test job that tests everything, hopefully we won't run into noise issues with running kube and all our docker containers together. This then would allow us to build vector once in test mode and cache those build artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could build Vector once for all of our tests, if possible.
Yep, sharing the binaries could really speed up the test harness execution. We probably should address this as a part of our Github Actions switch. We'll have an opportunity to apply some grand design to our CI flows.
I think in general we should have a check job that just runs check which should be fast and good for quick feedback.
I have some ideas on how to organize the jobs/steps/actions/workflows to make them much more compact and composable that what we have at Circle CI. And more maintainable, and efficient too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sharing the binaries could really speed up the test harness execution. We probably should address this as a part of our Github Actions switch.
I'll see if it can be achieved here, because it would half the execution time from 40min to 20min, and half the total work.
This config is much nicer than circles! Looking good! |
@ktff This looks great! However, during the migration to GitHub Actions we try to keep it possible to run all CI workflows locally. The approach is to add jobs as services to the Keeping entire workflow in |
@a-rodin Ok, I'll migrate the configuration to the |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Signed-off-by: Kruno Tomola Fabro <[email protected]>
@a-rodin What do you think about having two ways of running the Kubernetes tests? One in docker_compose and the other with github actions. It will be a bit more to maintain, but both can be optimized to run in there own respective cases. Otherwise, I'll need to butcher how it's being tested in docker-compose so it's runnable on github action. The main problem being that the disk is being exhausted, and the second that it's taking ~40min to build everything in sequence. |
Just to throw it out there. Would custom GH runners solve this? It's something we've been discussing. |
Can we spin up a dedicated server that holds a kube cluster and run all our tests with both |
Both cases would solve it, but with higher maintainance cost, and slower, than ~60 lines that are dedicated to running the tests on github actions. As there is probably no significantly better option, I'll just add the separate config for github actions. |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
…le_kube_tests Signed-off-by: Kruno Tomola Fabro <[email protected]>
@ktff I think that the approach with having different configs for My point was that it is desirable to be able to easily test every feature of Vector locally, including the Kuberenetes-related ones. Once it is possible, I think it is fine to have the duplication if it is not feasible to avoid it. |
I just want to note that we moved away from using |
Minikube was the first choice, and it still is on GA. Kind indeed is slow, so its used with only 2 test threads to decrease the load. @LucioFranco I do like the idea of users externally providing Kubernetes cluster. If kind again becomes a problem, this is probably what we should do. Minikube unfortunately isn't reliably usable inside docker with none drive as there are various bugs with it that popup on different machines/OS. But once none driver becomes more stable we should revisit this. |
I am still not following why we need it to run inside docker, users can setup virtualbox or kvm and for CI we should just spin up a small instance on aws that has a kube cluster. As long as we namespace things correctly multiple tests should be able to be run against that cluster. This should remove the need for docker? |
I agree with you. I mentioned that paragraf as a note to remember that minikube isn't used in the scripts only because none driver currently isn't stable. I'll add a line to remove the ambiguity. |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
To clarify things:
Also, for local testing, I'll reduce testing threads to 1 as it seems that it is faster with kind. Kind really doesn't like multiple tests runing at once. With one thread local testing is done in ~6min (sample size: 1). |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
I'll gather some statistics on reliability of kind, if it's locally to flaky, then as @LucioFranco suggested we should enable the optional use of user provided cluster, in a follow up issue. |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Regarding locally running tests, they were run 100 times, out of which 72 timed out on To alleviate pressure on
as a result, all subsequent 30 test runs were succesful. This should be sufficente for now, but I'll open an issue to enable usage of user provided cluster. Regarding CI running tests, there is a bug on how we exclude our own logs from collection on Kubernetes v1.13 and lower. It was introduced with #1501. This is causing a log feedback loop and making the GA runners unresponsive. I'll disable the testing on v1.13 for now and open a separate issue for the bug. Ironically, this manifested on |
Signed-off-by: Kruno Tomola Fabro <[email protected]>
Nice, thank you for digging into this and solving it. |
Regarding the bug: could you open an issue to represent fixing that? It sounds pretty important. |
It is, I'm currently writing it. |
Closes #1635.
Open an issue to extend TLS configuration to accept certificate as Vec. Necessary to enable
transforms::kubernetes::watch_client::kube_tests::watch_pod
test.Tests on CI are exhausting disk space. Something needs to be deleted.