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

support flux uri --wait JOBID #6443

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Nov 15, 2024

This PR adds support for a ?wait query parameter to the jobid URI resolver, and a new --wait option to flux-uri to pass that parameter down to the resolver.

This supports waiting until the URI is available for pending or starting jobs, as opposed to the resolver returning "job is not running".

If the wait parameter is used with a job that isn't an instance of Flux, then it waits until the finish event before giving up and returning "URI not found".

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.64%. Comparing base (ae1f516) to head (27fbc7b).

Files with missing lines Patch % Lines
src/bindings/python/flux/uri/resolvers/jobid.py 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6443      +/-   ##
==========================================
- Coverage   83.64%   83.64%   -0.01%     
==========================================
  Files         524      524              
  Lines       87693    87708      +15     
==========================================
+ Hits        73355    73365      +10     
- Misses      14338    14343       +5     
Files with missing lines Coverage Δ
src/cmd/flux-uri.py 93.10% <100.00%> (+0.79%) ⬆️
src/bindings/python/flux/uri/resolvers/jobid.py 94.00% <89.47%> (-3.37%) ⬇️

... and 7 files with indirect coverage changes

Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a couple of nits on the docs.


::

$ flux uri --wait $(flux batch -n1 --wrap flux run hostname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example, maybe it would be slightly better to use sleep 3600 or something that runs for a while rather than hostname?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! If we're making a realistic example, maybe just a placeholder myjob or something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine!

Comment on lines +77 to 78
if the network host specified by an :program:`ssh` URI is not the current
host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains reformatting that isn't mentioned in the commit message.
Might be good to at least call it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I added that

@grondo
Copy link
Contributor Author

grondo commented Dec 3, 2024

Ok I addressed those comments and will set MWP. Thanks!

Problem: It is inconvenient that a user has to ensure a job's
memo event containing the subinstance URI has been posted before
they can call `flux uri` or other URI resolver.

Support a `wait` parameter for the jobid resolver which, when used,
causes the resolver to wait for the `memo` event containing the
URI before returning. This is only done if the job is not in
the INACTIVE or CLEANUP states.
Problem: The `?wait` query parameter to the `jobid` URI resolver scheme
and the corresponding `--wait` flag to `flux uri` are not documented.

Add documentation to flux-uri(1).

Additionally replace use of double-backticks with :program:`prog` where
appropriate for readability. Reformat paragraphs where necessary due to
longer line length introduced by this change.
Problem: No tests in the testsuite ensure that `flux uri --wait` works.

Add a test to t2802-uri-cmd.t.
@mergify mergify bot merged commit 435756d into flux-framework:master Dec 4, 2024
32 checks passed
@grondo grondo deleted the job-uri-wait branch December 4, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants