-
Notifications
You must be signed in to change notification settings - Fork 50
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: get updated version of jobspec #5428
flux-job: get updated version of jobspec #5428
Conversation
What about |
That's not bad ... illustrates the idea well. Lets go with it. |
80f6c7f
to
511ead8
Compare
repushed using the term "base" over "noupdate" |
511ead8
to
d88af86
Compare
Silly question but we have Edit: the |
It seems useful at least for testing if nothing else? |
I did ponder this. I added
Not to say that these are the strongest reasons, just some reasons :-) |
OK I'm fine with that. Just wanted to hash that out. |
d88af86
to
6e58d56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A couple nits inline.
src/cmd/flux-job.c
Outdated
* event user specified duplicate keys or options that lead to | ||
* duplicate keys: e.g. | ||
* - --original and both "jobspec" and "J" | ||
* - --base and both "jobspec" and "eventlog" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the code it appears that "jobspec" and "eventlog" are both fetched only if not --base
not with --base
.
Is this comment correct?
@@ -53,16 +53,11 @@ def job_info_lookup(flux_handle, jobid, keys=["jobspec"]): | |||
return rpc | |||
|
|||
|
|||
def _original_setup(keys, original): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message: is "inputted" a word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL
https://www.merriam-webster.com/grammar/is-inputted-a-word
the issue of how to treat the past participle is a contentious one, with much blood being shed on both sides.
But it seems folks have accepted it as a word
🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 However from now on I will think of it as a golf term.
6e58d56
to
6b5ed20
Compare
Problem: Internally within flux, the jobspec can be updated through jobspec-update events. When the user runs "flux job info" to get the jobspec, it is getting the jobspec stored in the KVS and it may not represent what is actually used. In addition, the jobspec returned from "flux job info" will be inconsistent to the information returned from "flux jobs". Solution: When retrieving the jobspec, also retrieve the job eventlog. Internally update the jobspec through "jobspec-update" events and output the final result to give the user a representation of what the jobspec looks like within flux. Add a --base option to perform the old behavior, which is to just get the jobspec stored in the KVS. Fixes flux-framework#5411
Problem: There is no coverage for the new output style of "flux job info" and the jobspec (output represents the internal view of the jobspec) and there is no coverage for the flux job info --base option. Add coverage in t2230-job-info-lookup.t.
Problem: The job kvslookup code uses a number of flags to manage special case "jobspec" lookups. While this is fine when there is one single lookup special case, future special cases make the addition of more flags very cumbersome. Refactor the logic to remove flags. Instead, maintain a copy of the inputted lookup keys and a copy of the keys used for the actual lookup. Use this information instead of the multiple created flags to determine special case handling.
Problem: The "flux job info" command supports a "base" option, but this is not supported in tne similar Python bindings. Support a "base" flag in the job_kvs_lookup() function and the JobKVSLookup class.
Problem: The tests in t0014-job-kvslookup.py are numbered, making it annoying to add new tests and renumber all of the tests. To avoid excessive re-numbering of tests when new tests are added, logically group similar tests together and numerically number tests only within a group.
Problem: There is no coverage for the new "base" option for job kvs lookups via Python. Add coverage in python/t0014-job-kvslookup.py.
Problem: flux-update manually updates a jobspec with jobspec-update events from the eventlog. However, this is no longer necessary as the "job_kvs_lookup()" function does it by default. Remove manual updates to jobspec from flux-update.
6b5ed20
to
304ad80
Compare
@grondo Thanks, good catch on the comment. Fixed that up, will set MWP. |
Codecov Report
@@ Coverage Diff @@
## master #5428 +/- ##
==========================================
+ Coverage 83.61% 83.64% +0.02%
==========================================
Files 480 480
Lines 80678 80744 +66
==========================================
+ Hits 67460 67539 +79
+ Misses 13218 13205 -13
|
The jobspec returned by
flux job info
is the one stored in the KVS, which may differ from what is internally "viewed" by flux components due tojobspec-update
events. Notably, the jobspec returned may not be consistent to what is returned viaflux jobs
.This PR will make
flux job info
return an updated jobspec by default.Added a
--noupdate
option to get the version stored in the KVS. I'm not super in love with this option name. I considered--kvs
, but that was confusing give Python binding function names like ("job_kvs_lookup()").--stored
seemed dumb too. Ehhh ... any better ideas? I didn't want the option to be--update
b/c I wanted the default to be the updated one.Also added support in the Python bindings.
Update
flux-update
, as it no longer needs to applyjobspec-update
events manually.