set DIRACSYSCONFIG env variable to pilot.cfg#122
Conversation
| lines.extend(['export %s=%s' % (envName, envValue)]) | ||
| lines.extend(['( echo $%s | grep -q $%s ) || export %s=$%s:$%s' % ( | ||
| envName, envValue, | ||
| envName, envName, envValue)]) |
There was a problem hiding this comment.
I'm a bit dubious about this line: I think it could do with a comment explaining what it does.
From what I can infer, I think it has an extra $ before the last %s... It may also fail if the variable already contains a superset of the value (I'm thinking of, for example, adding /bin if the variable already contains /usr/bin although that's probably a rarer case). Will it also add an extra ":" in if the variable isn't set in the first place?
There was a problem hiding this comment.
This line is not different from others in the same function, e.g.
( echo $PATH | grep -q $DIRACBIN ) || export PATH=$DIRACBIN:$PATH
This would end up adding
( echo $envName | grep -q $envValue ) || export envName=$envName:$envValue
Is it wrong?
Or maybe it should be
( echo $envName | grep -q $envValue ) || export envName=$envValue:$envName
?
There was a problem hiding this comment.
Hmm, isn't envValue an actual value in this instance rather than another env variable? So it should be:
export envName=$envName:envValue (without the $ before the value).
Although this only works properly in cases where these things are lists of paths and already have a value set (so it's fine for PATH and probably LD_LIBRARY_PATH, but not general to other variables.
I think the original behaviour where it just set the value may be closer to what an end user expects when they ask for a variable to be set.
There was a problem hiding this comment.
I am removing the changes from this file until we sort out for DIRACGrid/DIRAC#4860 (comment)
Note that right now the changes highlighted here are the same already merged in DIRAC repo's dirac-install.py
|
Reverted in #123 because of issues within LHCb jobs. |
|
I will look into this ASAP. |
|
FYI:
The issue is that the DIRAC SiteName is incorrect in the job, but correct in the pilot. E.g. for a job running at LCG.UKI-LT2-IC-HEP.uk in std.out of the job I get: Which points to the fact that right now this line is needed: So the issue is probably in the JobAgent. @sfayer can you remind me what you have done in the GridPP pilot to sort out the initial issue? |
|
Hmm, our patch for that issue was just to remove that line (otherwise we run a completely standard vanilla DIRAC pilot): The vanilla DIRAC pilot does have the other patch from a while ago that makes the dirac.cfg file as a symlink to pilot.cfg for the job itself (which I think isn't done in the LHCb case due to the CVMFS based installation), maybe that's why it works for us? |
|
I studied the situation, and I can conclude that:
That basically requires the pilot.cfg. Anyway, I don't see any better option than re-opening DIRACGrid/DIRAC#4836 (I will do it straight away). If anyone wants to give it another try, you are welcome, but for me that's enough. |
No description provided.