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

FLUX_JOB_ID is set in batch scripts #4716

Closed
garlick opened this issue Oct 25, 2022 · 0 comments
Closed

FLUX_JOB_ID is set in batch scripts #4716

garlick opened this issue Oct 25, 2022 · 0 comments

Comments

@garlick
Copy link
Member

garlick commented Oct 25, 2022

Problem: the broker allows its FLUX_JOB_ID to leak through to the initial program, which makes it hard to distinguish whether a program is being run from a batch script or from a job. It looks like a job, but the job is really in the enclosing instance not the instance that started the initial program.

FLUX_JOB_ID confuses our OpenMPI schizo plugin, preventing singleton MPI jobs from being runnable from the batch script. See #4671 (comment)

It also confuses libyogrt as mentioned in #3817

@grondo grondo added this to the flux-core v0.45.0 milestone Oct 25, 2022
garlick added a commit to garlick/flux-core that referenced this issue Oct 25, 2022
Problem: FLUX_JOB_ID and other job environment variables remain
set in the initial program if Flux was launched by Flux.  This
sends the wrong message to programs that need to detect if they're
running in a job environment or nots, since they refer to the Flux
broker's job environment, not the current process.

Clear the job-related environment variables in the the broker rc
script environment, where the inital program is considered "rc2".

Drop unsetenv() calls for FLUX_JOB_ID, FLUX_JOB_SIZE, FLUX_JOB_NNODES
in the broker mainline, now redundant.

Fixes flux-framework#4716
garlick added a commit to garlick/flux-core that referenced this issue Oct 25, 2022
Problem: FLUX_JOB_ID and other job environment variables remain
set in the initial program if Flux was launched by Flux.  This
sends the wrong message to programs that need to detect if they're
running in a job environment or nots, since they refer to the Flux
broker's job environment, not the current process.

Clear the job-related environment variables in the the broker rc
script environment, where the inital program is considered "rc2".

Drop unsetenv() calls for FLUX_JOB_ID, FLUX_JOB_SIZE, FLUX_JOB_NNODES
in the broker mainline, now redundant.

Fixes flux-framework#4716
garlick added a commit to garlick/flux-core that referenced this issue Oct 25, 2022
Problem: FLUX_JOB_ID and other job environment variables remain
set in the initial program if Flux was launched by Flux.  This
sends the wrong message to programs that need to detect if they're
running in a job environment or not, since these variables refer to
the Flux broker's job environment, not that of the current process.

Clear the job-related environment variables in the the broker rc
script environment, where the inital program is considered "rc2".

Drop unsetenv() calls for FLUX_JOB_ID, FLUX_JOB_SIZE, FLUX_JOB_NNODES
in the broker mainline, now redundant.

Fixes flux-framework#4716
@mergify mergify bot closed this as completed in 485743d Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants