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

Fixes to kubekins test-image, add makefile #16287

Merged
merged 1 commit into from
Oct 29, 2015

Conversation

j3ffml
Copy link
Contributor

@j3ffml j3ffml commented Oct 26, 2015

Fix issues, address comments from #16140. Also, closes #14781

@ixdy, to answer "why separate gotest-pr.sh"; tests run in container as root, so build/test output files in the workspace get owned by root as well. This requires extra cleanup steps I didn't want to reproduce for the kubernetes-test-go job, but I can if you think it's worth doing.

@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 26, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/S

gcloud docker push gcr.io/google_containers/kubekins-test # Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/kubekins-test:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)

clean:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No clean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No generated files, so nothing to clean. Empty target is the pattern used elsewhere.

@k8s-bot
Copy link

k8s-bot commented Oct 26, 2015

GCE e2e test build/test passed for commit c114b9d27f2f522c636429745d0aad871abe565a.

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 26, 2015

@k8s-bot unit test this

@@ -42,6 +38,10 @@ export KUBE_COVERPROCS=8
export KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=4
export LOG_LEVEL=4

./hack/build-go.sh
godep go install ./...
./hack/install-etcd.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make this ./hack/install-etcd.sh || ./hack/travis/install-etcd.sh?

or we can cherrypick #15336 into release-1.0 and release-1.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately #15336 is only one of several changes in test scripts between 1.0/1.1 and head. We can either go through and cherrypick all the changes, or we can have a branch-specific hack/jenkins/test-image/run.sh for each branch that runs the version of verify* scripts that exist on the branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option (maybe this is getting into too much indirection?) is that this file calls hack/jenkins/gotest.sh (or equivalent).

the advantage there is that the list of tests run follows the branch, rather than using the same list across all builds. using the same run.sh for all branches means that we'll have to have special cases.

@ixdy
Copy link
Member

ixdy commented Oct 27, 2015

I guess my uneasiness with having gotest.sh vs. gotest-pr.sh is that we have yet another place where the list of tests to run is specified, with a high probability that things will drift out of sync.

Eventually we should probably just make kubernetes-test-go use the containerized version. Then we can retire gotest.sh or whatever. (I guess gotest-dockerized.sh is a better name than gotest-pr.sh, in that case?)

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 27, 2015

Please hold off reviewing further, I'm going to see if I can tweak this to make it run on branches with minimal cherrypicking.

@j3ffml j3ffml force-pushed the fix-jenkins-test-image branch from c114b9d to de913a4 Compare October 27, 2015 18:24
@k8s-github-robot
Copy link

Labelling this PR as size/M

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 27, 2015
@k8s-bot
Copy link

k8s-bot commented Oct 27, 2015

GCE e2e build/test failed for commit de913a4a24ef89d71fcd7b111bcf8a90b237a2aa.

@j3ffml j3ffml force-pushed the fix-jenkins-test-image branch from de913a4 to 5613277 Compare October 27, 2015 23:57
@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 28, 2015

Ok I think this is in a more reasonable state now, ptal. Should be able to cherrypick this onto 1.0 and 1.1 and just modify hack/jenkins/test-dockerized.sh to work for old script names.

Also cc @nikhiljindal for changes to hack/verify-api-reference-docs.sh

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 28, 2015

@ixdy, I took your idea to rename the test script gotest-dockerized.sh. Once this is in, I'm happy to update kubernetes-test-go to use this version and retire hack/jenkins/gotest.sh

@nikhiljindal
Copy link
Contributor

Changes to update-api-reference-docs LGTM.
Note that that script does not exist in 1.0 or 1.1

cc @caesarxuchao

@k8s-bot
Copy link

k8s-bot commented Oct 28, 2015

GCE e2e test build/test passed for commit 56132779f3b44259a61eb4357a0dbd03c54bb51e.

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 28, 2015

@nikhiljindal, yup, not planning on cherrypicking that script onto release branches; test-dockerized.sh will just call verify-all.sh to run whatever exists on the branch.

