-
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
command suite: add new list-projects
command
#496
Conversation
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.
My two comments are my misunderstanding and nothing you did wrong. Go ahead with MWP!
cat <<-EOF >project_table.expected | ||
project_id | project | usage | ||
-----------+---------+------ | ||
1 | * | 0.0 |
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.
Usage is reported in what unit?
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.
Usage in accounting is calculated as a product of nnodes
and t_elapsed
(which is defined as t_inactive - t_run
). I have some more detailed explanations and examples here.
@@ -115,3 +115,32 @@ def delete_project(conn, project): | |||
return warning_stmt | |||
|
|||
return 0 | |||
|
|||
|
|||
def list_projects(conn): |
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.
Ok, sorry for another newbie question but... In my mental map projects were subsidiaries of banks. So does this list only the projects for one bank, or can projects cut across banks altogether?
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.
Projects are created and managed separately from banks. My understanding of projects is that they can be thought of as annotations on a job that multiple users (who might belong to different banks) can make. So, this command will list all registered projects that the flux-accounting database knows about, i.e ones that are added via flux account add-project my_project
.
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.
Thank you so much @cmoussa1 for all the clarifications. I created more work for you by trying to use these reviews to learn about the interfaces we might use to solve some issues raised by our users at Sandia. I really appreciate the explanations!
Problem: There currently exists no way to list all of the currently registered projects in the flux-accounting database. Add a new command to the flux-accounting command suite that creates a table of all of the currently registered projects in the flux-accounting database. Add a couple sharness tests to t1025-flux-account-projects.t that check the output of calling list-projects with just the default project listed and after registering a couple of other projects.
fd2589d
to
b67446a
Compare
Thanks for reviewing @wihobbs! Setting MWP here too |
Problem
There currently exists no way to list all of the currently registered projects in the flux-accounting database.
This PR adds a new command to the flux-accounting command suite,
list-projects
, that creates a table of all of the currently registered projects in the flux-accounting database.I've also added a couple sharness tests to
t1025-flux-account-projects.t
that check the output of callinglist-projects
with just the default project listed and after registering a couple of other projects.