-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
local-up-cluster additions #38713
Conversation
@@ -681,6 +716,9 @@ EOF | |||
fi | |||
} | |||
|
|||
# let's check that etcd is in path before moving on |
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.
kube::etcd::start
basically does this check, and also verifies that it's the correct version. do we need to duplicate this check?
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.
alternately, factor out the test logic from kube::etcd::start
and call it explicitly here?
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 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?
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.
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. |
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 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.
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 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?
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 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.
3cf78e0
to
e10aee0
Compare
@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 |
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.
a few notes:
- this is now
build/
instead ofbuild-tools/
. - does this actually work as-written? (rather than sourcing common.sh)
- I'd also be fine with having this function moved into
hack/lib/common.sh
. I think bothbuild/common.sh
and this script (hack/local-up-cluster.sh
) includehack/lib/
.
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.
- yeah saw that happened recently
- 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. - 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.
9340ded
to
ba5b081
Compare
@ixdy done: made changes and was able to refactor out common code. |
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.
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 { |
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.
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
.
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.
yikes, you are correct, should have double checked the init.sh and what it sources out.
ba5b081
to
d6f107f
Compare
…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.
d6f107f
to
7d9c06f
Compare
@ixdy made changes you requested. Thanks! |
Jenkins GCE etcd3 e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins verification failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins GKE smoke e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE Node e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins unit/integration failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins Kubemark GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GKE smoke e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GCE e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
Jenkins CRI GCE Node e2e failed for commit d6f107f9bdff253589ee35824c8a5e18c56be95c. Full PR test history. The magic incantation to run this job again is |
/lgtm thanks! |
@ixdy all checks passed, ready for you to merge, thanks again! |
Automatic merge from submit-queue (batch tested with PRs 37468, 36546, 38713, 38902, 38614) |
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: