Skip to content

Commit

Permalink
fix(agent): avoid propagating env variables to slurm jobs (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
fschuch authored Oct 28, 2024
1 parent b8ead1e commit 15f9654
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions jobbergate-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This file keeps track of all notable changes to jobbergate-agent

## Unreleased
- Changed auto-update task to reuse current scheduler instead of creating a new one
- Fixed environment variables from the machine running the agent propagating to slurm jobs (notice `--export=ALL` is the default behavior for sbatch)

## 5.3.0 -- 2024-09-09

Expand Down
2 changes: 1 addition & 1 deletion jobbergate-agent/jobbergate_agent/jobbergate/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __post_init__(self):
self.gid = pwan.pw_gid

def run(self, *args, **kwargs):
kwargs.update(user=self.uid, group=self.gid)
kwargs.update(user=self.uid, group=self.gid, env={})
# Tests indicate that the change on the working directory precedes the change of user on the subprocess.
# With that, the user running the agent can face permission denied errors on cwd,
# depending on the setting on the filesystem and permissions on the directory.
Expand Down
1 change: 1 addition & 0 deletions jobbergate-agent/jobbergate_agent/utils/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def init_sentry():
integrations=[sentry_logging],
traces_sample_rate=1.0,
environment=SETTINGS.SENTRY_ENV,
propagate_traces=False, # Do not propagate traces to child processes (e.g. sbatch subprocesses)
)

logger.debug("##### Enabled Sentry since a valid DSN key was provided.")
Expand Down

0 comments on commit 15f9654

Please sign in to comment.