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

Binary update #250

Merged
merged 21 commits into from
Aug 31, 2023
Merged

Binary update #250

merged 21 commits into from
Aug 31, 2023

Conversation

sameagen-MW
Copy link
Member

Updated plugin to use the run-matlab-command binary and added support for passing startup options through to MATLAB to maintain parity with cloud CI/CD platforms.

I ended up adding startupOptions as an additional argument on getProcessToRunMatlabCommand because I preferred the mental model of handling them separately, but I also think that the options could be baked into the command as well if others prefer that implementation.

Besides the small tweaks to support startup options, the primary change here is the artifacts that the pom downloads, and then some of the logic within MatlabBuild. Since there's now three option instead of two, I used a call to uname to differentiate between MacOS and Linux.

<f:entry field="startupOptions" title="Startup Options: ">
Copy link
Member

Choose a reason for hiding this comment

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

"Startup Options" or "MATLAB Startup Options"?

Copy link
Member

Choose a reason for hiding this comment

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

Same question for anywhere else in this submission. I can see both "MATLAB Startup Options" and "Startup Options".

@@ -0,0 +1,3 @@
<div>
A space-separated list of MATLAB Startup Options.
Copy link
Member

Choose a reason for hiding this comment

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

Startup Options -> startup options

@@ -0,0 +1,3 @@
<div>
A space-separated list of MATLAB Startup Options.
Copy link
Member

Choose a reason for hiding this comment

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

s o

@@ -0,0 +1,3 @@
<div>
A space-separated list of MATLAB Startup Options.
Copy link
Member

Choose a reason for hiding this comment

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

s o

@@ -0,0 +1,3 @@
<div>
A space-separated list of MATLAB Startup Options.
Copy link
Member

Choose a reason for hiding this comment

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

s o

<f:entry field="startupOptions" title="Startup Options: ">
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why we use a colon in only a subset of titles. I can see both title="Startup Options: " and title="Startup Options".

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I think that this was a mistake on my part. All of the builders use "Startup Options," and I tried to stick with the precedent in each of the files. For the *Steps, I thought I was going off of the precedent of "RunMatlabTestsStep" but I think I misrembered and changed "startupOptions: " into "Startup Options:". I'll get that fixed.

@sameagen-MW
Copy link
Member Author

UI Updates

image image

@mw-hrastega
Copy link
Member

UI Updates

image image

Thank you Sam for including screenshots:

  1. The check box labels elsewhere do not use title case. For example, see the labels in the Run MATLAB Tests UI: https://github.com/mathworks/jenkins-matlab-plugin/blob/master/CONFIGDOC.md#run-matlab-tests. Shouldn't Startup Options become Startup options then?

  2. Is it possible to use a three-word heading (because the other headings are two or three words?) You can actually use this title: https://www.mathworks.com/help/matlab/matlab_env/startup-options.html. Then, you can change the check box label to "MATLAB startup options".

  3. You are proposing a section that will have only one check box. The other sections have more than one check box. And "Source folder" doesn't belong to a section. Do you think "Startup options" should be treated like "Source folder" and placed after Source folder, or will this make the step UI inconsistent with the other two step UIs?

@sameagen-MW
Copy link
Member Author

I don't know why but I can't respond direclty to your comment Houman. Those changes seem reasonable to me though

@sameagen-MW
Copy link
Member Author

Updated

image image

Copy link
Member

@nbhoski nbhoski left a comment

Choose a reason for hiding this comment

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

I am not sure what exactly the startup options affect the workflow and should we include it. since we have included it it also then requires Doc update with examples. @mw-hrastega do you agree?

src/main/java/com/mathworks/ci/MatlabBuild.java Outdated Show resolved Hide resolved
// Copy runner.bat for Windows platform in workspace.
copyFileInWorkspace(MatlabBuilderConstants.BAT_RUNNER_SCRIPT, runnerScriptName,
copyFileInWorkspace("win64\\run-matlab-command.exe", runnerName,
Copy link
Member

Choose a reason for hiding this comment

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

I personally prefer static strings to be part of either properties or Constants just in cas they are changed in future, Its more manageable that way

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I think that this is a good suggestion. The part that makes me hesitate here is that we're already having to hardcode in the program name on lines 54, 57, and 69. I don't really like keeping that information in two separate places, since it means if the program name were to change it would be easy for a user to just change the constant name and miss the fact that there are also hardcoded instances.

I don't have a strong preference either way, it just feels a little bit odd to me to have a property in another file define one instance and a hardcoded string define another. There's also a slight readability sacrifice when future contributors have to cross reference between the file they're working on and the constants file but that's not a real issue in the long run.

Also I realize I left a line of code commented out, I'll update the pull request to remove that (and also probably condense lines 54 and 57 to be one line after the if block).

What are your thoughts @davidbuzinski?

Copy link
Member

@davidbuzinski davidbuzinski Aug 30, 2023

Choose a reason for hiding this comment

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

I don't have a strong opinion unless it's being used all over the code. I think it's basically just in 1 or 2 places right? I'm fine either way

Copy link
Member Author

@sameagen-MW sameagen-MW Aug 30, 2023

Choose a reason for hiding this comment

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

Yeah, iirc that's the only place that specific property is used

src/main/java/com/mathworks/ci/RunMatlabTestsBuilder.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/RunMatlabBuildBuilder.java Outdated Show resolved Hide resolved
@sameagen-MW
Copy link
Member Author

I am not sure what exactly the startup options affect the workflow and should we include it. since we have included it it also then requires Doc update with examples. @mw-hrastega do you agree?

Just to double check that I understand what you mean, you would have a preference for only updating the Jenkins plugin to use run-matlab-command and not adding support for passing startup options through to MATLAB?

@nbhoski
Copy link
Member

nbhoski commented Aug 30, 2023

Hi @sameagen-MW coud you just confirm if we consider all CR as resolved ? I got confused seeing few unresolved comments

@sameagen-MW
Copy link
Member Author

Hi @sameagen-MW coud you just confirm if we consider all CR as resolved ? I got confused seeing few unresolved comments

Yeah totally, I've gone and resolved all of the conversations that I think are totally finished.


String binaryName;
String runnerName = uniqueName + "/run-matlab-command";
if (kernelStream.toString("UTF-8").contains("Linux")) {
Copy link
Member

Choose a reason for hiding this comment

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

This is probably fine, but I'm more used to special casing to mac and defaulting to Linux rather than visa versa. Not a huge deal though

Copy link
Member

@nbhoski nbhoski left a comment

Choose a reason for hiding this comment

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

Ship it!

@sameagen-MW sameagen-MW merged commit a24d134 into dev_main Aug 31, 2023
4 checks passed
@sameagen-MW sameagen-MW deleted the BinaryUpdate branch August 31, 2023 15:02
@sameagen-MW sameagen-MW linked an issue Jun 27, 2024 that may be closed by this pull request
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.

Allow MATLAB to run with other critical startup options
5 participants