From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Continuous Integration

cancel
Showing results for 
Search instead for 
Did you mean: 

General Discussion/Questions about LabVIEW/Jenkins with the Batch File Build Process

This thread can be for general thoughts/questions about the batch file build process I discuss in my presentation here and the getting started guide here.

Message 1 of 38
(16,283 Views)

Hey thilprakash,

The error you're seeing here is because it's expecting an "http://...." address to your SVN repo. If you'd like Jenkins to pull from a local directory on your computer, the easier way to do it (in my experience at least, there could be a better way) would be as follows:

1. Set the SCM to None instead of SVN.

2. Set your workspace path (via Manage Jenkins >> Configure System, then under "Home Directory" click advanced and change the workspace root directory) to be "E:\SENTHIL\Projects\${ITEM_FULL_NAME}" (Where item full name is a query within jenkins, not something you fill in, i.e. you'd copy over that path directly into the jenkins workspace path).

3. Make sure your Jenkins project name is "Test Auto Build" to match the name of the folder you're pointing to at "E:\SENTHIL\Projects\Test Auto Build" (since it'll append the project name based on the "Item_Full_Name query string we used above).

Then when you build the project it'll look in that local folder for the files to be built.

0 Kudos
Message 2 of 38
(12,170 Views)

Hi Ryan,

thanks a lot for the efforts in the presentation & the getting started.

I tried to run builds as described, but I have some trouble:

SCM checkouts work perfectly, but I receive frequent error in the LabVIEWbuild.bat

Every other try, LabVIEW does not launch (I removed the -unattended option for debugging). If it launches, it'll abort almost immediately.

It's a bit unreliable on my machine.

Do you have any ideas? So far, I'm using only Version 2013

Cheers

Oli

0 Kudos
Message 3 of 38
(12,170 Views)

Hey Oli,

First, glad you found the presentation and guide useful, that's great to hear

As for the issue you're hitting, I haven't seen that before. But, it's possible there's something I'm setting that I forgot to put in the guide. To investigate further, a couple questions:

1. Can you attach the output of the Jenkins console for a successful and failed build?

2. Whenever the build.bat process (or its sub-processes) encounter an error they should get logged to a file in the c:\autobuild directory. Likely named something like: "CI_0_Error2013.txt" if it's running on executor 0 for your 2013 version.

3. Since you're only running for 2013, do you see any difference in behavior if you command the batch file to only build in 2013 instead of letting it auto-determine the version? You would change your call in Jenkins to be something along the lines of "C:\Autobuild\build.bat 2013" (remember, the batch file is parameterized and specific build version is the first input). This might narrow down if there's a version decision problem occuring, in which case can you also attach your version of build.bat? (I assume you've changed it for your versions of LabVIEW).

4. Are you running more than one build at a time? If so, we're probable encountering an instancing problem. Try adding the ini token "allowmultipleinstances=True" to the LabVIEW.ini file in your "<Program Files>\National Instruments\LabVIEW 2013" directory. I recently realized I left that out of the getting started guide and you'll need it if you want to run multiple builds (see here for more info).

This should give me a better glimpse into what's happening. --Ryan

0 Kudos
Message 4 of 38
(12,170 Views)

Hi Ryan,

thanks for the suggestions

I think, my problem is even more basic: I have scrapped my modified LabVIEWBuld.bat and switched back to the original from github.

IMHO, LabVIEW does not start up at all! The console shows shows the execution of the START command (no error) and the waiting loop keeps running. But no LabVIEW process can be seen in the task manager with or without the unattended option.

Please find the screenshots attached.The error file you've mentioned is empty.

Build_Log_StartLV.png

Build_Log_no_unattended.png

Using LabVIEW version on Autobuild.Bat call makes no difference.

So far I haven't tried any parallel builds, since I wanted to take steps one by one.

Addtional information: I copied the parameterized START command from Jenkins' command line display to paste and execute directly from command line: it runs out, LabVIEW starts!

Is there possibly an access permission issue with the start command of the batch?

0 Kudos
Message 5 of 38
(12,170 Views)

After some more research .... it's getting weirder

if I start the Build.bat from the command line, LabVIEW starts up with the correct VIs.

This kinda confirmed the access rights issue to me, so I started to check the Jenkins Service settings.

I enabled an option called "Enable data transfer between service & desktop" (direct translation from German). When I tried again, a dialog window appeared stating, that the service has issued a notification. It turns out, that LabVIEW is showing the License Server dialogue stating my local license has run out. That's probably the reason why LabVIEW seems not to be starting.

But I'm running on a license from our volume license server.

IMHO, Jenkins is running in a different user context that doesn't allow the usage of my volume license...

0 Kudos
Message 6 of 38
(12,170 Views)

Hey Oli,

Kudos on the investigation, the console does seem to confirm that LabVIEW is being launched but is never fully initializing; which would make sense if the licensing pop-up is stopping LabVIEW from fully launching. A couple thoughts:

1. When you saw the pop-up, was there an option to continue? I.E. did it default to some temp license or not let you launch LabVIEW at all? If it's defaulting to a temp license I think I remember there being a command line command we could add to build.bat to automatically accept that.

2. A disconnected license file might be an option, although that would be up to you and your VLA admin.

3. If you simplify this to having a batch file that just launches LabVIEW, does that run successfully in Jenkins? Maybe there's something else in the current build.bat that's affecting the launch.

Overall, since this appears to have to do with LabVIEW properly getting a license when launched from the Jenkins context I would recommend contacting your local support and talking to the licensing team.

See if they have ideas about how to make sure a valid license is obtained. Maybe there's something we can edit from the command line calls (the simple test, #3, would be good to try stuff with), or maybe we need to assign the jenkins process to a certain user. It's been a while since I've dealt with licensing servers so I'm just spitballing. But they should be able to give you some ideas on ways to make sure Jenkins is able to launch LabVIEW from a batch call.

Keep me updated and I'll try to help where possible. --Ryan

0 Kudos
Message 7 of 38
(12,170 Views)

Hey Ryan,

to answer yout questions

1.) There is a possiblity to continue if evaluation time is left. Which is not on my PC 😉 In fact, it didn't let me launch LV

2.) I've tried the disconnected license this morning: it also does not seem to work also. I suspect that there is a difference between the user name on the license server (or in the disconncted file) and the one I can assign the Jenkins service to:

WHOAMI on the commandline gives me

myorg\john.doe

whereas the user name for the service must be

john.doe@local.myorg.com

So maybe a computer based license could solve the issue. But there is none available at my company.

3.) Have tried this also: LabVIEW doesn't start, even if the batch only calls the .exe without parameters

I have started a request in the Volume License Forum, if there is a possibility to start LabVIEW with a parameter specifing a user. In parallel, I'll try what our local support here can do

Cheers

Oli

0 Kudos
Message 8 of 38
(12,170 Views)

Hey Oli,

Sounds like you've identified the problem, hopefully support can give you some ideas on getting the license to be accepted. You might also search around the jenkins forums to see if there's a way to assign the jenkins process to the user account you need.

--Ryan

0 Kudos
Message 9 of 38
(12,168 Views)

Hi Ryan,

after talking to my IT guys, Jenkins and LabVIEW are up and running

What I had to learn is that there is (at least officially) no way to start LabVIEW with a given user name. It always uses the windows user to contact the license sever.

Thanks a lot for your help

Oli

0 Kudos
Message 10 of 38
(12,168 Views)