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

view-job-records: add --project filter option #490

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

cmoussa1
Copy link
Member

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 the jobs table that can store an optional project name for each job. It then adds an optional argument to the view-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.

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.
@cmoussa1 cmoussa1 added the new feature new feature label Sep 17, 2024
@cmoussa1
Copy link
Member Author

@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.

@ryanday36
Copy link
Contributor

This definitely looks useful! Thanks @cmoussa1

@cmoussa1
Copy link
Member Author

Sounds great @ryanday36! Thanks for taking a look at it. I'll mark this as ready for review then.

Copy link
Member

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmoussa1
Copy link
Member Author

Thanks @jameshcorbett! Setting MWP here

@mergify mergify bot merged commit 921b4ef into flux-framework:master Sep 30, 2024
11 checks passed
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.

3 participants