Skip to content

Add a --mode=local flag to kubernetes_e2e scenario #2001

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

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

fejta
Copy link
Contributor

@fejta fejta commented Feb 24, 2017

kubernetes_e2e.py --mode=docker # the default runs the scenario via docker run kubekins
kubernetes_e2e.py --mode=local runs the scenario by starting a e2e-runner.sh subprocess.

Also:

  • fix the binary name in bootstrap.py -h
  • Delete unused cp /var/lib/jenkins gce keys (we always run on docker now in jenkins)
  • Delete non bootstrap migration mode (everything uses bootstrap now)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 24, 2017
@fejta
Copy link
Contributor Author

fejta commented Feb 24, 2017

For testing I'll edit the canary job on my local jobs/config.json to add a --mode=local line and then do this:

$GOPATH/src/k8s.io/test-infra/jenkins/bootstrap.py --bare --json --job=ci-kubernetes-e2e-gce-canary --service-account ~/kubekins.json

def start(self):
"""Runs e2e-runner.sh after setting env and installing prereqs."""
env = {}
env.update(self.env_files)
Copy link
Member

Choose a reason for hiding this comment

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

really?! this is like black magic...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

heh, help(dict.update)

Copy link
Member

Choose a reason for hiding this comment

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

Oh... it's parsed above.. nvm.. I was thinking python has a native env-file handler or something..

Copy link
Member

Choose a reason for hiding this comment

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

Like env.update('foo.env') and it will do the magic :-p maybe in the future :-p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well I'm really happy with your strict enforcement of the .env file format, makes it easy to parse here.

@property
def runner(self):
"""Finds the best version of e2e-runner.sh."""
options = ['e2e-runner.sh', test_infra('jenkins/e2e-image/e2e-runner.sh')]
Copy link
Member

Choose a reason for hiding this comment

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

It needs to be /workspace/e2e-runner.sh when running inside e2e image right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

artifacts = '%s/_artifacts' % workspace
if not os.path.isdir(artifacts):
os.makedirs(artifacts)

Copy link
Member

Choose a reason for hiding this comment

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

nit: one less empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@krzyzacy
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2017
self.cmd.extend(['-v', '/var/run/docker.sock:/var/run/docker.sock'])
self.add_environment(
'HOME=/workspace',
'WORKSPACE=/workspace')
Copy link
Member

Choose a reason for hiding this comment

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

wonder if those two would affect local runs, if triggered from prow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I suspect this file will require additional futzing to work on prow.

In this particular instance the image should already set WORKSPACE=/workspace, so it shouldn't matter.

@fejta
Copy link
Contributor Author

fejta commented Feb 24, 2017

I0223 18:11:26.422] Starting ci-kubernetes-e2e-gce-canary-20170224-015655-1e80eef7b01f7529-17896...
I0223 18:11:26.423] process 17929 exited with code 0 after 14.5m
I0223 18:11:26.424] PASS: ci-kubernetes-e2e-gce-canary

@fejta fejta merged commit 585cdaf into kubernetes:master Feb 24, 2017
@fejta fejta deleted the prow branch February 24, 2017 02:12
@fejta
Copy link
Contributor Author

fejta commented Feb 24, 2017

Things look healthy: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gke-updown/9322 (note the fact that -e HOME=/workspace now is earlier in the docker run flag list)

@fejta fejta mentioned this pull request Feb 27, 2017
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants