-
Notifications
You must be signed in to change notification settings - Fork 76
Add e2e package #35
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
Add e2e package #35
Conversation
|
Please sign your commits following these rules: $ git clone -b "master" [email protected]:errordeveloper/linuxkit-kubernetes.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
pkg/e2e/Makefile
Outdated
| kube_release_artefacts=https://dl.k8s.io/$(kubernetes_version)/bin/linux/amd64 | ||
|
|
||
| .PHONY: build | ||
| build: _cache/kubernetes-test.tar.gz _cache/kubectl |
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'd really like to avoid adding any more Makefile wrappers for package builds at this point.
Are these things large enough to be worth caching or can we just get away with fetching them in the Dockerfile.
If they are big and we think caching is worth while then we should look into enhancing the linuxkit tool to express this in the build.yml, perhaps with a new subsection of depends alongside the docker image cache one I added to get rid of the last Makefiles here? If we are going down this path then probably it would be best to have a design in an issue on the linuxkit/linuxkit repo first.
Note that my preference would be to simply avoid the cache (i.e. just fetch in the Dockerfile) unless the artefacts are really so large as to be problematic.
pkg/e2e/build.yml
Outdated
| org: linuxkit | ||
| image: kube-e2e-test | ||
| network: true | ||
| disable-content-trust: true |
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.
Lets setup trust for this repo before we merge this PR. I think everything in the linuxkit org really ought to be signed these days.
|
I think you'll need to add a new job to the |
|
Ian, thanks for looking at this!
I do not like Makefile wrapper also, just checked it in as I had it
already. I thought of compiling it, like we do for kubelet package, but
then sharing the build logic and caching artefacts comes to mind...
If we do lean towards fetching binaries rather then building, I am happy to
think of a design for that, but personally I feel like we will build
Kubernetes code anyway, so we should just tackle that in a way that allows
us to reuse artefacts for different images. I certainly would like to be
able to use a local checkout of k/k, or a use fork URL.
I am happy to copy build logic from kubelet for now, let me know what you
think. By the way, are we looking to eventually use buildkit for building
things from source? If so, how long until we might be able to use it here?
…On Mon, 18 Dec 2017, 5:00 pm Ian Campbell, ***@***.***> wrote:
I think you'll need to add a new job to the .circleci/config.yml,
hopefully the pattern will be obvious, ask if not. (another reason to avoid
Makefile wrappers is it avoids special cases here...)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPWS3aaKgZ1-Of3elF0kGhk9G6P5E_pks5tBpo0gaJpZM4RFwq0>
.
|
|
It should be a relatively simply change to this PR to move the curl invocations into the Dockerfile nowm then we can get this merged (assuming the downloads are 10s to asmall hundred MB should be tolerable given we ought to be building this package reasonably infrequently) and consider whether we want to build from scratch or not ( WRT building, what is the source repo for this stuff? |
|
I missed replying to your final paragraph, #2587 has a bullet point for using buildkit but AFAIK noone is actively working on that so there is no timeline for when it might become possible. |
Remind the reader about the other place to update. Structured as a list because I'm anticipating linuxkit#35 adding another. Make the variable name consistent too by updating scripts/mk-image-cache-lst. Signed-off-by: Ian Campbell <[email protected]>
Remind the reader about the other place to update. Structured as a list because I'm anticipating linuxkit#35 adding another. Make the variable name consistent too by updating scripts/mk-image-cache-lst. Signed-off-by: Ian Campbell <[email protected]>
kubernetes/kubernetes |
Remind the reader about the other place to update. Structured as a list because I'm anticipating linuxkit#35 adding another. Make the variable name consistent too by updating scripts/mk-image-cache-lst. Signed-off-by: Ian Campbell <[email protected]>
bdc2376 to
3741a07
Compare
|
This now builds all binaries that are needed from source. |
3741a07 to
76d117b
Compare
76d117b to
5083219
Compare
pkg/e2e/.gitignore
Outdated
| @@ -0,0 +1 @@ | |||
| _cache | |||
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 don't think this exists in the current version so this whole file is redundant.
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.
Indeed
pkg/e2e/Dockerfile
Outdated
| RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ | ||
| #coreutils needed for du -B for disk image checks made by kubelet | ||
| # example: $ du -s -B 1 /var/lib/kubelet/pods/... | ||
| # du: unrecognized option: B |
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.
Is this relevant in the context of building the tests?
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.
No
pkg/e2e/README.md
Outdated
| ``` | ||
|
|
||
| This will result in `linuxkit/kube-e2e-test:current` image that | ||
| you can use. See `e2e.sh` for supported environment variables. |
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.
The section is out of date I think.
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.
Yes
|
@ijc I've updated this, and included YAML in the top-level directory, as I didn't know where it maybe be better to put it. Inside the package it would affect the hash and that doesn't seem right. Running the e2e tests in CI would be a long job (I think it took 40min on my laptop last time I tried it), what do you think? |
09067af to
bd2dafb
Compare
|
About to take a look, but came here to ask you to rebase onto #36 and to update the two comments I added and add a similar comment to the place you've added another Kube version definition.
40 mins is certainly too long, the current set of tests takes ~20 mins in the worst case (all packages needing to be rebuilt) and can be much faster if packages don't need building. We could consider adding a daily/nightly job which ran on master and ran these tests, but lets defer that until these basics are in. |
Do you mean Actually that does highlight that this is not actually a "linuxkit package" (i.e. something you would feed to Wherever it ends up you should include it in the What about also adding |
💯 👍 |
3b7ee1e to
0297ffa
Compare
| - lint | ||
| - pkg-kubelet | ||
| - pkg-cri-containerd | ||
| - pkg-kube-e2e-test |
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.
You are missing a linuxkit pkg push --nobuild for this new package in the push-pkgs-to-hub step.
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.
Well spotted!
pkg/kube-e2e-test/build.yml
Outdated
| org: linuxkit | ||
| image: kube-e2e-test | ||
| network: true | ||
| disable-content-trust: true |
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 setup content trust for this repo so you can now drop this line.
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.
Done.
scripts/run-e2e-test.sh
Outdated
| #!/bin/sh | ||
|
|
||
| set -o errexit | ||
| set -o pipefail |
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.
pipefail (at least) is a bash-ism so you need #! /bin/bash shebang. Not sure about errexit or nounset, the short names (-e and -u) are portable I think.
Given how awful it is to replicate pipefail in pure POSIX shell I think just using /bin/bash for the shebang is the right answer in this case.
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.
Ah, I didn't realise this... It's okay, we aren't relying on pipefail here. I'll switch to /bin/sh and use set -eu, same goes for pkg/kube-e2e-test/e2e.sh (which currently has an explicit set +o pipefail).
beae7cd to
349b23a
Compare
scripts/run-e2e-test.sh
Outdated
| echo "$0: log save in ${PWD}/e2e.log, cleaning up the resources..." | ||
| cleanup 2> /dev/null || true | ||
| grep -q '^Test Suite Passed$' e2e.log && exit 0 | ||
| grep -q '^Test Suite Failed$' e2e.log && exit 1 |
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.
If the log contains neither the pass nor fail messages that is a failure IMHO (perhaps the file is empty because pod logging is b0rked), I think you can just drop the grep from this last line and exit 1 unconditionally.
|
I found an issue with the script, testing a fix right now. |
8e4c750 to
7bd6c72
Compare
0edd1f3 to
3d2fad9
Compare
|
@ijc I'm quite happy with the runner script now, PTAL. |
Signed-off-by: Ilya Dmitrichenko <[email protected]>
| linuxkit pkg push --nobuild pkg/cri-containerd | ||
| linuxkit pkg push --nobuild pkg/kubelet | ||
| linuxkit pkg push --nobuild pkg/cri-containerd | ||
| linuxkit pkg push --nobuild pkg/kube-e2e-test |
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.
Why did you move cri-containerd below kubelet? They were alphabetic before. Suppose it isn't a big deal.
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.
They were in different order in some places, so I was trying to list them in the same order everywhere...
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 guess it was the other places which were buggy then ;-)
Lets not worry about it, if someone enthusiastic soul decides they want to sort them later (and add comments to keep them sorted) then they can.
ijc
left a comment
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.
LGTM
This package contains bare minimum configuration required to run e2e tests.
As seen in linuxkit/linuxkit#2668 earlier.
It still needs a little work (e.g. Job config would be plausible to add), but I wanted to open a PR before this gets lost.