-
Notifications
You must be signed in to change notification settings - Fork 417
Jenkins 60473 #305
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 60473 #305
Conversation
I fixed the absolute path error by enforcing the correct formatting for docker paths, in the WindowsDockerClient. This avoided changing any upstream path variables, so as to not interfere with other usages of the path variables. |
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 don't see a test that shows the problem. Is a test feasible, even if that test cannot be run in the ci.jenkins.io environment?
} | ||
|
||
String command = launcher.isUnix() ? "cat" : "cmd.exe"; | ||
String command = "cat"; |
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 don't understand the motivation for this change. Can you provide more details?
Did you test with a Windows container on a Windows host? I would expect a Windows container on a Windows host to report that cat could not be found
.
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.
Looks like this is attempting to solve an issue in one environment (a Windows agent with Docker Desktop installed and I suppose running Linux containers) while breaking the plugin in other environments (a Windows agent running Windows containers). Does not look safe as written.
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.
Offhand it sounds like this bug might have multiple components—a need for an option to customize the sleep command (here), and some issue with cross-OS file path calculations.
stop(launchEnv, containerId, 1); | ||
} | ||
public void stop(@NonNull EnvVars launchEnv, @NonNull String containerId, @NonNull int stopTime) throws IOException, InterruptedException { | ||
LaunchResult result = launch(launchEnv, false, "docker", "stop", String.format("--time=%s", stopTime), containerId); |
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.
Needs the spotbugs warning resolved, either by checking the value of result or by not assigning to result.
https://issues.jenkins.io/browse/JENKINS-60473 FTR; if you are working on an issue, you can assign to yourself in Jira and mark it In Review. |
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.
This plugin has no effective test coverage on Windows so it is unclear what use cases you would be breaking by touching behavior like this. (And the patch seems to also affect behavior on Linux, in probably unwanted ways.)
My general advice with this plugin is to use it when it is convenient if it works out of the box; but at the first sign of trouble, ignore it and switch to running docker
CLI commands directly, testing your proposed commands directly on an example agent until you find a script that works. Experience has proven that the range of ways people expect Docker to work in builds is too broad for a plugin to comprehensively and reliably handle, and the original idea behind this plugin was ill conceived.
} | ||
|
||
String command = launcher.isUnix() ? "cat" : "cmd.exe"; | ||
String command = "cat"; |
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.
Looks like this is attempting to solve an issue in one environment (a Windows agent with Docker Desktop installed and I suppose running Linux containers) while breaking the plugin in other environments (a Windows agent running Windows containers). Does not look safe as written.
} | ||
public void stop(@NonNull EnvVars launchEnv, @NonNull String containerId, @NonNull int stopTime) throws IOException, InterruptedException { | ||
launch(launchEnv, false, "docker", "stop", String.format("--time=%s", stopTime), containerId); | ||
Thread.sleep((long)stopTime*1100); |
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.
Unclear what this sleep
is for.
Hi @jglick and @MarkEWaite , Thanks, |
Thanks @ThugPigeon653 for your willingness to adopt the plugin and to be involved in Jenkins. Much appreciated! |
Thanks! |
Testing done