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

local-up-cluster additions #38713

Merged
merged 1 commit into from
Dec 17, 2016

Conversation

alejandroEsc
Copy link
Contributor

@alejandroEsc alejandroEsc commented Dec 13, 2016

What this PR does / why we need it:
Changes to local-cluster-up: These include: 1) a simple additional help option. 2) additional error message to not being able to run docker ps. 3) fail faster when etcd is not found in path. Hopefully these make developing a bit more pleasant.

Release note:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 13, 2016
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Dec 13, 2016
@@ -681,6 +716,9 @@ EOF
fi
}

# let's check that etcd is in path before moving on
Copy link
Member

Choose a reason for hiding this comment

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

kube::etcd::start basically does this check, and also verifies that it's the correct version. do we need to duplicate this check?

Copy link
Member

Choose a reason for hiding this comment

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

alternately, factor out the test logic from kube::etcd::start and call it explicitly here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like that idea, my only concern was starting etcd too early in the process while i just wanted to ensure that the process even existed, additionally that would sort of break the nice logic starting in line 748 where services are all started together.

Would you be ok with me instead refactoring the logic found in kube::etcd::start so that a new function is created kube::etcd::validate that is called in start, so that the validation check is at least in one place?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, making a separate kube::etcd::validate sounds good to me. (might want to have kube::etcd::start call it to maintain existing behavior.)

echo "Failed to successfully run 'docker ps', please verify that docker is installed and \$DOCKER_HOST is set correctly."
echo
cat <<'EOF' >&2
Failed to successfully run 'docker ps', please verify that docker is installed and \$DOCKER_HOST is set correctly.
Copy link
Member

Choose a reason for hiding this comment

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

it looks like you took this from kube::build::ensure_docker_daemon_connectivity in build-tools/common.sh.

I wonder if it might make more sense to refactor that function into hack/lib/util.sh, and then call that from both build-tools/common.sh and here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will double check that the logic is the same, if so would you have no problem with me doing this? If not would this still be ok?

Copy link
Member

Choose a reason for hiding this comment

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

they look pretty similar; it appears that the main difference is that ensure_docker_daemon_connectivity is using docker info, whereas this uses docker ps, but I think the effect is basically the same: if docker is installed and working, both should succeed; if docker isn't working, both will fail.

@alejandroEsc
Copy link
Contributor Author

@ixdy changes made, looks great, thanks again for reviewing so promptly!

test_docker
# source to get common docker test
#source "${KUBE_ROOT}/build-tools/common.sh"
${KUBE_ROOT}/build-tools/common.sh kube::build::ensure_docker_daemon_connectivity
Copy link
Member

Choose a reason for hiding this comment

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

a few notes:

  1. this is now build/ instead of build-tools/.
  2. does this actually work as-written? (rather than sourcing common.sh)
  3. I'd also be fine with having this function moved into hack/lib/common.sh. I think both build/common.sh and this script (hack/local-up-cluster.sh) include hack/lib/.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. yeah saw that happened recently
  2. yep it works, it's how you call a function when you don't want to source it, tried pulling from source but it got complicated because of the environment variables called in that common.sh script.
  3. I am guessing you mean /hack/lib/init.sh? if so yeah they both source this file and would be a good place assuming that the function can cleanly be moved. Ill try it out.

@alejandroEsc alejandroEsc force-pushed the ae/localup1 branch 2 times, most recently from 9340ded to ba5b081 Compare December 16, 2016 06:43
@alejandroEsc
Copy link
Contributor Author

@ixdy done: made changes and was able to refactor out common code.

Copy link
Member

@ixdy ixdy left a comment

Choose a reason for hiding this comment

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

sorry for so much back-and-forth. it's almost there.

@@ -156,3 +156,28 @@ kube::realpath() {
fi
kube::readlinkdashf "$1"
}

function kube::build::ensure_docker_daemon_connectivity {
Copy link
Member

Choose a reason for hiding this comment

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

please put this in hack/lib/util.sh instead; hack/lib/init.sh loads the other scripts in hack/lib, but shouldn't contain any other functionality itself.

also s/build/util/ in the name, to match the rest of the functions in hack/lib/util.sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yikes, you are correct, should have double checked the init.sh and what it sources out.

…why docker ps fails and how to recover, added test to check if etcd is in your path to fail fast when not found.

from etcd.sh split the start process into validate fucntion + start function so that the validate piece can be reused elsewhere. the up-cluster script has been changed to remove duplicate docker logic to the one used in buid-tools/common.sh and the validate etcd function is now used here.

moved docker daemon check function to util.sh and made function name changes and upstream changes.
@alejandroEsc
Copy link
Contributor Author

@ixdy made changes you requested. Thanks!

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE etcd3 e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot gce etcd3 e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins verification failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GKE smoke e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins CRI GCE Node e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history.

The magic incantation to run this job again is @k8s-bot cri node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@ixdy
Copy link
Member

ixdy commented Dec 16, 2016

/lgtm

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2016
@alejandroEsc
Copy link
Contributor Author

alejandroEsc commented Dec 16, 2016

@ixdy all checks passed, ready for you to merge, thanks again!

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 37468, 36546, 38713, 38902, 38614)

@k8s-github-robot k8s-github-robot merged commit 9a1c607 into kubernetes:master Dec 17, 2016
@alejandroEsc alejandroEsc deleted the ae/localup1 branch December 19, 2016 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

None yet

5 participants