Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFind another CI #171
Find another CI #171
Comments
|
CircleCI does not seem to provide kernel newer than 4.15 either. |
|
@kdave Possible options.... |
|
What do you think about running an arbitrary kernel in qemu? It would be slower but would allow being independent of the CI host's kernel version. |
|
The CI environment is already virtualized, I'm not sure that nested virtualization would work, but if yes then it'd solve the problem. |
|
I've check SempahoreCI and AppVeyor, same 4.15 kernel. It's sometimes hard to dig the details, but if it mentions Ubuntu LTSS 18, then it means 4.15. |
|
Same for gitlab CI. |
|
@kdave I will explore Gitlab CI, have some experience with it. |
|
I agree with using nest virtualization. Previously I tired something like btrfsqa but it uses aws instance. Something like Gitlab docker/qemu will be a good alternative. We can utilize gitlab |
|
Gitlab doesn't allow forked project to have CI runs. So imported btrfs-progs from github and added gitlab-ci scripts https://gitlab.com/giis/btrfs-progs/commits/gitlabci gitlab-ci flow:
(wip) Sample ci run: https://gitlab.com/giis/btrfs-progs/pipelines/65974411 Also working on reporting back errors (or force gitlab ci to fail when required). |
|
Successful job running |
|
This looks very promising, thanks! The overall time seems to be log for the simple test-cli run (25 minutes). I think we don't need to build the kernel each time, though that this is possible is great and maybe I'll use that for kernel testing. |
|
okay. I'll create gitlab repo to host recent kernel bzImage file. We can fetch it from there and use with btrfs-progs testing. Is that fine? |
|
BTW, why not use distro kernels which is mostly vanilla? |
|
Hi @adam900710, thats a good idea. Let me check whether I can extract kernel from docker image of OpenSUSE tumbleweed and then use that with QEMU. |
|
The Tumbleweed kernel uses initrd that will be required to run qemu, and the initrd is usually created at kernel installation. For the CI run it can be pre-generated or possibly generated on the fly, but that's still some complication. |
|
Hi! Is anyone working on this? If not, I would like to help. Also, would it be possible to run xfstests on Travis or such? Building a minimal kernel for btrfs/xfstests (esp. with ccache) shouldn't take that long, but I don't know how long xfstests takes to run. The idea would be that contributors could test their kernel patches simply by pushing them to a branch on GitHub / opening a mock pull request on https://github.com/kdave/btrfs-devel. |
|
Hi @CyberShadow . I was busy with work for last few week and just this Friday I started looking into this again. (https://gitlab.com/giis/btrfs-progs/pipelines) . Plan is to skip every day kernel build as suggested by @kdave and @adam900710
Avoiding image build ,kernel build and btrfs-progs build on each stage speeds up the ci by 2:30 hrs Basically, we can make use of the kernel and images from previous built gitlab artifacts. I already did that simple using curl (https://gitlab.com/giis/btrfs-progs/blob/fsci_stages_faster2/.gitlab-ci.yml#L33) That reduced the time by ~30 mins. Now I'm trying to avoid btrfs-progs build for each stage. It should be ready either today or tomorrow. TBH, I was also thinking settings up xfstests run (from older scripts: https://github.com/Lakshmipathi/btrfsqa/blob/master/setup/scripts/003_xfstests) after completing this. You can make use of existing |
|
Hi! Those timings are very strange. On my machine, these things don't take nearly as long. Building btrfs-progs ( Running the CLI tests ( Why is there such a dramatic difference when running them on CI? Are the tools built in some debug mode that makes them several magnitudes slower? Some notes:
|
I've disabled convert tests from the |
Isn't it due to the qemu emulation? I don't know the exact setup Lakshmipathi used but that would be my first guess, besides that the CI instances are slow or don't have enough CPUs.
This would speed things up, though it costs memory and I can't find now how much eg. the travis instance gets. The minimum is 2G for the scratch device.
This sounds easy
I push to github and gitlab at the same time, so the connection to CI is independent and each host picks the CI configuration. I can test anything on gitlab/github "as if it were the final version" without disturbing other development eg. by putting it to another branch than devel. |
Why would you build btrfs-progs inside the VM? Also, with KVM the overhead should be negligible. Compiling anything in qemu without KVM should probably be avoided.
According to https://docs.travis-ci.com/user/reference/overview/ it's 7.5G. Should be enough. Might not be enough for xfstests?
OK, I'm thinking about how to make it easier for contributors. Probably more people have a GitHub account than a GitLab account, but I guess it doesn't matter that much as long as it's discoverable. |
7.5 is more than enough, so the tmpfs for scratch image is ok, we just need to make it configurable so it does not explode on random users' machines.
The point of gitlab regarding CI was better options than travis CI, so far the tests were post-merge. Extending that to the pull-request time checks makes sense, assuming most of them will come from github. |
Regarding fstests, I'm using VM instances with various memory sizes and 2G works too, the storage requirements are quite bigger to run the full suite though. One example for all, 6x independent block devices of at least 10G in size. |
That's because its run inside docker with qemu. Nested virutalization slowing things.
okay will disable convert tests, how much time does current CI take without 'convert tests'? Parallel build is good option. So far I'm running two stages in parallel but remaining tests in sequence, let me check it parallel and check the difference. |
|
This pipeline with parallel tests took less than 30 mins. https://gitlab.com/giis/btrfs-progs/pipelines/77289785 |
|
Great! I have also been experimenting: It looks like neither Travis nor GitLab CI support KVM in the test environment. This means that running under qemu will be terribly slow, as it will have to emulate the CPU in software. A possible better option is to use UML. Userspace in UML is quite slower than KVM, but still much faster than qemu without KVM. Kernel space code in UML (i.e. Also it looks like it is barely possible to run all tests without Docker or root, but the approaches I found are hacky at best. I had hoped that without requiring either, it could be ran on Travis' non-root infrastructure, which has more availability. But using Docker is more practical here. |
|
Thats nice. yes , UML another alternative which is in-between bare-metal and complete VM approach. I'm under the assumption that using qemu inside Docker may be helpful in future testing with different arch. I still need to clean-up above pipeline a bit (_need to investigate whether it reports failure correctly _) |
I think it's good to have that option, but I'm not sure it's necessary for daily CI runs. Here's some more thoughts about testing:
What do you think? And, what are your further plans? Would be good to avoid wastefully working on the same thing if possible. |
Docker is used only for the build tests with musl libc and this is namely to catch accidental build breakages. Making this step optional or pre-release only is ok. The |
Well, getting to successfuly configure and run fstests is not trivial, I documented that on wiki page and still find odd cases. Running a subset of fstests is doable but then there's the question how useful is that. Most problems I catch are when the full suite is run.
I've experimented with UML in the past but it's then resorted to VMs. UML does not have SMP support and I vaguely remember there were some other problems. But for the progs testing it could work. |
That doesn't matter if the actual tests are ran in a VM. I was trying to build the VM without root.
That's why I think it would be very valuable to have something fully automated!
OK, I'll give it a go and see how far I get. If UML doesn't work out, maybe we can ask someone from the community or company using btrfs to donate a machine that we can run the tests on, as that will allow using KVM. We can use Buildkite for the CI API stuff and scheduling. |
It does from what I can see, and in theory it should be possible to simulate SMP using host threads.
Ran into this specimen: http://lists.infradead.org/pipermail/linux-um/2019-August/001896.html If nothing comes out of this, will have to give up on it too. Even if it's a kernel bug worth fixing, it is probably beyond me. |
|
Hi @kdave Some info about the setup: gitlab-ci file has option enable/disable build kernel and qemu image through BUILD_KERNEL and BUILD_IMAGE variables. After image is built, disable kernel/image builds (BUILD_KERNEL=0,BUILD_IMAGE=0) and re-use https://gitlab.com/giis/btrfs-progs/blob/gitlab-ci/.gitlab-ci.yml#L38 Let me know your thoughts or suggestions. If you like to perform dry run, simply |
Hi @CyberShadow , If I'm not wrong, we should be able to trigger Gitlab-CI job for Github hosted project using something like https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html
@kdave, approximately, how much time does full suite run usually take? |
|
Removed hard-coded gitlab-project id from |
Make use of GitLab-CI nested virutal environment to start QEMU instance inside containers and perform btrfs-progs build, execute unit test cases and save the logs. More details can be found at kdave/btrfs-progs#171 Signed-off-by: Lakshmipathi.G <lakshmipathi.ganapathi@collabora.com>
|
Submitted patch for review https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg91391.html |
Make use of GitLab-CI nested virutal environment to start QEMU instance inside containers and perform btrfs-progs build, execute unit test cases and save the logs. More details can be found at kdave/btrfs-progs#171 Signed-off-by: Lakshmipathi.G <lakshmipathi.ganapathi@collabora.com>
Make use of GitLab-CI nested virutal environment to start QEMU instance inside containers and perform btrfs-progs build, execute unit test cases and save the logs. This allows to run the progs testsuite on a recent kernel, newer than what CI instances usually provide. As this is is emulated, the runtime is longer. Issue: #171 Signed-off-by: Lakshmipathi.G <lakshmipathi.ganapathi@collabora.com> Signed-off-by: David Sterba <dsterba@suse.com>
|
@kdave, Is GitLab CI/CD option enabled as public on https://gitlab.com/kdave/btrfs-progs repo ? From Left menu, |
|
It's enabled now, thanks for letting me know. |
|
I've started one pipeline manually and it failed at the begining, probably to download some files or configuration problme. @Lakshmipathi can you please have a look? |
|
Hi @kdave, Docker build will check whether specific docker images exists or not. If it exists, it will pull and use it. Otherwise it will build and push into registry. As you are running for the first time, it built the image but failed to push into GitLab registry
I think these config steps needs to documented. |
|
Wondering whether some other access needed (like access token) |
|
Container registry enabled in the settings |
|
Docker build phase succeded, but kernel and image did not. Is there some ordering needed? From the logs it looks like they both depend on docker (ie. pulling gitlab-ci from registry). |
|
Yes, I think its issue with ordering. Both kernel and image build needs docker image. Will send a fix along with any other issue we will encounter. |
|
I can see image under https://gitlab.com/kdave/btrfs-progs/container_registry . Can you try re-starting it? |
|
I tried to reproduce the same issue with my repo (by deleting the docker-image). First time docker build succeed but kernel/image failed. Second time, all of them running now. https://gitlab.com/giis/btrfs-progs/pipelines/90580172 I think docker-build needs to be placed under different stage |
|
I've pushed devel branch, that triggered another job and now it seems to work. So the ordering is probably required but the future jobs will work as long as the docker image is cached. |
|
okay. Yes since docker image already available on your registry will pull it from there. btrfs-progs build job failed on devel branch? |
|
|
|
oops, time for another config |
|
Other than that, looks like its some kind of gitlab network issue, I don't think |
|
@kdave, Since you already have kernel and debian image from these existing jobs: https://gitlab.com/kdave/btrfs-progs/-/jobs/338844201 If required, you can reuse those images by making below .gitlab-ci.yml changes:
|
|
This seems to be fragile, first generate, then update CI script with the ids. What if I want to rebuild the base image or kernel every now and then? The images are cached at the CI, the cache can be invalidated (ie. the files removed), so this would be the way to regenerate them. I'd expect the script can see if the image exists and use it, otherwise rebuild. |
|
So we will check whether required kernel or base image exists in CI cache or not. If its not available, then build it. That looks much better approach than current one. Let me read about CI cache stuff. |
Travis CI does not provide an updated system image and tests fail for that reason. We can't use that for development testing. Look for a better CI hosting.
Requirements: