Skip to content

Commit 16999ec

Browse files
authored
Merge pull request #48 from flux-framework/add/back-runtime
adding back runtime and other job info attributes
2 parents ac8e5c0 + fc8c462 commit 16999ec

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ 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+
- Restore original rpc to get job info (has more information) (0.1.11)
18+
- Refactor of FLux Restful to use a database and OAauth2 (0.1.0)
1719
- Support for basic PAM authentication (0.0.11)
1820
- Fixing bug with launcher always being specified (0.0.1)
1921
- catching any errors on creation of fluxjob

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.11
1+
0.1.1

app/library/flux.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,31 @@ def get_job(jobid, user=None):
261261
payload = {"id": jobid, "attrs": ["all"]}
262262
rpc = flux.job.list.JobListIdRPC(app.handle, "job-list.list-id", payload)
263263
try:
264-
jobinfo = rpc.get_job()
264+
jobinfo = rpc.get()
265265

266266
# The job does not exist!
267267
except FileNotFoundError:
268268
return None
269269

270-
# User friendly string from integer
271-
jobinfo["state"] = flux.job.info.statetostr(jobinfo["state"])
272-
273-
# These likely appear only after completion
274-
for required in ["result", "returncode", "runtime", "waitstatus", "duration"]:
275-
if required not in jobinfo:
276-
jobinfo[required] = ""
270+
jobinfo = jobinfo["job"]
277271

278-
# This should be a dictionary
279-
if "exception" not in jobinfo:
280-
jobinfo["exception"] = {}
272+
# User friendly string from integer
273+
state = jobinfo["state"]
274+
jobinfo["state"] = flux.job.info.statetostr(state)
275+
276+
# Get job info to add to result
277+
info = rpc.get_jobinfo()
278+
jobinfo["nnodes"] = info._nnodes
279+
jobinfo["result"] = info.result
280+
jobinfo["returncode"] = info.returncode
281+
jobinfo["runtime"] = info.runtime
282+
jobinfo["priority"] = info._priority
283+
jobinfo["waitstatus"] = info._waitstatus
284+
jobinfo["nodelist"] = info._nodelist
285+
jobinfo["nodelist"] = info._nodelist
286+
jobinfo["exception"] = info._exception.__dict__
287+
288+
# Only appears after finished?
289+
if "duration" not in jobinfo:
290+
jobinfo["duration"] = ""
281291
return jobinfo

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.0"
1+
__version__ = "0.1.1"
22
AUTHOR = "Vanessa Sochat"
33
44
NAME = "flux-restful-client"

0 commit comments

Comments
 (0)