-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
For testing I'll edit the canary job on my local jobs/config.json to add a
|
def start(self): | ||
"""Runs e2e-runner.sh after setting env and installing prereqs.""" | ||
env = {} | ||
env.update(self.env_files) |
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.
really?! this is like black magic...
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.
heh, help(dict.update)
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.
Oh... it's parsed above.. nvm.. I was thinking python has a native env-file handler or something..
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.
Like env.update('foo.env') and it will do the magic :-p maybe in the future :-p
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.
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')] |
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 needs to be /workspace/e2e-runner.sh
when running inside e2e image right?
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'm depending on the WORKDIR line: https://github.com/kubernetes/test-infra/blob/master/jenkins/e2e-image/Dockerfile#L68
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.
artifacts = '%s/_artifacts' % workspace | ||
if not os.path.isdir(artifacts): | ||
os.makedirs(artifacts) | ||
|
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.
nit: one less empty line
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.
Done
/lgtm |
self.cmd.extend(['-v', '/var/run/docker.sock:/var/run/docker.sock']) | ||
self.add_environment( | ||
'HOME=/workspace', | ||
'WORKSPACE=/workspace') |
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.
wonder if those two would affect local runs, if triggered from prow.
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, 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.
|
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) |
kubernetes_e2e.py --mode=docker # the default
runs the scenario viadocker run kubekins
kubernetes_e2e.py --mode=local
runs the scenario by starting a e2e-runner.sh subprocess.Also: