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

Make it easy to use the e2e tests to test upgrading a running master #2829

Merged
merged 1 commit into from Dec 16, 2014

Conversation

a-robinson
Copy link
Contributor

by adding support for testing official release versions and writing a simple script to first bring up and test the old version before upgrading it and testing it again. Related to supporting in-place upgrades of masters (#2524).

The downsides of this are that by default it uses the e2e tests from HEAD, which may not be expected to pass on an old cluster, and that it uses the client binaries from head. I can send a follow-up to fix the client binaries issue, but don't have anything planned for supporting old e2e tests.

I'm not sure how our Jenkins setup is configured, but it'd be nice to get something along these lines added to it in the future.

remoteSaltTar := fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/v%s/kubernetes-salt.tar.gz", version)
localServerTar := path.Join(*root, downloadDirName, version, serverTarName)
localSaltTar := path.Join(*root, downloadDirName, version, saltTarName)
runBash("makeDownloadsDir", fmt.Sprintf("mkdir -p %s", path.Join(*root, downloadDirName, version)))
Copy link
Member

Choose a reason for hiding this comment

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

Please use os.MkdirAll

@lavalamp
Copy link
Member

Also need to think about the kubecfg client & build of cmd/e2e/e2e.go that will be used. Will want to be able to specify that they come from the old version or new version...

Maybe we have to make a simple config file with a table of desired test configuration. Might be too complex for reasonable command line flags.

@a-robinson
Copy link
Contributor Author

Please take another look, I've fixed things such that we can use the correct client tool version and we don't need to awkwardly move directories around anymore. It still uses the most recent version of cmd/e2e/e2e.go, but as far as I know that doesn't get packaged up with the releases.

@@ -152,7 +175,45 @@ func IsUp() bool {
}

func tryUp() bool {
return runBash("up", path.Join(*root, "/cluster/kube-up.sh; test-setup;"))
return runBash("up", path.Join(*clientToolsRoot, "/cluster/kube-up.sh; test-setup;"))
Copy link
Member

Choose a reason for hiding this comment

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

kube-up, kube-push, and kube-down should correspond to the cluster version, not the client version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I may not have named the variable well. I've changed clientToolsRoot to be versionRoot to make it more clear.

@a-robinson
Copy link
Contributor Author

Ping?

versionRoot = newVersionRoot
}
}
log.Fatal("stopping")
Copy link
Member

Choose a reason for hiding this comment

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

debugging statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, that's not in my local copy. I hope the next push will remove that.

@lavalamp
Copy link
Member

Sorry to be such a pain about this!

I like everything here except for the bash script that drives it.

What do you think about putting that in a separate PR so that we can argue about if there's a way we could possibly put that functionality into the go code? I think if we commit this bash script, it will quickly grow very hairy and complicated-- I'd like that to at least happen in a real language. :)

@a-robinson
Copy link
Contributor Author

Thanks Daniel! I've responded to your comments, updated the code, removed upgrade-e2e-test.sh from this PR, and rebased it down to one commit.

@lavalamp
Copy link
Member

Seems like the rebase didn't take. Missing fetch? push?


source "` + *root + `/cluster/kube-env.sh"
source "` + *root + `/cluster/${KUBERNETES_PROVIDER}/util.sh"
source "` + versionRoot + `/cluster/${KUBERNETES_PROVIDER}/util.sh"
Copy link
Member

Choose a reason for hiding this comment

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

kube-env & provider/util.sh should probably be sourced from the same directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline, leaving as is because user may have changed kube-env locally.

@a-robinson
Copy link
Contributor Author

My rebase was totally borked. Should be good now.

by adding support for testing official release versions and writing a
simple script to first bring up and test the old version before
upgrading it and testing it again. Related to supporting in-place
upgrades of masters (kubernetes#2524).
@lavalamp
Copy link
Member

I kicked travis.

@lavalamp
Copy link
Member

LGTM

lavalamp added a commit that referenced this pull request Dec 16, 2014
Make it easy to use the e2e tests to test upgrading a running master
@lavalamp lavalamp merged commit 5b15d3a into kubernetes:master Dec 16, 2014
@a-robinson a-robinson deleted the upgrade branch December 19, 2014 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants