Skip to content

Commit

Permalink
__init__.py: define default columns for tables
Browse files Browse the repository at this point in the history
Problem: The default fields for the relevant tables in the
flux-accounting DB are defined manually throughout the bindings,
so it makes sense to define these globally in the accounting Python
fluxacct.accounting package.

Create a definition for the names of the columns in some of the tables
in __init__.py so that they can be referenced throughout the Python
bindings for flux-accounting.
  • Loading branch information
cmoussa1 committed Oct 28, 2024
1 parent f265364 commit 01c7f5e
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion src/bindings/python/fluxacct/accounting/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,53 @@ db_dir = "@X_LOCALSTATEDIR@/lib/flux/"
db_path = "@X_LOCALSTATEDIR@/lib/flux/FluxAccounting.db"
db_schema_version = 23

__all__ = ["db_dir", "db_path", "db_schema_version"]
# flux-accounting DB table column names
ASSOCIATION_TABLE = [
"creation_time",
"mod_time",
"active",
"username",
"userid",
"bank",
"default_bank",
"shares",
"job_usage",
"fairshare",
"max_running_jobs",
"max_active_jobs",
"max_nodes",
"queues",
"projects",
"default_project",
]
BANK_TABLE = ["bank_id", "bank", "active", "parent_bank", "shares", "job_usage"]
QUEUE_TABLE = [
"queue",
"min_nodes_per_job",
"max_nodes_per_job",
"max_time_per_job",
"priority",
]
PROJECT_TABLE = ["project_id", "project", "usage"]
JOBS_TABLE = [
"id",
"userid",
"t_submit",
"t_run",
"t_inactive",
"ranks",
"R",
"jobspec",
"project",
]

__all__ = [
"db_dir",
"db_path",
"db_schema_version",
"ASSOCIATION_TABLE",
"BANK_TABLE",
"QUEUE_TABLE",
"PROJECT_TABLE",
"JOBS_TABLE",
]

0 comments on commit 01c7f5e

Please sign in to comment.