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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: frob for system attribute dependency name #5982

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vsoch
Copy link
Member

@vsoch vsoch commented May 17, 2024

馃毀 NOT FOR REVIEW! 馃毀

This PR is only opened to share the diff (and discuss possible design for an actual solution). We need this functionality for experiments, and this was the shortest path to get there!

Problem: we need a quick solution for assigning a jobid dependnecy to run after success (afterok) given a given name.
Solution: write a frobnicator plugin that handles this transformation to the jobspec.

Problem: we need a quick solution for assigning a jobid
dependnecy to run after success (afterok) given a given
name.
Solution: write a frobnicator plugin that handles this
transformation to the jobspec.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 83.30%. Comparing base (7bd3e35) to head (5dd20ec).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5982   +/-   ##
=======================================
  Coverage   83.29%   83.30%           
=======================================
  Files         515      516    +1     
  Lines       83405    83429   +24     
=======================================
+ Hits        69475    69498   +23     
- Misses      13930    13931    +1     
Files Coverage 螖
.../python/flux/job/frobnicator/plugins/dependency.py 37.50% <37.50%> (酶)

... and 7 files with indirect coverage changes

import flux.job

handle = flux.Flux()
for job in flux.job.list.job_list(handle).get()["jobs"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

flux.job.list.job_list() has an optional name parameter you could use to get only jobs that match dependency_name. Also, if you just want the most recent one, I think you could also add max_entries=1.

Copy link
Contributor

Choose a reason for hiding this comment

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

And I'm sorry, I see you put NOT FOR REVIEW in the PR 馃う

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, since I already commented 馃檪

You'll have to test, but flux.job.list.job_list() will by default only fetch jobs for the current user. In the frobnicator, this user is the owner of the instance, not necessarily the submitter of the job. You may need to set the userid parameter to the submission userid.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is super helpful! I really appreciate the feedback, regardless of my message.

Copy link
Member Author

Choose a reason for hiding this comment

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

Quick question @grondo - if I added those things, would the query be efficient enough to be suitable for an actual solution (and not a hacky one I'm working on)? And more specifically, considered for adding as an optional module (not loaded by default) to the core code base?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants