Last modified: 2014-08-27 23:16:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67491, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65491 - running job with SGE doesn't get the right environment when using -once -continuous
running job with SGE doesn't get the right environment when using -once -cont...
Status: NEW
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized major
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-19 16:14 UTC by Philippe Elie
Modified: 2014-08-27 23:16 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Philippe Elie 2014-05-19 16:14:19 UTC
When I run a python job using pywikibot it works with a simple jsub but fails to import pywikibot module when doing a jsub -once -continuous

It's a problem of a missing environment variable, PYTHONPATH

tools.phetools@tools-login:~$ cat .profile
. ~/.bashrc
export PYTHONPATH=/shared/pywikipedia/core:/shared/pywikipedia/core/externals/httplib2:/shared/pywikipedia/core/scripts

~/.bashrc contains also the same export

trying a simple

$ jsub -l h_vmem=512M -N test_env /bin/bash -c "env" 

show PYTHONPATH in ~/test_env.out

but 

$ jsub -once -continuous -l h_vmem=512M -N test_env /bin/bash -c "env"

doesn't show anything coming from ~/.profile or ~/.bashrc, same trouble with sh rather than /bin/bash.

results are in /var/data/project/test_env.out.good / /var/data/project/test_env.out.bad the .err is always empty
Comment 1 Philippe Elie 2014-05-19 17:38:30 UTC
typo, I meant /data/project/phetools/test_env.out.good and /data/project/phetools/test_env.out.bad
Comment 2 Philippe Elie 2014-05-19 18:38:48 UTC
Looking the man page http://cf.ccmr.cornell.edu/cgi-bin/w3mman2html.cgi?qsub%281B%29 environment var are not exported to the job, it's the normal behavior, that docs says to use qsub -V to pass env variable, is it possible jsub doesn't pass -V to qsub when using -once -continuous ?
Comment 3 Marc A. Pelletier 2014-08-27 23:16:18 UTC
Actually, jsub passes -V in neither case; but the gridengine is really random about when it decides to start subshells or not.  I strongly recommend that any dependency on the environment be sourced from the job script itself for that reason (or, possibly, by sourcing .bashrc explicitly as many have done).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links