Skip to content

Commit

Permalink
Make job-user dicts more specific to each job.
Browse files Browse the repository at this point in the history
  • Loading branch information
notoraptor committed Feb 20, 2024
1 parent 887b911 commit a605f1b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/store_huge_fake_data_in_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,6 @@
"last_slurm_update": 1686248596.476063,
"last_slurm_update_by_sacct": 1686248596.476063,
}
BASE_USER_JOB_DICT = {
"user_id": "[email protected]",
"job_id": 795002,
"cluster_name": "beluga",
"labels": {f"name_{i + 1}": f"i am a label {i + 1}" for i in range(4)},
}


def _generate_huge_fake_data(with_labels=False):
Expand Down Expand Up @@ -370,9 +364,15 @@ def _generate_huge_fake_data(with_labels=False):
if with_labels:
# populate labels
for i in range(nb_user_job_dicts):
user_job_dict = BASE_USER_JOB_DICT.copy()
# edit job_id
user_job_dict["job_id"] = i + 1
user_job_dict = {
"user_id": "[email protected]",
"job_id": i + 1,
"cluster_name": "beluga",
"labels": {
f"prop_{j + 1}_for_job_{i + 1}": f"I am user dict prop {j + 1} for job ID {i + 1}"
for j in range(4)
},
}
labels.append(user_job_dict)

return {"users": USERS, "jobs": jobs, "labels": labels}
Expand Down

0 comments on commit a605f1b

Please sign in to comment.