Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

WIP: PoC First smoke test #19

Closed
wants to merge 159 commits into from

Conversation

agustinhenze
Copy link
Contributor

Here is a PoC of the smoke test following the steps described on #17. The minimal config is not so minimal yet as it could be and it does the ci pipeline too slow. I guess more than 25 minutes (at the moment that I'm writing this, it didn't finish yet...). I have rewritten the .travis.yml using stages + docker, so you can see if the lint check pass before wait the whole pipeline ends. I'm sure we can improve the speed a lot from here. The most important for me now, is to discuss if the approach is good or not.

"Easy" to speed up

  • Creating a custom repository where it can pull the kernel source squashed in a single commit
  • Using a minimal config that allow us to be sure it is useful of course

I would like to know your thoughts about it before following in that direction

sm00th and others added 30 commits August 1, 2017 13:34
skt basic functionality:
- fetch/merge git branches
- build
- publish: cp/scp
- run bkr job based on a template
Remember commit ids for each branch used, so that we can publish it
along with the build to be able to later recreate the same tree.
Add timestamp to tgz before uploading and upload buildinfo as well.
Use timestamp as UID in beaker jobs to make whiteboard unique.
Change from millisecond representation to human readable timestamp
format.
Instead of relying on assumptions of where interesting data should be in
the output stream - actually parse it and find the parts we are
interested in.
Allow the __main__ function to properly trap on various errors,
like user exit.

Signed-off-by: Don Zickus <[email protected]>
Just code cleanup.

Signed-off-by: Don Zickus <[email protected]>
Makes it easier to parse configs later.  The returned
value is a dict cfg of available options.
Code cleanup.
GitPython brinfs a bunch of compatability issues between versions so
dropping it in favor of direct subprocess calls.
Add subcommands merge/build/publish/run/cleanup and 'all' which would
allow to execute separate steps of the process.
Add INSTALL_MOD_STRIP=1 to make execution so that we get smaller
tarballs
Add an option for skt to not exit until runner is done.
Do not require 'uid' argument for runner.run method, use the last part
of url as uid instead.
Add an option to save/read states on each step to provide a
communication method between steps.
Switch from using heads only to any refs allowing user to specify full
ref in 'refs/xxx/yyy' format or just use 'yyy' and rely on git to guess
full ref.

THIS IS NOT JUST A RENAME. This commit actually changes the way refs are
fetched.
Don't use userprovided refs for in local ref names. It might result in
ambigious and/or weird names and only clutters ref list. Use "master"
for base and "merge" for merge branches instead.
Allow switching jow owner for submitted job.
Doing so makes it easier to navigate local refs especially in case when
multiple branches from the same remote are used.
Make --state option actually mater, before this commit state would be
used whether this option was provided or not.
buildinfo and tarpkg might be deleted/moved by publishers, so silently
ignore unlink errors
change retcode based on test results
Beaker results are not binary, apart from pass/fail there is also
'cancelled' and 'aborted'. Logging those might be useful.
Instead of relying on bkr's "--wait" option implement own wait, that
would monitor separate recipes. This is needed for future failure
handling features.
@agustinhenze
Copy link
Contributor Author

You can see the output pipeline here https://travis-ci.org/agustinhenze/skt/builds/355851651. It uses secret variables therefore it won't pass here.

@agustinhenze
Copy link
Contributor Author

I forgot to ping you, please take a look at it ☝️ @spbnick @stefwalter

@spbnick
Copy link
Contributor

spbnick commented Mar 20, 2018

Wow, impressive work, Agustin!

Here's my perspective.

First thing, I would like to keep CI fast, at least until development slows down. For that reason, I wonder if we can perhaps create a small repo in this "organization", which would look like a kernel to skt, but would "build" very fast. Or rather generate that repo as part of the integration tests, so they don't depend on GitHub being available, and so that they don't break independently of this repo.

I would also like to have any non-trivial tests, added to Travis CI runs, available for easy execution without it. I.e., first of all, they should be available to developers for running on their machines easily, and only then used by Travis CI.

I'm on the fence regarding Docker. On one hand, sure, it's easy to create a test environment with it, but on the other hand it's hard to debug. It's not helped by my minimal experience with it, so at the very least I would like more explanations of what's going on there :)

