Skip to content

Commit 92d0ffc

Browse files
authored
Add missing user environment variables (#51)
* debug multi user Signed-off-by: vsoch <[email protected]>
1 parent e6dc49c commit 92d0ffc

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/flux-framework/flux-restful-api/tree/main) (0.0.x)
17+
- Ensure we update flux environment for user (0.1.13)
1718
- Add better multi-user mode - running jobs on behalf of user (0.1.12)
1819
- Restore original rpc to get job info (has more information) (0.1.11)
1920
- Refactor of FLux Restful to use a database and OAauth2 (0.1.0)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.12
1+
0.1.13

app/library/flux.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import os
3+
import pwd
34
import re
45
import shlex
56
import subprocess
@@ -37,10 +38,16 @@ def submit_job(handle, fluxjob, user):
3738
print("Submit in single-user mode.")
3839
return flux.job.submit_async(handle, fluxjob)
3940

41+
pw_record = pwd.getpwnam(user)
42+
user_name = pw_record.pw_name
43+
# user_uid = pw_record.pw_uid
44+
# user_gid = pw_record.pw_gid
45+
4046
# Update the payload for the correct user
41-
# Use helper script to sign payload
47+
fluxjob.environment["HOME"] = pw_record.pw_dir
48+
fluxjob.environment["LOGNAME"] = user_name
49+
fluxjob.environment["USER"] = pw_record.pw_name
4250
payload = json.dumps(fluxjob.jobspec)
43-
# payload['HOME'] =
4451

4552
# We ideally need to pipe the payload into flux python
4653
try:

clients/python/flux_restful_client/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.12"
1+
__version__ = "0.1.13"
22
AUTHOR = "Vanessa Sochat"
33
44
NAME = "flux-restful-client"

0 commit comments

Comments
 (0)