cc-specifications/interfaces/graphql/schema.graphqls

304 lines
6.5 KiB
GraphQL
Raw Permalink Normal View History

2022-03-18 14:47:39 +01:00
scalar Time
scalar Any
scalar NullableFloat
scalar MetricScope
scalar JobState
type Job {
id: ID!
jobId: Int!
user: String!
project: String!
cluster: String!
subCluster: String!
startTime: Time!
duration: Int!
walltime: Int!
numNodes: Int!
numHWThreads: Int!
numAcc: Int!
SMT: Int!
exclusive: Int!
partition: String!
arrayJobId: Int!
monitoringStatus: Int!
state: JobState!
tags: [Tag!]!
resources: [Resource!]!
2023-06-27 15:08:03 +02:00
concurrentJobs: JobLinkResultList
2022-03-18 14:47:39 +01:00
metaData: Any
userData: User
}
2023-06-27 15:08:03 +02:00
type JobLink {
id: ID!
jobId: Int!
}
2022-03-18 14:47:39 +01:00
type Cluster {
name: String!
partitions: [String!]! # Slurm partitions
metricConfig: [MetricConfig!]!
subClusters: [SubCluster!]! # Hardware partitions/subclusters
}
type SubCluster {
name: String!
nodes: String!
2023-06-27 15:08:03 +02:00
numberOfNodes: Int!
2022-03-18 14:47:39 +01:00
processorType: String!
socketsPerNode: Int!
coresPerSocket: Int!
threadsPerCore: Int!
2023-06-27 15:08:03 +02:00
flopRateScalar: MetricValue!
flopRateSimd: MetricValue!
memoryBandwidth: MetricValue!
2022-03-18 14:47:39 +01:00
topology: Topology!
}
2023-06-27 15:08:03 +02:00
type MetricValue {
unit: Unit!
value: Float!
}
2022-03-18 14:47:39 +01:00
type Topology {
node: [Int!]
socket: [[Int!]!]
memoryDomain: [[Int!]!]
die: [[Int!]!]
core: [[Int!]!]
accelerators: [Accelerator!]
}
type Accelerator {
id: String!
type: String!
model: String!
}
2023-06-27 15:08:03 +02:00
type SubClusterConfig {
name: String!
peak: Float
normal: Float
caution: Float
alert: Float
remove: Boolean
}
2022-03-18 14:47:39 +01:00
type MetricConfig {
2023-06-27 15:08:03 +02:00
name: String!
unit: Unit!
scope: MetricScope!
aggregation: String!
timestep: Int!
peak: Float!
normal: Float
caution: Float!
alert: Float!
subClusters: [SubClusterConfig!]!
2022-03-18 14:47:39 +01:00
}
type Tag {
id: ID!
type: String!
name: String!
}
type Resource {
hostname: String!
hwthreads: [Int!]
2023-06-27 15:08:03 +02:00
accelerators: [String!]
2022-03-18 14:47:39 +01:00
configuration: String
}
type JobMetricWithName {
name: String!
2023-06-27 15:08:03 +02:00
scope: MetricScope!
2022-03-18 14:47:39 +01:00
metric: JobMetric!
}
type JobMetric {
2023-06-27 15:08:03 +02:00
unit: Unit
2022-03-18 14:47:39 +01:00
timestep: Int!
series: [Series!]
statisticsSeries: StatsSeries
}
type Series {
hostname: String!
2023-06-27 15:08:03 +02:00
id: String
2022-03-18 14:47:39 +01:00
statistics: MetricStatistics
data: [NullableFloat!]!
}
2023-06-27 15:08:03 +02:00
type Unit {
base: String!
prefix: String
}
2022-03-18 14:47:39 +01:00
type MetricStatistics {
avg: Float!
min: Float!
max: Float!
}
type StatsSeries {
mean: [NullableFloat!]!
min: [NullableFloat!]!
max: [NullableFloat!]!
}
type MetricFootprints {
metric: String!
data: [NullableFloat!]!
}
type Footprints {
nodehours: [NullableFloat!]!
metrics: [MetricFootprints!]!
}
enum Aggregate { USER, PROJECT, CLUSTER }
2023-06-27 15:08:03 +02:00
enum Weights { NODE_COUNT, NODE_HOURS }
2022-03-18 14:47:39 +01:00
type NodeMetrics {
2023-06-27 15:08:03 +02:00
host: String!
subCluster: String!
metrics: [JobMetricWithName!]!
2022-03-18 14:47:39 +01:00
}
type Count {
name: String!
count: Int!
}
type User {
username: String!
name: String!
email: String!
}
type Query {
clusters: [Cluster!]! # List of all clusters
tags: [Tag!]! # List of all tags
user(username: String!): User
2023-06-27 15:08:03 +02:00
allocatedNodes(cluster: String!): [Count!]!
2022-03-18 14:47:39 +01:00
job(id: ID!): Job
jobMetrics(id: ID!, metrics: [String!], scopes: [MetricScope!]): [JobMetricWithName!]!
jobsFootprints(filter: [JobFilter!], metrics: [String!]!): Footprints
jobs(filter: [JobFilter!], page: PageRequest, order: OrderByInput): JobResultList!
jobsStatistics(filter: [JobFilter!], groupBy: Aggregate): [JobsStatistics!]!
2023-06-27 15:08:03 +02:00
jobsCount(filter: [JobFilter]!, groupBy: Aggregate!, weight: Weights, limit: Int): [Count!]!
2022-03-18 14:47:39 +01:00
rooflineHeatmap(filter: [JobFilter!]!, rows: Int!, cols: Int!, minX: Float!, minY: Float!, maxX: Float!, maxY: Float!): [[Float!]!]!
2023-06-27 15:08:03 +02:00
nodeMetrics(cluster: String!, nodes: [String!], scopes: [MetricScope!], metrics: [String!], from: Time!, to: Time!): [NodeMetrics!]!
2022-03-18 14:47:39 +01:00
}
type Mutation {
createTag(type: String!, name: String!): Tag!
deleteTag(id: ID!): ID!
addTagsToJob(job: ID!, tagIds: [ID!]!): [Tag!]!
removeTagsFromJob(job: ID!, tagIds: [ID!]!): [Tag!]!
updateConfiguration(name: String!, value: String!): String
}
type IntRangeOutput { from: Int!, to: Int! }
type TimeRangeOutput { from: Time!, to: Time! }
input JobFilter {
tags: [ID!]
jobId: StringInput
arrayJobId: Int
user: StringInput
project: StringInput
2023-06-27 15:08:03 +02:00
jobName: StringInput
2022-03-18 14:47:39 +01:00
cluster: StringInput
partition: StringInput
duration: IntRange
minRunningFor: Int
numNodes: IntRange
numAccelerators: IntRange
numHWThreads: IntRange
startTime: TimeRange
state: [JobState!]
flopsAnyAvg: FloatRange
memBwAvg: FloatRange
loadAvg: FloatRange
memUsedMax: FloatRange
2023-06-27 15:08:03 +02:00
exclusive: Int
sharedNode: StringInput
selfJobId: StringInput
selfStartTime: Time
selfDuration: Int
2022-03-18 14:47:39 +01:00
}
input OrderByInput {
field: String!
order: SortDirectionEnum! = ASC
}
enum SortDirectionEnum {
DESC
ASC
}
input StringInput {
eq: String
2023-06-27 15:08:03 +02:00
neq: String
2022-03-18 14:47:39 +01:00
contains: String
startsWith: String
endsWith: String
2023-06-27 15:08:03 +02:00
in: [String!]
2022-03-18 14:47:39 +01:00
}
input IntRange { from: Int!, to: Int! }
input FloatRange { from: Float!, to: Float! }
input TimeRange { from: Time, to: Time }
type JobResultList {
items: [Job!]!
offset: Int
limit: Int
count: Int
}
2023-06-27 15:08:03 +02:00
type JobLinkResultList {
items: [JobLink!]!
count: Int
}
2022-03-18 14:47:39 +01:00
type HistoPoint {
count: Int!
value: Int!
}
type JobsStatistics {
id: ID! # If `groupBy` was used, ID of the user/project/cluster
2023-06-27 15:08:03 +02:00
name: String! # if User-Statistics: Given Name of Account (ID) Owner
totalJobs: Int! # Number of jobs
runningJobs: Int! # Number of running jobs
shortJobs: Int! # Number of jobs with a duration of less than duration
2022-03-18 14:47:39 +01:00
totalWalltime: Int! # Sum of the duration of all matched jobs in hours
2023-06-27 15:08:03 +02:00
totalNodeHours: Int! # Sum of the node hours of all matched jobs
2022-03-18 14:47:39 +01:00
totalCoreHours: Int! # Sum of the core hours of all matched jobs
2023-06-27 15:08:03 +02:00
totalAccHours: Int! # Sum of the gpu hours of all matched jobs
histDuration: [HistoPoint!]! # value: hour, count: number of jobs with a rounded duration of value
2022-03-18 14:47:39 +01:00
histNumNodes: [HistoPoint!]! # value: number of nodes, count: number of jobs with that number of nodes
}
input PageRequest {
itemsPerPage: Int!
page: Int!
}