Lastly, I am very reluctant to bring such an explosion of complexity to our CI.

Do you think you can remake this as a shell or Python script running skt without Docker in a temporary or, perhaps, specified directory, and using a dummy git repo generated on the fly, and then add that script to .travis.yml?

@stefwalter, what's your opinion?

@spbnick
Copy link
Contributor

spbnick commented Mar 21, 2018

By "generating a git repo" I meant something like this (from an old project of mine): https://github.com/spbnick/carton/blob/master/tests/test_git.sh

@agustinhenze
Copy link
Contributor Author

First thing, I would like to keep CI fast, at least until development slows
down. For that reason, I wonder if we can perhaps create a small repo in this
"organization", which would look like a kernel to skt, but would "build" very
fast. Or rather generate that repo as part of the integration tests, so they
don't depend on GitHub being available, and so that they don't break
independently of this repo.

Great idea! Create a bare git repository with the minimal things needed, so skt
can see it like a kernel as you said above :). But we still depending on a
patchwork server running 🤔. We could use
https://github.com/getpatchwork/patchwork/blob/master/docker-compose.yml to
solve this. It means much more code to write and maintain but I agree it's
worth it, to keep a CI stable.

I would also like to have any non-trivial tests, added to Travis CI runs,
available for easy execution without it. I.e., first of all, they should be
available to developers for running on their machines easily, and only then
used by Travis CI.

Yes, I totally agree with you about both the testing and development
environments must be reproducible by any developer. I think using containers is
a good way to achieve that, all you need here is docker and docker-compose.
Then everyone can do exactly the same thing that travis does on this branch.
Conversely, if you need to reproduce what we have on master, we don't have any
chance because we can't control the travis' environment. I understand this is a
little more complicated but it solves the reproducibility of the testing and
development environments.

I'm on the fence regarding Docker. On one hand, sure, it's easy to create a
test environment with it, but on the other hand it's hard to debug. It's not
helped by my minimal experience with it, so at the very least I would like more
explanations of what's going on there :)

Actually it's the opposite, it's easy to debug because if something fails on CI
you can reproduce it easily on your machine. At least in my experience, the
benefits obtained, pay for the complexity added. I'll write a summary trying to
make the curve softer.

Lastly, I am very reluctant to bring such an explosion of complexity to our CI.

Ups, my idea is to write an integration test using docker-compose. In this way
everyone could have a complete setup with just a single command. I have been
playing a little bit with beaker server here
https://github.com/agustinhenze/beaker-lab

Do you think you can remake this as a shell or Python script running skt
without Docker in a temporary or, perhaps, specified directory, and using a
dummy git repo generated on the fly, and then add that script to .travis.yml?

Ok, I could do that, but I'm not so convinced it's a good idea. IMO, having a
decent way to reproduce the environment both for development and for testing
it's really important to allow enter new contributors easily. And assuming you
already have all dependencies installed and running on your machine is not an
easy way for someone who doesn't understand anything about the project and
want to contribute.

@agustinhenze agustinhenze mentioned this pull request Mar 23, 2018
6 tasks
@spbnick
Copy link
Contributor

spbnick commented Mar 26, 2018

Alright, let's try to go with Docker. It seems to be unavoidable anyway :) And I like the idea of not having to track the dependencies and install them all on the host.

One of the things I worry about, though, is how it would fare without an internet connection. Would it keep its images reliably cached and not decide to suddenly update them, without a request, at the most unsuitable moment, when a developer has no connection?

I think it would be awesome to have a Patchwork instance automatically set up for testing, both locally and in CI. It's been something I was doing my own research on. We can then feed it with test data as part of the setup and run our tests against it. However, I understand it can be quite complicated, and I don't want you to apply a huge effort to this.

I absolutely agree that it should be easy for people to start hacking on the project. It's with this intention @stefwalter has been hacking on a Dockerfile for skt in #28.

Our own, automatically-setup Beaker would be simply amazing, but I wonder how you're going to provision it with systems from inside a Docker container. I also expect it would be a big effort to get it to run as we need.

@major, what do you think about Agustin's ideas?

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

Successfully merging this pull request may close these issues.

6 participants