-
Notifications
You must be signed in to change notification settings - Fork 10
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
view-job-records
: add --project
filter option
#490
Conversation
Problem: There is no way to filter jobs by project when looking at job records in flux-accounting's "jobs" table. Add a "project" column to the jobs table that will store an optional project name for each job. Update the schema version of the DB with the addition of the column name. Add an option to filter jobs by "project" when adding job records to the "jobs" table and while looking at job records with the view-job-records command.
Problem: A new column is added to the "jobs" table, but the test file that tests updating previous versions of flux-accounting DBs does not contain the schema version of the DB before this addition. Add the flux-accounting DB from v0.37.0 to the set of DBs tested in an update in t1017-update-db.t.
Problem: There is a helper script that inserts test job records into the "jobs" table that needs its INSERT statement to be updated to account for the addition of the "project" column. There is also an expected output file that needs to be updated to also account for the new "Project" column in the output of the view-job-records command. Update both of these in accordance with the addition of the "project" column to the "jobs" table in the flux-accounting DB.
Problem: There are no tests that ensure filtering jobs by project works. Add some basic tests.
@ryanday36 would you like to give this PR a high-level look and let me know if this might be a useful feature? I thought this might be a first-crack at tackling #352 to make it easier to gather jobs by project. |
This definitely looks useful! Thanks @cmoussa1 |
Sounds great @ryanday36! Thanks for taking a look at it. I'll mark this as ready for review then. |
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!
Thanks @jameshcorbett! Setting MWP here |
Problem
There is no way to filter jobs by project when looking at job records in flux-accounting's
jobs
table. This could be a useful feature now that the priority plugin validates and annotates project names for jobs.This PR adds a
project
column to thejobs
table that can store an optional project name for each job. It then adds an optional argument to theview-job-records
command--project
which can filter jobs by project name:flux account view-job-records --project=projectA
I've updated some existing tests that use the
view-job-records
command as well as added a new test file that tests filtering jobs by project name.