-
Notifications
You must be signed in to change notification settings - Fork 40k
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
upstream heptio/kube-conformance #69368
upstream heptio/kube-conformance #69368
Conversation
In support of #69110 cc @timothysc @jbeda |
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.
@dims thanks for doing this!
Minor comment about adding other .test artifacts and possibly changing the name.
build/lib/release.sh
Outdated
@@ -217,6 +218,12 @@ function kube::release::build_server_images() { | |||
if [[ "${KUBE_BUILD_HYPERKUBE}" =~ [yY] ]]; then | |||
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/hyperkube" "${release_stage}/server/bin" | |||
fi | |||
# if we are building conformance, we also need to copy the binaries needed | |||
if [[ "${KUBE_BUILD_CONFORMANCE}" =~ [yY] ]]; then | |||
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/e2e.test" "${release_stage}/server/bin" |
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.
fwiw I think we should call it kube_tests and include the other suites. We had an issue open for a while to include the node tests to evaluate prior to running conformance.
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.
Ack. i want to get the basic skeleton working and hand it off to @brahmaroutu or @duglin who promised to help.
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.
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/*.test" "${release_stage}/server/bin"
should work.
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 @timothysc
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 this works. I'd think of this as part of building the test tarball rather than the server (=control plane) images ... Anyone building those will need to opt out of another image now or lose build time again.
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.
switching back to cp "${LOCAL_OUTPUT_BINPATH}/${platform}/e2e.test" "${release_stage}/server/bin"
, will revisit later when we add node conformance test etc
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 do you need these test binaries in the server tarball? I don't see them used anywhere.
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.
Ideally, we would want e2e.test and e2e_node.test - When a group is running conformance this gives them the ability to check to see it the node itself passes the local checks.
/area conformance |
/kind feature |
513d8bc
to
066f512
Compare
066f512
to
8964386
Compare
/retest |
/test pull-kubernetes-cross |
8964386
to
c6b3985
Compare
f44bf1d
to
0cac408
Compare
build/lib/release.sh
Outdated
@@ -217,6 +218,12 @@ function kube::release::build_server_images() { | |||
if [[ "${KUBE_BUILD_HYPERKUBE}" =~ [yY] ]]; then | |||
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/hyperkube" "${release_stage}/server/bin" | |||
fi | |||
# if we are building conformance, we also need to copy the binaries needed | |||
if [[ "${KUBE_BUILD_CONFORMANCE}" =~ [yY] ]]; then | |||
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/e2e.test" "${release_stage}/server/bin" |
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 do you need these test binaries in the server tarball? I don't see them used anywhere.
build/lib/release.sh
Outdated
if [[ -n "${save_dir}" ]]; then | ||
"${DOCKER[@]}" save "${conformance_tag}" > "${save_dir}/conformance-${arch}.tar" | ||
fi | ||
if [[ -z "${KUBE_DOCKER_IMAGE_TAG-}" || -z "${KUBE_DOCKER_REGISTRY-}" ]]; then |
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'm pretty sure we can always call rmi
here - we use the tarballs to push to gcr.io these days, rather than pushing images directly. (The conditionals are basically legacy stuff I forgot to clean up after #47939.)
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.
- ok removing the test binaries
- cool, removing the if condition around
rmi
E2E_TEST_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/e2e.test | ||
CLUSTER_DIR?=$(shell pwd)/../../../cluster/ | ||
|
||
BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.10.2 |
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 hyperkube?
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 needed something that had ca-certificates
and just reusing the existing image.
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.
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 could also potentially clean-install ca-certificates
in the Dockerfile for conformance. hyperkube-base has a lot of extra stuff you don't really need...
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.
OTOH installing packages at build time is not great, so I'm OK with leaving this as-is for now.
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.
whew! thanks :)
REGISTRY?=staging-k8s.gcr.io | ||
ARCH?=amd64 | ||
OUT_DIR?=_output | ||
GINKGO_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/ginkgo |
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.
maybe build/lib/release.sh
could set these variables, since it really knows the path?
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.
was just following the pattern from cluster/images/hyperkube/Makefile
could we do this in a later PR? (clean up both)
build/release-images.sh
Outdated
@@ -29,6 +29,9 @@ CMD_TARGETS="${KUBE_SERVER_IMAGE_TARGETS[*]}" | |||
if [[ "${KUBE_BUILD_HYPERKUBE}" =~ [yY] ]]; then | |||
CMD_TARGETS="${CMD_TARGETS} cmd/hyperkube" | |||
fi | |||
if [[ "${KUBE_BUILD_CONFORMANCE}" =~ [yY] ]]; then | |||
CMD_TARGETS="${CMD_TARGETS} vendor/github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test cmd/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.
would it make sense to list these targets in hack/lib/golang.sh
rather than repeating them in multiple places?
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 was not sure KUBE_SERVER_IMAGE_TARGETS
was appropriate to change (see line 28)
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 meant to add another variable like KUBE_CONFORMANCE_TEST_TARGETS
or something.
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.
perfect. doing that now
@@ -0,0 +1,53 @@ | |||
#!/bin/bash |
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.
should this script have errexit
, nounset
, and pipefail
per usual?
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.
fixing
exit -1 | ||
fi | ||
|
||
IMAGE="${REGISTRY}/conformance-amd64:${VERSION}" |
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.
should we be using a manifest-list here instead?
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.
eventually, this is just a helper script. (make release/quick-release will spit out images for all platforms already)
/retest |
0cac408
to
2090bb8
Compare
/retest |
@ixdy there's more things to do here which we can tackle while we are getting a job up and go green. i'll open a follow up Issue for @brahmaroutu and myself. |
/lgtm |
|
||
ginkgo_args=( | ||
"--focus=${E2E_FOCUS}" | ||
"--skip=${E2E_SKIP}" |
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.
E2E_SKIP
isn't defined by default - should it be?
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.
Fixing
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 doesn't need to be and it's defined in the dockerfile.
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.
@timothysc i had removed it in one of the edits. yes, should be good with latest changes
[1-9]|[1-9][0-9]*) ginkgo_args+=("--nodes=${E2E_PARALLEL}") ;; | ||
esac | ||
|
||
echo "/usr/local/bin/ginkgo ${ginkgo_args[@]} /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider=\"${E2E_PROVIDER}\" --report-dir=\"${RESULTS_DIR}\" --kubeconfig=\"${KUBECONFIG}\"" |
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.
similarly for KUBECONFIG
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
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.
same answer.
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.
y i added it after @ixdy's nudge
/hold |
it'd be worth following up with the bazel rules to build this image, too. I believe this would do it (put in load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image", "container_layer")
container_layer(
name = "cluster-srcs",
data_path = "/",
directory = "/kubernetes",
files = ["//cluster:all-srcs"],
)
container_layer(
name = "bins",
directory = "/usr/local/bin",
files = [
"//cmd/kubectl",
"//test/e2e:e2e.test",
"//vendor/github.com/onsi/ginkgo/ginkgo",
],
)
container_image(
name = "conformance-internal",
base = "@debian-hyperkube-base-amd64//image",
cmd = [
"/bin/bash",
"-c",
"/run_e2e.sh",
],
env = {
"E2E_FOCUS": "\[Conformance\]",
"E2E_PARALLEL": "1",
"E2E_PROVIDER": "local",
"RESULTS_DIR": "/tmp/results",
},
files = [
":run_e2e.sh",
],
layers = [
":cluster-srcs",
":bins",
],
stamp = True,
workdir = "/usr/local/bin",
)
container_bundle(
name = "conformance",
images = {"k8s.gcr.io/conformance-amd64:{STABLE_DOCKER_TAG}": "conformance-internal"},
stamp = True,
visibility = ["//visibility:public"],
) |
(updated my bazel code to add visibility on the |
Thanks @ixdy adding the cluster/images/conformance/BUILD |
2090bb8
to
6881049
Compare
Pick up some code from https://github.com/heptio/kube-conformance Fix up build scripts for the new conformance image Fix Header template and Copyright to make verify job go green update README and add execute permissions for script Change-Id: Ib6509acd816cc2fb3a516bfb8e0ff9e32bff8f79
6881049
to
6830bad
Compare
@@ -0,0 +1,66 @@ | |||
# Copyright 2016 The Kubernetes Authors. |
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.
technically this should be 2018 but I don't really care
/lgtm |
/retest |
/hold cancel |
Pick up some code from https://github.com/heptio/kube-conformance
Command line to build the container:
REGISTRY=staging-k8s.gcr.io VERSION=v1.12.1 hack/dev-push-conformance.sh
Change-Id: I22d2436ad2658bdc889af566beb21f3714d0b0b0
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: