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

plugin: add project validation and annotation #294

Closed
wants to merge 11 commits into from
18 changes: 17 additions & 1 deletion src/cmd/flux-account-priority-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ def bulk_update(path):
data = {}
bulk_user_data = []
bulk_q_data = []
bulk_p_data = []

# fetch all rows from association_table (will print out tuples)
for row in cur.execute(
"""SELECT userid, bank, default_bank,
fairshare, max_running_jobs, max_active_jobs,
queues, active FROM association_table"""
queues, active, projects, default_project
FROM association_table"""
):
# create a JSON payload with the results of the query
single_user_data = {
Expand All @@ -88,6 +90,8 @@ def bulk_update(path):
"max_active_jobs": int(row[5]),
"queues": str(row[6]),
"active": int(row[7]),
"projects": str(row[8]),
"def_project": str(row[9]),
}
bulk_user_data.append(single_user_data)

Expand All @@ -111,6 +115,18 @@ def bulk_update(path):

flux.Flux().rpc("job-manager.mf_priority.rec_q_update", json.dumps(data)).get()

# fetch all rows from project_table
for row in cur.execute("SELECT project FROM project_table"):
# create a JSON payload with the results of the query
single_p_data = {
"project": str(row[0]),
}
bulk_p_data.append(single_p_data)

data = {"data": bulk_p_data}

flux.Flux().rpc("job-manager.mf_priority.rec_project_update", data).get()

flux.Flux().rpc("job-manager.mf_priority.reprioritize")

# close DB connection
Expand Down
Loading