Skip to content

Purging variables in pilotCommand installEnv #156

Closed

Description

@andresailer

As far as I can tell the GFAL (etc.) variables survive the purging by the diracos2/diracosrc because the original environment is kept from the start

self.installEnv = os.environ

And then only updated with the new values from diracosrc obtained here
retCode, output = self.executeAndGetOutput('bash -c "source diracos/diracosrc && env"', self.pp.installEnv)

updating installEnv dict
self.pp.installEnv[var] = value

but non-existing values are not popped
and then the jobagent runs with installEnv
retCode, _output = self.executeAndGetOutput(jobAgent, self.pp.installEnv)

Should we just self.pp.installEnv = {} before filling updated values?

Activity

  1. chrisburr commented on Jun 2, 2022

    @chrisburr
    Member

    Should we just self.pp.installEnv = {} before filling updated values?

    I agree and this is what is done in LHCb already: https://gitlab.cern.ch/lhcb-dirac/LHCbPilot/-/blob/074064f1a1e3b8d4691a42f5e3eeee6ff6dea4ec/LHCbPilot/LHCbPilotCommands.py#L105-117

  2. psgebeli commented on Sep 10, 2026

    @psgebeli

    Hello @fstagni @andresailer

    It seems like this changed was (accidentally?) removed when the code was refactored in #203 . The current pilot , https://github.com/DIRACGrid/Pilot/blob/master/Pilot/pilotCommands.py , does not clear the install environment, thus potentially harmful variables remain from site environments.

    We (Belle II Distributed Computing) noticed this recently as we are trying to decommission BellePilotCommands in order to use upstream DIRAC pilot commands. However, there are some sites where we are seeing all jobs fail due to these site variables that never get purged.

    I can open a pull request, but I wanted to check if this change was intentional?

    Paul (on behalf of Belle II DC)

  3. psgebeli commented on Sep 10, 2026

    @psgebeli

    As a follow-up, I created a PR: #286

  4. linked a pull request that will close this issuepurge the site installEnv variables #286on Sep 11, 2026
  5. reopened this on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions