Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rqd] Remove hardcoded MAIL and HOME rqd environment variables #1511

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions rqd/rqd/rqcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ def __createEnvVariables(self):
self.frameEnv["CUE_GPU_MEMORY"] = str(self.rqCore.machine.getGpuMemoryFree())
self.frameEnv["SP_NOMYCSHRC"] = "1"

if platform.system() in ("Linux", "Darwin"):
self.frameEnv["MAIL"] = "/usr/mail/%s" % self.runFrame.user_name
self.frameEnv["HOME"] = "/net/homedirs/%s" % self.runFrame.user_name
elif platform.system() == "Windows":
Comment on lines -101 to -104
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are spi specific and safe to be removed. As these env vars are required at SPI, I think this PR should provide a alternative to how to set these variables from now on. I guess the following logic can be used, and it should be documented on this PR.

 for key, value in self.runFrame.environment.items():
            if key == 'PATH':
                self.frameEnv[key] += os.pathsep + value
            else:
                self.frameEnv[key] = value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rqd.conf already have a way of passing host enviroment variables onto the job (under [UseHostEnvVar])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added how to re-enable them again in the PR description

if platform.system() == "Windows":
for variable in ["SYSTEMROOT", "APPDATA", "TMP", "COMMONPROGRAMFILES", "SYSTEMDRIVE"]:
if variable in os.environ:
self.frameEnv[variable] = os.environ[variable]
Expand Down
Loading