Virtualbox executor: Execution context in Win7 VM
I have a very specific "Issue" using the virtualbox executor. I am intending to build a LabVIEW application via CI. In the past I used a Windows shell executor to execute the build which was working fine.
Currently I am trying to move the CI build from my development machine onto a build-server.
New Setup
- Repo on gitlab.com
- build-server running Ubuntu 16.04.1, gitlab-ci-multi-runner 1.6, VirtualBox version 5.1.6
- Windows 7 VM
- cygwin sshd and git
- NI LabVIEW 2012 SP1 Professional Development System
- LabVIEW-CLI to overcome LabVIEWs lack of a commandline interface
The build script in .gitlab-ci.yml is
- git clone --depth=1 -b master $BUILDER_REPO ./builder
- labview-cli -v --timeout 20000 $(cygpath -aw builder/builder.vi) -- $(cygpath -aw ZLS-Server/ZLS-Server_APP-PC/ZLS-Server_APP-PC.lvproj)
The first line clones a repo containing some LabVIEW VIs which actually execute the build process.
The second line starts the labview-cli and passes some arguments to it. What the labview-cli then does is looking for the LabVIEW.exe, running it while passing the builder.vi as "startup vi", and then waiting for the LabVIEW application to connect back to the CLI via a TCP port. (This is the workaround for having the VI output stuff on the commandline, because LabVIEW does not support this on its own)
Issue
I managed to get everything working (including the licensing issue mentioned in #1739 (closed) ), but LabVIEW does not start up properly and instead hangs around doing nothing. From the memory-usage (~10 MB) I reckon that it is failing very early during startup, since at the stage where the regular startup screen shows it already consumes ~50 MB of memory.
This only happens when I run the build via the gitlab runner. If I try to imitate the whole process (restore snapshot, start vm, connect via ssh) and then run the commands, everything works as expected.
I printed out both environments using printenv. The first thing I noticed was that the runner-environment has SHLVL=2, while the regular ssh environment has SHLVL=1. But if I move one level deeper in the ssh connection, everything still works.
The runner-environment of course has all the CI variables set which are missing in the regular ssh environment, but they also exist in a windows shell runner environment.
The runner-environment misses the following vars: TERM, SSH_TTY, PS1 and EXECIGNORE. Manually setting them did not solve the problem.
Can anybody help me? Where is the difference between running the script via runner and via ssh?