Skip to content

Commit

Permalink
Add missing user environment variables (#51)
Browse files Browse the repository at this point in the history
* debug multi user

Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored Mar 7, 2023
1 parent e6dc49c commit 92d0ffc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.com/flux-framework/flux-restful-api/tree/main) (0.0.x)
- Ensure we update flux environment for user (0.1.13)
- Add better multi-user mode - running jobs on behalf of user (0.1.12)
- Restore original rpc to get job info (has more information) (0.1.11)
- Refactor of FLux Restful to use a database and OAauth2 (0.1.0)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.12
0.1.13
11 changes: 9 additions & 2 deletions app/library/flux.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
import pwd
import re
import shlex
import subprocess
Expand Down Expand Up @@ -37,10 +38,16 @@ def submit_job(handle, fluxjob, user):
print("Submit in single-user mode.")
return flux.job.submit_async(handle, fluxjob)

pw_record = pwd.getpwnam(user)
user_name = pw_record.pw_name
# user_uid = pw_record.pw_uid
# user_gid = pw_record.pw_gid

# Update the payload for the correct user
# Use helper script to sign payload
fluxjob.environment["HOME"] = pw_record.pw_dir
fluxjob.environment["LOGNAME"] = user_name
fluxjob.environment["USER"] = pw_record.pw_name
payload = json.dumps(fluxjob.jobspec)
# payload['HOME'] =

# We ideally need to pipe the payload into flux python
try:
Expand Down
2 changes: 1 addition & 1 deletion clients/python/flux_restful_client/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.12"
__version__ = "0.1.13"
AUTHOR = "Vanessa Sochat"
EMAIL = "[email protected]"
NAME = "flux-restful-client"
Expand Down

0 comments on commit 92d0ffc

Please sign in to comment.