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

Environment dict is not passed to query command #108

Closed
shapovalovts opened this issue Aug 1, 2018 · 3 comments · Fixed by #111
Closed

Environment dict is not passed to query command #108

shapovalovts opened this issue Aug 1, 2018 · 3 comments · Fixed by #111

Comments

@shapovalovts
Copy link

Argument env=self.get_env() is just missed:
https://github.com/jupyterhub/batchspawner/blob/0.8.1/batchspawner/batchspawner.py#L216

@rkdarst
Copy link
Contributor

rkdarst commented Aug 1, 2018

Hm.... this is a good point. Same for the cancel command.

I think it can be rationalized in that most of the environment is things that need to be passed (as environment variables) to the single-user server to do its configuration (and most of the env is specialized for that). In the "normal" case, the env is mostly irrelevant to normal queue/cancel commands... but it shouldn't hurt, and also I could see that some spawners might need the environment set.

Do you or someone need the env to be passed to these commands?

@mbmilligan
Copy link
Member

My first thought is that the usual way for authentication plugins to pass information to the spawners was by setting environment keys (since auth_state was kind of a placeholder until Jupyterhub 0.9), so conceivably one might want to include those values (an account string, for instance) in the templates. Probably does make sense to support.

@rkdarst
Copy link
Contributor

rkdarst commented Aug 3, 2018

The environment dict contains singleuser sensitive info, which is probably OK to pass to submit/query because they are on the hub machine. But, if they have auth info which is private only to the submitter on the hub machine (e.g. submit a job as an admin), then it will also get passed to the user's job environment. Really, .get_env() is the user's environment, not necessarily the submitter's environment.

Still, probably no hard in adding this to the submit commands, as long as it is documented properly (and already, the submit command gets this environment and that would mean it's passed to the user). If the batch command needs special environment, the putting env VAR=x in exec_prefix works.

Another downside is that it takes a bit of generation to make this dict, and the query command is run a lot.

rkdarst added a commit to rkdarst/batchspawner that referenced this issue Aug 3, 2018
- Previously, only the query command got the full enivornment.
- If this is used to authenticate to the submit/query/cancel commands,
  then the user's environment gets this also.
- Closes: jupyterhub#108
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

Successfully merging a pull request may close this issue.

3 participants