Skip to content
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

Work out a CI setup #10

Closed
ncoghlan opened this issue Mar 28, 2017 · 16 comments
Closed

Work out a CI setup #10

ncoghlan opened this issue Mar 28, 2017 · 16 comments

Comments

@ncoghlan
Copy link
Contributor

Since we have integration tests now, we have the ability to set up some pre-merge CI. However, the integration tests currently rely on Vagrant with 64-bit CentOS boxes which means either:

@shaded-enmity would you mind talking to @msrb about that? He's been doing a bunch of Jenkins/GitHub integration lately, and I think that might actually be our best option here.

@shaded-enmity
Copy link
Member

Yup, as a matter of fact we talked about this exactly yesterday :) After drawing bunch of diagrams on the table I realized that we might be dead in the water, since we need to interface w/ libvirt, we really need to either:

  • Execute the tests on bare metal
  • Execute the tests in a nested virtualization enabled VM

@kbsingh do you now if either of the two options would be applicable on CentOS CI?

@shaded-enmity
Copy link
Member

(I have a backup plan of setting up a Jenkins on cucos-1/2 with nested virt enabled)

@kbsingh
Copy link
Contributor

kbsingh commented Mar 28, 2017

Running bare metal is no problem on @centos-ci - All you would need to do is make sure there is a script included that does the machine setup before running the tests ( eg. yum install libvirtd && service libvirtd start etc ). This works as long as the test runtime is under a few hours, if you need to run the tests in a way that each individual run would take more than a few hrs, then @centos-ci has VMs as well, which all have nested virt enabled. But I would recommend going down the route o bare metal first.

@kbsingh
Copy link
Contributor

kbsingh commented Mar 28, 2017

to make life easier, if you need Vagrant to support the tests you are running right now, you can always just install vagrant from SCLs and just use that as well :)

The typical machine size on @centos-ci is 8cores 32gb ram E3-1270; so you should have enough capacity based on my initial scan of the code right now.

There is a Getting Started walk through at https://wiki.centos.org/QaWiki/CI/GettingStarted - Let me know if you need anymore info.

@shaded-enmity
Copy link
Member

Thanks KB, following the walk through now. Will add bug tracking number later.

@ncoghlan
Copy link
Contributor Author

@shaded-enmity Something that the CI is going to need that isn't strictly necessary when running tests locally is passwordless sudo access for the leapp-tool.py command.

If the tests run as root, that would solve that problem, otherwise we may need to drop a config file into /etc/sudoers.d.

@shaded-enmity
Copy link
Member

@ncoghlan good point, thanks, will prepare Ansible playbook for setting up the test machine & environment once I get my hands on it.

@kbsingh
Copy link
Contributor

kbsingh commented Mar 29, 2017

Note that centosCI will give you root@ the worker nodes by default

@shaded-enmity
Copy link
Member

Something to consider now is the caching of Vagrant boxes, every test run requires centos:6 and centos:7 box images to be present on the system executing the tests. Pulling the images, depending on network quality, might actually take more time, or at least be a major component of, than running the test themselves.

@ncoghlan
Copy link
Contributor Author

Good point, my initial setup was based on the assumption of a persistent workstation, and that's not valid in a CI environment.

@kbsingh Is there anything already set up in the CentOS CI environment that could help with this?

Note that while we'd definitely prefer it, "Vagrant box" isn't actually a hard requirement - if there were non-Vagrant libvirt compatible images available, we could switch over to using Ansible to configure the test VMs instead.

Vagrant is just handy since it automatically deals with the VM network and storage configuration for us.

@bstinsonmhk
Copy link
Contributor

WRT caching the vagrant boxes, we should already be optimized. Atlas redirects the download of the box itself to cloud.centos.org, and we have a mirror of that local to the CentOS CI Environment

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Apr 1, 2017

@bstinsonmhk Nice! It's always a happy outcome when it turns out the convenient approach has already been made efficient :)

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Apr 4, 2017

@shaded-enmity Looking up something else in the behave docs, I realised that since we're going to be using Jenkins, we should run behave with the --junit option: https://pythonhosted.org/behave/behave.html#cmdoption--junit

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Apr 6, 2017

And another potentially relevant config option: https://pythonhosted.org/behave/tutorial.html#controlling-things-with-tags

However, to simplify test skipping, I think it will make sense for us to adopt the autoskipping approach recommended in http://stackoverflow.com/questions/36482419/how-do-i-skip-a-test-in-the-behave-python-bdd-framework/42721605#42721605

That's actually useful to me for #29 to mark the depends-on-the-DBus-service-I-haven't-written-yet scenario for skipping, so I'll add it there.

@bstinsonmhk
Copy link
Contributor

The workspace and other accounts are created on CICO, are you folks working on a JJB template for your jobs?

@ncoghlan
Copy link
Contributor Author

Our CentOS pre-merge CI has been working for a while now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants