Author Topic: OSX not passing Environment Variables...  (Read 9537 times)

mpursley

  • Full Member
  • ***
  • Posts: 15
OSX not passing Environment Variables...
« on: June 04, 2008, 04:21:00 AM »
Hey All,

I have some envvars that I need to have the qubeproxy user run before starting render jobs.  I found the "export_environment" option in the manual, and that seems to work for the LinuxMachines... but on the Mac I'm still not getting all the EnvVars that I need...

For example, in the below 4 env commands you can see that the projects directory var, $KS_PROJECTS which is defined in my .profile,  exists in the LinuxBoxes env (local and via qube job)...   But, on the Mac $KS_PROJECTS only exists with the local login... and not from the qube command-line job...


Anyone have any ideas why that would be?


Thanks,
Matt


Code: [Select]




##########################################################
### Render01.local env via Qube "Command-line Job" ###################
----------------------------------
-     Worker 7112.0
----------------------------------
[Jun 3, 2008 18:42:30] render01.local : job type version:
loading command line executor.
job id: 7112
COMMAND: env
HOSTNAME=render01.local
TERM=xterm-color
SHELL=/bin/bash
QBPGRPID=7112
HISTSIZE=1000
USER=qubeproxy
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
QB_DIR=/usr/local/pfx/qube/
MENTALRAY_PATH=/usr/autodesk/mi356/bin:/usr/autodesk/mi3561/bin
QB_SUPERVISOR=10.0.0.145
KS_PROJECTS=/Volumes/VFX/Projects
PATH=/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/pfx/qube/bin:/usr/local/pfx/qube/sbin:/usr/autodesk/mi356/bin:/usr/autodesk/mi3561/bin:/home/qubeproxy/bin
MAIL=/var/spool/mail/qubeproxy
QBSUBID=0
PWD=/
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
QBDIR=/usr/local/pfx/qube
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SPM_HOST=10.0.0.122
QBJOBID=7112
HOME=/home/qubeproxy
SHLVL=2
QB_DOMAIN=
LOGNAME=qubeproxy
CVS_RSH=ssh
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
INFO: execution successful.
[Jun 3, 2008 18:42:31] render01.local : dso complete
##################################


### Render01 env via local bash ###########################
[root@render01 bin]# su - qubeproxy
[qubeproxy@render01 ~]$ env
HOSTNAME=render01.local
SHELL=/bin/bash
TERM=xterm-color
HISTSIZE=1000
USER=qubeproxy
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MENTALRAY_PATH=/usr/autodesk/mi356/bin:/usr/autodesk/mi3561/bin
KS_PROJECTS=/Volumes/VFX/Projects
MAIL=/var/spool/mail/qubeproxy
PATH=/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/pfx/qube/bin:/usr/local/pfx/qube/sbin:/usr/autodesk/mi356/bin:/usr/autodesk/mi3561/bin:/home/qubeproxy/bin
INPUTRC=/etc/inputrc
PWD=/home/qubeproxy
LANG=en_US.UTF-8
QBDIR=/usr/local/pfx/qube
SPM_HOST=10.0.0.122
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/home/qubeproxy
LOGNAME=qubeproxy
CVS_RSH=ssh
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
#############################################
#############################################



######################################################
###  Mac Qube "Command-line Job" ##################################
----------------------------------
-     Worker 7117.0
----------------------------------
[Jun 3, 2008 18:51:27] vfx06.local : job type version:
loading command line executor.
job id: 7117
COMMAND: env
SHELL=/bin/bash
QBPGRPID=7117
TMPDIR=/var/folders/8w/8wCwZTsrGiC2maXsJ1-46++++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-n4qNNo/Render
RESOURCEPATH=/Applications/pfx/qube/qube.app/Contents/Resources
USER=vfx06
COMMAND_MODE=legacy
SSH_AUTH_SOCK=/tmp/launch-2QxpOW/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
QB_DIR=/Applications/pfx/qube/
QB_SUPERVISOR=10.0.0.145
PATH=/usr/bin:/bin:/usr/sbin:/sbin
QBSUBID=0
PWD=/Applications/pfx/qube/qube.app/Contents/Resources
PYTHONHOME=/Applications/pfx/qube/qube.app/Contents/Resources
SHLVL=1
QBJOBID=7117
HOME=/Users/vfx06
QB_DOMAIN=
PYTHONPATH=/Applications/pfx/qube/qube.app/Contents/Resources
LOGNAME=vfx06
ARGVZERO=/Applications/pfx/qube/qube.app/Contents/MacOS/qube
EXECUTABLEPATH=/Applications/pfx/qube/qube.app/Contents/MacOS/qube
DISPLAY=/tmp/launch-QKACUb/:0
SECURITYSESSIONID=89ca70
_=/usr/bin/env
INFO: execution successful.
[Jun 3, 2008 18:51:27] vfx06.local : dylib complete
[Jun 3, 2008 18:51:27] vfx06.local : received confirmation from worker.
######################################################



### Mac env local bash ################################################################
vfx06:~ vfx06$ env
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/8w/8wCwZTsrGiC2maXsJ1-46++++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-n4qNNo/Render
TERM_PROGRAM_VERSION=240
MAYA_SCRIPT_PATH=:/Volumes/VFX/Projects/Space_Buddies/Assets/Tools/Scripts:/Volumes/VFX/Projects/Space_Buddies/Assets/Tools/Scripts
USER=vfx06
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-2QxpOW/Listeners
MAYA_PLUG_IN_PATH=/Applications/Autodesk/maya2008/Maya.app/Contents/Maya.app/Contents/MacOS/plug-ins/
__CF_USER_TEXT_ENCODING=0x1F5:0:0
ENVTEST=yes
NR_ICON_PATH=/Volumes/VFX/Projects/Space_Buddies/Assets/Tools/shake_macros/icons
KS_PROJECTS=/Volumes/VFX/Projects
MAYA_PYTHON_PATH=/Applications/Autodesk/maya2008/Maya.app/Contents/Maya.app/Contents/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages:/Applications/Autodesk/maya2008/Maya.app/Contents/Maya.app/Contents/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/maya:/Users/vfx01/Documents/eclipse/mayaDev
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Applications/QuickTime
Player.app/Contents/MacOS:/Applications/Shake/shake.app/Contents/MacOS:/Applications/pfx/qube/bin:/Applications/Autodesk/maya2008/Maya.app/Contents/bin:/Applications/Autodesk/maya2008/Maya.app/Contents/bin:/Users/vfx06/bin:/Applications/QuickTime
Player.app/Contents/MacOS:/Applications/Shake/shake.app/Contents/MacOS:/Applications/pfx/qube/bin:/Applications/Autodesk/maya2008/Maya.app/Contents/bin:/Applications/Autodesk/maya2008/Maya.app/Contents/bin:/Users/vfx06/bin
PWD=/Users/vfx06
LANG=en_CA.UTF-8
MAYA_LOCATION=/Applications/Autodesk/maya2008/Maya.app/Contents
KS_PROJECTS_LOCAL=/Users/vfx06/Projects
SHLVL=1
HOME=/Users/vfx06
PYTHONPATH=/Applications/Autodesk/maya2008/Maya.app/Contents/Maya.app/Contents/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages:/Applications/Autodesk/maya2008/Maya.app/Contents/Maya.app/Contents/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/maya
LOGNAME=vfx06
NR_INCLUDE_PATH=/Volumes/VFX/Projects/Space_Buddies/Assets/Tools/shake_macros/include
DISPLAY=/tmp/launch-QKACUb/:0
SECURITYSESSIONID=89ca70
_=/usr/bin/env
######################
« Last Edit: June 04, 2008, 04:23:06 AM by mpursley »

eric

  • Hero Member
  • *****
  • Posts: 229
Re: OSX not passing Environment Variables...
« Reply #1 on: June 04, 2008, 06:48:21 AM »
I would have a look at the job's .xja file to see whether the environment variable is properly encoded in the job. Look for an XML entry called "env."

If it's in there, the problem may be in the OS X Worker. If it's not in there, the problem may be with the submission API.

mpursley

  • Full Member
  • ***
  • Posts: 15
Re: OSX not passing Environment Variables...
« Reply #2 on: June 04, 2008, 07:26:58 AM »
Ok, no problem.  I'll email you the job's .xja file tomorrow morning...


Thanks Eric,
Matt

mpursley

  • Full Member
  • ***
  • Posts: 15
Re: OSX not passing Environment Variables...
« Reply #3 on: June 04, 2008, 07:05:39 PM »
Hey Eric,

Here's 2 job logs.  7128 is for the working LinuxBox.  And 7129 is from the not working Mac...


Thanks,
Matt



[attachment deleted by admin]

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: OSX not passing Environment Variables...
« Reply #4 on: June 04, 2008, 11:47:41 PM »
Thank you for your assistance.  It looks like you have identified a bug on the OSX Worker.  We are opening a bug report to address the issue.

Steps to Reproduce (if submitting from a bash shell on OSX or Linux):
Code: [Select]
export AAAA=123
qbsub --flags export_environment set

Results:
  • The results from the stdout if run on a Linux worker will succeed to show the AAAA environment variable.
  • If run on an OSX Worker, it will not show up.

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: OSX not passing Environment Variables...
« Reply #5 on: June 04, 2008, 11:59:28 PM »
Workaround:
As a workaround, you can set the environment variable directly before running the main command.  For example, submit the following command for a cmdline job:
Code: [Select]
export AAA=123 && set
From the commandline submit from a bash shell, this would look like:
Code: [Select]
qbsub "export AAA=123 && set"   

mpursley

  • Full Member
  • ***
  • Posts: 15
Re: OSX not passing Environment Variables...
« Reply #6 on: June 05, 2008, 12:24:01 AM »
Thank you for your assistance.  It looks like you have identified a bug on the OSX Worker.  We are opening a bug report to address the issue.

Steps to Reproduce (if submitting from a bash shell on OSX or Linux):
Code: [Select]
export AAAA=123
qbsub --flags export_environment set

Results:
  • The results from the stdout if run on a Linux worker will succeed to show the AAAA environment variable.
  • If run on an OSX Worker, it will not show up.



Yes, that's a good idea.... I was using the "submit command-line" option from the qube gui... But, the qbsub command might yield different results. 

I'll try that now and let you know...


Thanks,
Matt

mpursley

  • Full Member
  • ***
  • Posts: 15
Re: OSX not passing Environment Variables...
« Reply #7 on: June 05, 2008, 02:22:01 AM »
Ok, I think I see what's going on here. When I use this...
$ qbsub -group mac --flags export_environment set"
... the "export_environment" flag tells qbsub to send the current envvars along with the Job Submission.  So, vars I have setup in my .profile or /etc/bashrc go along with the job...

And, jobs that I submit with the Qube GUI can do the same thing... But, when I run the QubeGUI by double-clicking on the Application... my environment vars (.profile and /etc/bashrc) are not sourced... So they are not passed along.


Hmmm, interesting...  Well, the good news is that if I start the QubeGUI from a Terminal, or with a .command script... eg...
-- qube.command ---------
#!/bin/bash
open /Applications/pfx/qube/qube.app
-----------------------------
...then I do get my env vars... and "export_environment" will pass them along with the jobs... 


So, I can replace my icon in the dock with a .command script and always run the QubeGui from that.  Then, it will have my .profile sourced before lanuching and can pass those vars onto submitted jobs...   

Unless anyone else has a better idea?


Thanks,
Matt
« Last Edit: June 05, 2008, 02:28:11 AM by mpursley »

dball

  • Full Member
  • ***
  • Posts: 13
Re: OSX not passing Environment Variables...
« Reply #8 on: June 05, 2009, 12:45:42 PM »
Has this bug been fixed in version 5.3 of Qube!?