I have been trying to submit the slurm GRES flag through the REST API however, I couldn’t find a way to do the same through the REST APIs. I am using the parser version 0.0.40
Is this something not yet available? Is there a work around?
This is what I tried.
url: /slurm/0.0.40/job/submit
method: POST
data: {
"script":"#!/bin/bash n nvidia-smi",
"job": {
"environment": ["PATH=/bin/:/usr/bin/:/sbin/"],
"gres":"gpu:2",
"time_limit": 120,
"name":"test-gpu",
"standard_output":"output/slurmout-%j.out",
"current_working_directory":".../slurmapis/5fcceebe-f538-40fa-99c4-66faa71945f7"
}
}
This is the response I get
{
"result":{
"job_id":64426478,
"step_id":"batch",
"error_code":0,
"error":"No error",
"job_submit_user_msg":""
},
"job_id":64426478,
"step_id":"batch",
"job_submit_user_msg":"",
"meta":{
"plugin":{
"type":"openapi/slurmctld",
"name":"Slurm OpenAPI slurmctld",
"data_parser":"data_parser/v0.0.40",
"accounting_storage":"accounting_storage/slurmdbd"
},
"client":{
"source":"[host.name]:54014",
"user":"root",
"group":"root"
},
"command":[
],
"slurm":{
"version":{
"major":"23",
"micro":"4",
"minor":"11"
},
"release":"23.11.4",
"cluster":"clustername"
}
},
"errors":[
],
"warnings":[
{
"description":"Expected OpenAPI type=object (Slurm type=dictionary) but got OpenAPI type=integer (Slurm type=64 bit integer)",
"source":"#/job/time_limit/"
},
{
"description":"Ignoring unknown field ""gres"" of type string in DATA_PARSER_JOB_DESC_MSG",
"source":"#/job/gres/"
}
]
}