# We want to pass absolute dir to update-api-reference-docs.sh, but diff
# against local path to dir. This only matters in the case where this
# test is itself running inside a container (with the host docker mapped in).
REPO_DIR=${REPO_DIR:-"${PWD}/${KUBE_ROOT}"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought ${KUBE_ROOT} will become an absolute path after running source "${KUBE_ROOT}/hack/lib/init.sh", I guess this is not the case if you are running the script inside a container?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, thanks for pointing out. As it was, this was broken when run standalone. Comment was a bit disingenuous, now describes the actual reason for using REPO_DIR if provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

@k8s-bot
Copy link

k8s-bot commented Oct 28, 2015

GCE e2e test build/test passed for commit 176008430220d6604306aa78ad1b1c6a3674a0ff.

@j3ffml j3ffml force-pushed the fix-jenkins-test-image branch from 1760084 to 349d4bb Compare October 28, 2015 18:53
@k8s-bot
Copy link

k8s-bot commented Oct 28, 2015

GCE e2e test build/test passed for commit 349d4bba6e3c7b815084bf4ecf26969c90d5a2ec.

@ixdy
Copy link
Member

ixdy commented Oct 28, 2015

I think the test image needs file after #16160. It's otherwise failing builds, e.g. #16382 (comment)

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 29, 2015

@k8s-bot unit test this

# Use REPO_DIR if provided so we can set it to the host-resolvable path
# to the repo root if we are running this script from a container with
# docker mounted in as a volume.
# We pass the host output dir to update-api-reference-docs.sh, but use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I just want to fully understand what's happening here - HOST_OUTPUT_DIR and TMP_OUTPUT_DIR end up mapping to the same files always, even if the paths are different, all due to docker wonkiness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. They point to the same files, you just need a different absolute path to resolve them on the host vs from inside the test container.

@j3ffml j3ffml force-pushed the fix-jenkins-test-image branch from 49cd8f4 to ea6ec21 Compare October 29, 2015 16:21
@k8s-bot
Copy link

k8s-bot commented Oct 29, 2015

GCE e2e test build/test passed for commit ea6ec21d7e2cf5917126199aadea2b30a7e092ea.

@ixdy
Copy link
Member

ixdy commented Oct 29, 2015

LGTM, but please squash commits.

(A side note: Shippable currently tests 2 versions of Go. Do we want to keep testing 2 versions or only the latest?)

Also add a makefile. This will need a cherrypick onto 1.0,1.1
with edits to hack/jenkins/test-dockerized.sh to run branch-specific
test scripts.

Also had to modify hack/verify-api-reference.sh to handle volume mount
path peculiarity when doing `docker run -v` inside a container started
with `docker run -v`. See associated comment in
hack/jenkins/test-dockerized.sh
@j3ffml j3ffml force-pushed the fix-jenkins-test-image branch from ea6ec21 to 04e891c Compare October 29, 2015 18:08
@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 29, 2015

Squashed.

Regarding testing multiple versions, I think it's fine to just do 1.4 for now. We're in the process of bumping to 1.5 (#13838), so we'll probably care about testing 1.4, 1.5. We can accomplish that by building a second test-image with go 1.5.1 as the base image and modifying gotest-dockerized.sh to run the tests with both images. However I'd like to get this in as is, since it will make it easier to debug/fix the tests that are broken on 1.5.1.

@j3ffml
Copy link
Contributor Author

j3ffml commented Oct 29, 2015

@k8s-bot unit test this

@ixdy
Copy link
Member

ixdy commented Oct 29, 2015

assuming Jenkins passes lgtm

@ixdy ixdy added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2015
@k8s-bot
Copy link

k8s-bot commented Oct 29, 2015

GCE e2e test build/test passed for commit 04e891c.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Oct 29, 2015

GCE e2e test build/test passed for commit 04e891c.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

k8s-github-robot pushed a commit that referenced this pull request Oct 29, 2015
@k8s-github-robot k8s-github-robot merged commit 0d29759 into kubernetes:master Oct 29, 2015
a-robinson added a commit that referenced this pull request Oct 30, 2015
a-robinson added a commit that referenced this pull request Oct 30, 2015
@j3ffml j3ffml deleted the fix-jenkins-test-image branch October 30, 2015 23:03
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
shouhong pushed a commit to shouhong/kubernetes that referenced this pull request Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test-infra lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Containerize verification checks, unit tests, and integration test
9 participants