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

[JENKINS-53500] Windows support for container step #626

Merged
merged 48 commits into from
Oct 30, 2019

Conversation

jglick
Copy link
Member

@jglick jglick commented Oct 22, 2019

JENKINS-53500 and more generally JENKINS-57256.

Subsumes #629.

@jglick

This comment has been minimized.

@slide

This comment has been minimized.

@jglick

This comment has been minimized.

@slide

This comment has been minimized.

@jglick

This comment has been minimized.

@slide

This comment has been minimized.

@jglick

This comment has been minimized.

@slide

This comment has been minimized.

@@ -431,21 +427,22 @@ public void kill(Map<String, String> modelEnvVars) throws IOException, Interrupt

int exitCode = doLaunch(
true, null, null, null, null,
// TODO Windows
Copy link
Member Author

Choose a reason for hiding this comment

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

Have not managed to come up with a PowerShell equivalent. Get-Process and Stop-Process, fine, but how do I select just those processes matching the JENKINS_SERVER_COOKIE? You would think Process.StartInfo would offer this via its Environment or EnvironmentVariables (what is the difference?), but this property is always null in my tests, perhaps because

For example, you should not access the StartInfo property on a Process object returned by GetProcesses.

Copy link
Member Author

@jglick jglick Oct 24, 2019

Choose a reason for hiding this comment

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

Hmm, that seems to be true from an interactive shell, but then from inside the build

Get-Process | Format-Table -DisplayError Id, ProcessName, @{Label="stuff"; Expression={$_.StartInfo.EnvironmentVariables["JENKINS_SERVER_COOKIE"]}}

works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or rather, it prints durable-XXX…but for every process, even for example 0 Idle and 4 System, so either the StartInfo is somehow poisoned by later state, or the set from cmd somehow mutated global state.

There is also the fact that PowershellScript overrides doLaunch when it should be overriding launchWithCookie, so even if we could identify only processes actually started with this JENKINS_SERVER_COOKIE, we would wind up killing the controller process and getting a -1 return code and losing any final output.

So for now I think this is just unfixable.

@jglick jglick marked this pull request as ready for review October 24, 2019 23:16
@jglick
Copy link
Member Author

jglick commented Oct 25, 2019

Build failure seems to be due to yet another general ci.jenkins.io outage.

@jglick jglick requested a review from Vlatombe October 28, 2019 19:21
@@ -376,6 +371,7 @@ public void onClose(int i, String s) {

try {
OutputStream stdin = watch.getInput();
// stdin = new TeeOutputStream(stdin, new LogTaskListener(LOGGER, Level.FINEST).getLogger());
Copy link
Member

Choose a reason for hiding this comment

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

leftover?

@@ -70,6 +70,8 @@ spec:
args:
- -c
- 'sleep infinity'
nodeSelector:
Copy link
Member

Choose a reason for hiding this comment

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

- name: m2repo
persistentVolumeClaim:
claimName: m2repo
nodeSelector:
Copy link
Member

Choose a reason for hiding this comment

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

Same as above?

@Vlatombe Vlatombe merged commit 828f166 into jenkinsci:master Oct 30, 2019
@Vlatombe Vlatombe added the feature New features label Oct 30, 2019
@jglick jglick deleted the windows-JENKINS-53500 branch October 30, 2019 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants