Skip to content

Commit f1441ad

Browse files
authored
chore(git): merge pull request #944
2 parents 5158fda + 84f3feb commit f1441ad

72 files changed

Lines changed: 366 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

COMPATIBILITY_MATRIX.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Compatibility Matrix
22

3-
| smart-contracts | meta-scheduler | supervisor | ldap-connector | slurm plugins | sbatch-service | smart-contracts-exporter | cli |
4-
| ------------------------------------------------------------------------------------- | ----------------- | ------------------- | ----------------- | ---------------- | -------------- | ------------------------ | -------------------------------- |
5-
| [v1.0.2](https://github.com/deepsquare-io/grid/releases/tag/smart-contracts%2Fv1.0.2) | >=v0.3.1, <v0.4.0 | >=v0.12.3, <v0.13.0 | >=v1.2.3, <v1.3.0 | >=v1.3.0,<v1.4.0 | >=0.11.0 | >=v0.3.2, <v0.4.0 | >=v1.0.0-alpha.5, <v1.0.0-beta.5 |
6-
| [v1.1.0](https://github.com/deepsquare-io/grid/releases/tag/smart-contracts%2Fv1.1.0) | >=v0.4.0 | >=v0.14.0 | >=v1.3.0 | >=v1.5.1 | >=0.12.0 | >=v0.4.0 | >=v1.0.0-beta.5 |
3+
| smart-contracts | meta-scheduler | supervisor | ldap-connector | slurm plugins | sbatch-service | smart-contracts-exporter | cli |
4+
| ------------------------------------------------------------ | ----------------- | ------------------- | ----------------- | ---------------- | ------------------ | ------------------------ | -------------------------------- |
5+
| [v1.0.2](https://github.com/deepsquare-io/grid/releases/tag/smart-contracts%2Fv1.0.2) | >=v0.3.1, <v0.4.0 | >=v0.12.3, <v0.13.0 | >=v1.2.3, <v1.3.0 | >=v1.3.0,<v1.4.0 | >=v0.11.0,<v0.14.0 | >=v0.3.2, <v0.4.0 | >=v1.0.0-alpha.5, <v1.0.0-beta.5 |
6+
| [v1.1.0](https://github.com/deepsquare-io/grid/releases/tag/smart-contracts%2Fv1.1.0) | >=v0.4.0, <v0.5.0 | >=v0.14.0,<0.15.0 | >=v1.3.0,<v1.4.0 | >=v1.5.1 | >=v0.12.0,<v0.14.0 | >=v0.4.0,<v0.5.0 | >=v1.0.0,<v1.2.0 |
7+
| [v1.2.0](https://github.com/deepsquare-io/grid/releases/tag/smart-contracts%2Fv1.2.0) | >=v0.5.0 | >=v0.15.0 | >=v1.4.0 | >=v1.5.1 | >=v0.14.0 | >=v0.5.0 | >=v1.2.0 |
8+

cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobID, err = client.SubmitJob(
171171
Tasks: 1,
172172
CpusPerTask: 1,
173173
MemPerCPU: 100,
174-
GpusPerTask: 0,
174+
Gpus: 0,
175175
},
176176
Steps: []*sbatch.Step{
177177
{

cli/_examples/submit/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func main() {
6464
&sbatch.Job{
6565
Resources: &sbatch.JobResources{
6666
Tasks: 1,
67-
CpusPerTask: 1,
67+
CPUsPerTask: 1,
6868
MemPerCPU: 100,
69-
GpusPerTask: 0,
69+
GPUs: 0,
7070
},
7171
Steps: []*sbatch.Step{
7272
{

cli/assets/submit-demo.svg

Lines changed: 1 addition & 1 deletion
Loading

cli/assets/tui-demo.svg

Lines changed: 2 additions & 2 deletions
Loading

cli/cmd/initc/job.schema.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,22 @@
147147
},
148148
"cpusPerTask": {
149149
"$ref": "#/definitions/Int",
150-
"description": "Allocated CPUs per task.\n\nCan be greater or equal to 1.\n\nGo name: \"CpusPerTask\"."
150+
"description": "Allocated CPUs per task.\n\nCan be greater or equal to 1.\n\nGo name: \"CPUsPerTask\"."
151151
},
152152
"memPerCpu": {
153153
"$ref": "#/definitions/Int",
154154
"description": "Allocated memory (MB) per task.\n\nCan be greater or equal to 1.\n\nGo name: \"MemPerCPU\"."
155155
},
156-
"gpusPerTask": {
156+
"gpus": {
157157
"$ref": "#/definitions/Int",
158-
"description": "Allocated GPUs per task.\n\nCan be greater or equal to 0.\n\nGo name: \"GpusPerTask\"."
158+
"description": "Allocated GPUs for the whole job.\n\nTasks can consume the GPUs by setting `GPUsPerTask` at step level.\n\nCan be greater or equal to 0.\n\nGo name: \"GPUs\"."
159159
}
160160
},
161161
"required": [
162162
"tasks",
163163
"cpusPerTask",
164164
"memPerCpu",
165-
"gpusPerTask"
165+
"gpus"
166166
],
167167
"description": "JobResources are the allocated resources for a job in a cluster."
168168
},
@@ -317,15 +317,15 @@
317317
},
318318
"cpusPerTask": {
319319
"$ref": "#/definitions/Int",
320-
"description": "Allocated CPUs per task.\n\nCan be greater or equal to 1.\n\nIf null, defaults to the job resources.\n\nGo name: \"CpusPerTask\"."
320+
"description": "Allocated CPUs per task.\n\nCan be greater or equal to 1.\n\nIf null, defaults to the job resources.\n\nGo name: \"CPUsPerTask\"."
321321
},
322322
"memPerCpu": {
323323
"$ref": "#/definitions/Int",
324324
"description": "Allocated memory (MB) per task.\n\nCan be greater or equal to 1.\n\nIf null, defaults to the job resources.\n\nGo name: \"MemPerCPU\"."
325325
},
326326
"gpusPerTask": {
327327
"$ref": "#/definitions/Int",
328-
"description": "Allocated GPUs per task.\n\nCan be greater or equal to 0.\n\nIf null, defaults to the job resources.\n\nGo name: \"GpusPerTask\"."
328+
"description": "Allocated GPUs per task.\n\nCan be greater or equal to 0.\n\nIf null, defaults to 0.\n\nGo name: \"GPUsPerTask\"."
329329
}
330330
},
331331
"required": [],

cli/cmd/initc/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resources:
88
tasks: 1
99
cpusPerTask: 1
1010
memPerCpu: 200
11-
gpusPerTask: 0
11+
gpus: 0
1212

1313
## The job content
1414
steps:

cli/deepsquare/deepsquare_doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ After settings the allowance, you can submit a job:
9090
&sbatch.Job{
9191
Resources: &sbatch.JobResources{
9292
Tasks: 1,
93-
CpusPerTask: 1,
93+
CPUsPerTask: 1,
9494
MemPerCPU: 100,
95-
GpusPerTask: 0,
95+
GPUs: 0,
9696
},
9797
Steps: []*sbatch.Step{
9898
{

cli/metascheduler/metascheduler_jobscheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ func (c *jobScheduler) SubmitJob(
107107

108108
definition := metaschedulerabi.JobDefinition{
109109
Ntasks: uint64(job.Resources.Tasks),
110-
GpusPerTask: uint64(job.Resources.GpusPerTask),
110+
Gpus: uint64(job.Resources.GPUs),
111111
MemPerCpu: uint64(job.Resources.MemPerCPU),
112-
CpusPerTask: uint64(job.Resources.CpusPerTask),
112+
CpusPerTask: uint64(job.Resources.CPUsPerTask),
113113
StorageType: 0,
114114
BatchLocationHash: hash,
115115
Uses: msUses,

cli/metascheduler/metascheduler_utils.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ func creditsPerMin(
3131
prices metaschedulerabi.ProviderPrices,
3232
definition metaschedulerabi.JobDefinition,
3333
) *big.Int {
34-
// GpuPricePerMin * GpusPerTask
35-
gpusCostPerMinPerTask := new(big.Int).
36-
Mul(prices.GpuPricePerMin, new(big.Int).SetUint64(definition.GpusPerTask))
34+
// GpuPricePerMin * Gpus
35+
gpusCostPerMin := new(big.Int).
36+
Mul(prices.GpuPricePerMin, new(big.Int).SetUint64(definition.Gpus))
3737

3838
// CpuPricePerMin * CpusPerTask
3939
cpusCostPerMinPerTask := new(big.Int).
@@ -44,11 +44,11 @@ func creditsPerMin(
4444
Mul(prices.MemPricePerMin, new(big.Int).SetUint64(definition.MemPerCpu))
4545
memCostPerMinPerTask.Mul(memCostPerMinPerTask, new(big.Int).SetUint64(definition.CpusPerTask))
4646

47-
// creditsPerMin = Ntasks * (cpusPricePerMinPerTask + memPricePerMinPerTask + gpusPricePerMinPerTask)
48-
creditsPerMin := new(big.Int).Set(gpusCostPerMinPerTask)
49-
creditsPerMin.Add(creditsPerMin, cpusCostPerMinPerTask)
47+
// creditsPerMin = Ntasks * (cpusPricePerMinPerTask + memPricePerMinPerTask) + gpusPricePerMinPerTask
48+
creditsPerMin := new(big.Int).Set(cpusCostPerMinPerTask)
5049
creditsPerMin.Add(creditsPerMin, memCostPerMinPerTask)
5150
creditsPerMin.Mul(creditsPerMin, new(big.Int).SetUint64(definition.Ntasks))
51+
creditsPerMin.Add(creditsPerMin, gpusCostPerMin)
5252

5353
return creditsPerMin
5454
}

0 commit comments

Comments
 (0)