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

Add quality of service group by with Slurm support #1589

Merged
merged 3 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions classes/OpenXdmod/Shredder/Slurm.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Slurm extends Shredder
'jobidraw',
'cluster',
'partition',
'qos',
'account',
'group',
'gid',
Expand Down Expand Up @@ -70,6 +71,7 @@ class Slurm extends Shredder
'job_id_raw',
'cluster_name',
'partition_name',
'qos_name',
'account_name',
'group_name',
'gid_number',
Expand Down Expand Up @@ -111,6 +113,7 @@ class Slurm extends Shredder
'job_name' => 'job_name',
'resource_name' => 'cluster_name',
'queue_name' => 'partition_name',
'qos_name' => 'qos_name',
'user_name' => 'user_name',
'uid_number' => 'uid_number',
'group_name' => 'group_name',
Expand Down
3 changes: 3 additions & 0 deletions configuration/datawarehouse.d/ref/Jobs-group-bys.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"provider": {
"$ref": "datawarehouse.d/ref/group-by-common.json#/provider"
},
"qos": {
"$ref": "datawarehouse.d/ref/group-by-common.json#/qos"
},
"quarter": {
"$ref": "datawarehouse.d/ref/group-by-time-period.json#/quarter"
},
Expand Down
27 changes: 27 additions & 0 deletions configuration/datawarehouse.d/ref/group-by-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,33 @@
"description_html": "A service provider is an institution that hosts resources.",
"name": "Service Provider"
},
"qos": {
"attribute_table_schema": "modw",
"attribute_to_aggregate_table_key_map": [
{
"id": "qos_id"
}
],
"attribute_values_query": {
"joins": [
{
"name": "qos"
}
],
"orderby": [
"name"
],
"records": {
"id": "id",
"name": "name",
"order_id": "name",
"short_name": "name"
}
},
"category": "Administrative",
"description_html": "The quality of service of the job",
"name": "QOS"
},
"queue": {
"additional_join_constraints": [
{
Expand Down
4 changes: 4 additions & 0 deletions configuration/etl/etl.d/hpcdb-xdw.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
"name": "principal-investigator",
"definition_file": "jobs/xdw/principal-investigator.json",
"description": "principal investigator records"
}, {
"name": "qos",
"definition_file": "jobs/xdw/qos.json",
"description": "qos records"
}, {
"name": "request",
"definition_file": "jobs/xdw/request.json",
Expand Down
6 changes: 6 additions & 0 deletions configuration/etl/etl.d/hpcdb.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"common/hpcdb/people-on-accounts-history.json",
"common/hpcdb/requests.json",
"common/hpcdb/principal-investigators.json",
"common/hpcdb/qos.json",
"common/hpcdb/resource-allocated.json",
"common/hpcdb/resource-specs.json",
"common/hpcdb/system-accounts.json",
Expand Down Expand Up @@ -120,6 +121,11 @@
"description": "Ingest resource allocated data",
"definition_file": "common/hpcdb/resource-allocated.json"
},
{
"name": "qos",
"description": "Ingest QOS",
"definition_file": "common/hpcdb/qos.json"
},
{
"name": "accounts",
"description": "Ingest accounts",
Expand Down
6 changes: 6 additions & 0 deletions configuration/etl/etl.d/staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"common/staging/organization.json",
"common/staging/pi-resource.json",
"common/staging/pi.json",
"common/staging/qos.json",
"common/staging/resource-config.json",
"common/staging/resource-spec.json",
"common/staging/resource-type.json",
Expand Down Expand Up @@ -200,6 +201,11 @@
"description": "Ingest job User/PI/Resource permutations",
"definition_file": "jobs/staging/user-pi-resource.json"
},
{
"name": "qos",
"description": "Ingest job QOS",
"definition_file": "jobs/staging/qos.json"
},
{
"name": "job",
"description": "Ingest job data",
Expand Down
92 changes: 92 additions & 0 deletions configuration/etl/etl.d/xdmod-migration-9_5_0-10_0_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,98 @@
"schema": "mod_logger"
}
}
},
{
"name": "alter-shredded_job_slurm",
"description": "Alter mod_shredder.shredded_job_slurm to add qos_name column",
"class": "ExecuteSql",
"sql_file_list": [
{
"sql_file": "migrations/9.5.0-10.0.0/mod_shredder/alter-shredded_job_slurm.sql",
"delimiter": ";"
}
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "Shredder/Staging Database",
"config": "shredder",
"schema": "mod_shredder"
}
}
},
{
"name": "update-mod_shredder-qos",
"description": "Add QOS table and columns to mod_shredder",
"class": "ManageTables",
"definition_file_list": [
"jobs/shredder/job.json",
"common/staging/qos.json",
"jobs/staging/job.json"
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "Shredder/Staging Database",
"config": "shredder",
"schema": "mod_shredder"
}
}
},
{
"name": "update-mod_hpcdb-qos",
"description": "Add QOS table and columns to mod_hpcdb",
"class": "ManageTables",
"definition_file_list": [
"common/hpcdb/qos.json",
"jobs/hpcdb/jobs.json"
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "HPCDB Database",
"config": "hpcdb",
"schema": "mod_hpcdb"
}
}
},
{
"name": "update-modw-qos",
"description": "Add QOS table and columns to modw",
"class": "ManageTables",
"definition_file_list": [
"jobs/xdw/job-records.json",
"jobs/xdw/qos.json"
],
"endpoints": {
"destination": {
"type": "mysql",
"name": "Data Warehouse",
"config": "datawarehouse",
"schema": "modw"
}
}
},
{
"name": "insert-modw-qos",
"description": "Insert QOS modw data",
"class": "StructuredFileIngestor",
"namespace": "ETL\\Ingestor",
"options_class": "IngestorOptions",
"definition_file": "jobs/xdw/qos.json",
"endpoints": {
"source": {
"type": "jsonfile",
"name": "unknown qos data",
"path": "jobs/xdw/qos.json"
},
"destination": {
"type": "mysql",
"name": "Data Warehouse",
"config": "datawarehouse",
"schema": "modw"
}
}
}
],
"cloud-migration-9-5-0_10-0-0": [
Expand Down
18 changes: 18 additions & 0 deletions configuration/etl/etl_action_defs.d/common/hpcdb/qos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"table_definition": {
"$ref": "${table_definition_dir}/common/hpcdb/qos.json#/table_definition"
},
"source_query": {
"records": {
"qos_id": "qos.qos_id",
"qos_name": "qos.qos_name"
},
"joins": [
{
"schema": "${SOURCE_SCHEMA}",
"name": "staging_qos",
"alias": "qos"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"processorbucket_id": "(SELECT id FROM ${UTILITY_SCHEMA}.processor_buckets pb WHERE task.processor_count BETWEEN pb.min_processors AND pb.max_processors)",
"gpu_count": "task.gpu_count",
"gpubucket_id": "(SELECT id FROM ${UTILITY_SCHEMA}.gpu_buckets gb WHERE task.gpu_count BETWEEN gb.min_gpus AND gb.max_gpus)",
"qos_id": "record.qos_id",
"submitted_job_count": "SUM( IF(task.submit_time_ts BETWEEN ${:PERIOD_START_TS} AND ${:PERIOD_END_TS}, 1, 0) )",
"ended_job_count": "SUM( IF(task.end_day_id BETWEEN ${:PERIOD_START_DAY_ID} AND ${:PERIOD_END_DAY_ID}, 1, 0) )",
"started_job_count": "SUM( IF(task.start_day_id BETWEEN ${:PERIOD_START_DAY_ID} AND ${:PERIOD_END_DAY_ID}, 1, 0) )",
Expand Down Expand Up @@ -110,7 +111,8 @@
"account_id",
"systemaccount_id",
"allocation_id",
"principalinvestigator_person_id"
"principalinvestigator_person_id",
"qos_id"
],
"joins": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"processorbucket_id": "(SELECT id FROM ${UTILITY_SCHEMA}.processor_buckets pb WHERE task.processor_count BETWEEN pb.min_processors AND pb.max_processors)",
"gpu_count": "task.gpu_count",
"gpubucket_id": "(SELECT id FROM ${UTILITY_SCHEMA}.gpu_buckets gb WHERE task.gpu_count BETWEEN gb.min_gpus AND gb.max_gpus)",
"qos_id": "record.qos_id",
"submitted_job_count": "SUM( IF(task.submit_time_ts BETWEEN ${:PERIOD_START_TS} AND ${:PERIOD_END_TS}, 1, 0) )",
"ended_job_count": "SUM( IF(task.end_day_id BETWEEN ${:PERIOD_START_DAY_ID} AND ${:PERIOD_END_DAY_ID}, 1, 0) )",
"started_job_count": "SUM( IF(task.start_day_id BETWEEN ${:PERIOD_START_DAY_ID} AND ${:PERIOD_END_DAY_ID}, 1, 0) )",
Expand Down Expand Up @@ -109,7 +110,8 @@
"account_id",
"systemaccount_id",
"allocation_id",
"principalinvestigator_person_id"
"principalinvestigator_person_id",
"qos_id"
],
"joins": [
{
Expand Down
8 changes: 8 additions & 0 deletions configuration/etl/etl_action_defs.d/jobs/hpcdb/jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"resource_id": "r.resource_id",
"allocation_breakdown_id": "upr.user_pi_resource_id",
"allocation_id": "pr.pi_resource_id",
"qos_id": "IFNULL(q.qos_id, -1)",
"account_id": "p.pi_id",
"local_jobid": "j.job_id",
"local_job_array_index": "IFNULL(j.job_array_index, -1)",
Expand Down Expand Up @@ -75,6 +76,13 @@
"alias": "upr",
"type": "LEFT",
"on": "j.user_name = upr.user_name AND j.pi_name = upr.pi_name AND j.resource_name = upr.resource_name"
},
{
"name": "staging_qos",
"schema": "${SOURCE_SCHEMA}",
"alias": "q",
"type": "LEFT",
"on": "j.qos_name = q.qos_name"
}
],
"where": [
Expand Down
1 change: 1 addition & 0 deletions configuration/etl/etl_action_defs.d/jobs/staging/job.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"group_name": "group_name",
"gid_number": "gid_number",
"pi_name": "pi_name",
"qos_name": "qos_name",
"account_name": "account_name",
"project_name": "project_name",
"start_time": "start_time",
Expand Down
20 changes: 20 additions & 0 deletions configuration/etl/etl_action_defs.d/jobs/staging/qos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"table_definition": {
"$ref": "${table_definition_dir}/common/staging/qos.json#/table_definition"
},
"source_query": {
"records": {
"qos_name": "DISTINCT j.qos_name"
},
"joins": [
{
"name": "shredded_job",
"schema": "${SOURCE_SCHEMA}",
"alias": "j"
}
],
"where": [
"j.qos_name IS NOT NULL"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"local_job_array_index": "j.local_job_array_index",
"local_job_id_raw": "j.local_job_id_raw",
"job_name": "j.jobname",
"qos_id": "j.qos_id",
"queue": "COALESCE(j.queue, 'NA')",
"node_count": "j.nodecount",
"systemaccount_id": "sa.system_account_id",
Expand Down Expand Up @@ -179,6 +180,7 @@
"allocation_id": "allocation_id",
"allocation_resource_id": "allocation_resource_id",
"fos_id": "fos_id",
"qos_id": "qos_id",
"queue": "queue",
"person_id": "person_id",
"person_organization_id": "person_organization_id",
Expand Down
18 changes: 18 additions & 0 deletions configuration/etl/etl_action_defs.d/jobs/xdw/qos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"table_definition": {
"$ref": "${table_definition_dir}/jobs/xdw/qos.json#/table_definition"
},
"source_query": {
"records": {
"id": "j.qos_id",
"name": "j.qos_name"
},
"joins": [
{
"name": "hpcdb_qos",
"schema": "${SOURCE_SCHEMA}",
"alias": "j"
}
]
}
}
4 changes: 4 additions & 0 deletions configuration/etl/etl_data.d/jobs/xdw/qos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
["id", "name"],
[-1, "Unknown"]
]
13 changes: 13 additions & 0 deletions configuration/etl/etl_pipelines.d/jobs-xdw.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"jobs/xdw/processor-buckets.json",
"jobs/xdw/quarters.json",
"jobs/xdw/queue.json",
"jobs/xdw/qos.json",
"jobs/xdw/request.json",
"jobs/xdw/resource-allocated.json",
"jobs/xdw/resource-fact.json",
Expand Down Expand Up @@ -143,6 +144,18 @@
}
}
},
{
"name": "qos",
"definition_file": "jobs/xdw/qos.json",
"description": "QOS data",
"endpoints": {
"source": {
"type": "jsonfile",
"name": "unknown qos data",
"path": "jobs/xdw/qos.json"
}
}
},
{
"name": "schema-version",
"definition_file": "jobs/xdw/schema-version-history.json",
Expand Down
1 change: 1 addition & 0 deletions configuration/etl/etl_sql.d/jobs/shredder/job-slurm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CREATE TABLE ${DESTINATION_SCHEMA}.`shredded_job_slurm` (
`job_name` tinytext NOT NULL,
`cluster_name` tinytext NOT NULL,
`partition_name` tinytext NOT NULL,
`qos_name` tinytext DEFAULT NULL,
`user_name` tinytext NOT NULL,
`uid_number` int(10) unsigned DEFAULT NULL,
`group_name` tinytext NOT NULL,
Expand Down
Loading