Ticket 9990 - Questions regarding restd
Summary: Questions regarding restd
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: slurmrestd (show other tickets)
Version: 20.02.5
Hardware: Linux Linux
: 3 - Medium Impact
Assignee: Nate Rini
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2020-10-14 08:07 MDT by Simran
Modified: 2020-12-09 14:04 MST (History)
0 users

See Also:
Site: Roche/PHCIX
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed: 20.11.0
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
patch for 20.02 (2.26 KB, patch)
2020-10-14 13:09 MDT, Nate Rini
Details | Diff

Note You need to log in before you can comment on or make changes to this ticket.
Description Simran 2020-10-14 08:07:36 MDT
Hello,

Our developers are building some automation by using slurm's API and have the following questions:

1 - From the spec https://github.com/SchedMD/slurm/blob/slurm-20.02/src/slurmrestd/openapi.json
In the following API to submit a job, script parameter is missing. Script parameter is needed to specify the command.
POST
/slurm/v0.0.35/job/submit

Like it is shown in the preso https://slurm.schedmd.com/SLUG19/REST_API.pdf,
$ cat demo 
● POST /slurm/v1/job/submit HTTP/1.1 
● Accept: text/yaml 
● Content-Type: application/json 
● Content-Length: 348 
● {"job": {"account": "test", "ntasks": 20, "name": "test18.1", "nodes": [2, 4], "current_working_directory": "/tmp/", "user_id": 1000, "group_id": 1000, "environment": {"PATH": "/bin:/usr/bin/:/usr/local/bin/","LD_LIBRARY_PATH": "/lib/:/lib64/:/usr/local/lib"} }, "script": "#!/bin/bash\necho it works"}

2 - Regarding JWT based authentication. Will slurmrestd be able to verify the JWT signed by DKube? Or do we need a proxy infront of it which can use DKube as a JWKS verifier?

Thanks,
-Simran
Comment 1 Simran 2020-10-14 09:00:23 MDT
Also, is there any documentation to enable and run slurmrestd?  

Thanks,
-Simran
Comment 2 Simran 2020-10-14 11:48:38 MDT
I just tried to build slurm 20.02.5 from source and did not get the slurmrestd binary.  Is there some pre req's for slurmrestd that we will need to satisfy?  Would be good to see documentation around installing/configuring slurmresd.  Seems like there is some high level info on schedmd's site but nothing in too much detail, but I am might be missing something.

Thanks,
-Simran
Comment 3 Nate Rini 2020-10-14 12:10:04 MDT
(In reply to Simran from comment #0)
> 1 - From the spec
> https://github.com/SchedMD/slurm/blob/slurm-20.02/src/slurmrestd/openapi.json
> In the following API to submit a job, script parameter is missing. Script
> parameter is needed to specify the command.
> POST
> /slurm/v0.0.35/job/submit
We will get that patched in for 20.02.6+.
 
> 2 - Regarding JWT based authentication. Will slurmrestd be able to verify
> the JWT signed by DKube? Or do we need a proxy infront of it which can use
> DKube as a JWKS verifier?
I'm unfamiliar with DKube but it should work as long as the correct fields are present and it is signed with the same key.

Fields:
> sun -> username
> exp -> unix timestamp of expiration date

(In reply to Simran from comment #1)
> Also, is there any documentation to enable and run slurmrestd?
The man page should have everything required to run it:
> https://slurm.schedmd.com/slurmrestd.html

If you have any questions after checking the man page, we can always append to it.

(In reply to Simran from comment #2)
> I just tried to build slurm 20.02.5 from source and did not get the
> slurmrestd binary.  Is there some pre req's for slurmrestd that we will need
> to satisfy?
Yes, under "Prerequisites":
> https://slurm.schedmd.com/rest.html

You may need to look at your config.log (or attach it) to see why it is not being built.

> Would be good to see documentation around
> installing/configuring slurmresd.  Seems like there is some high level info
> on schedmd's site but nothing in too much detail, but I am might be missing
> something.
In general, as long as the Prerequisites are found and "--disable-slurmrestd" is not specified, it should install along with all the other Slurm daemons. The config.log should error/warn when Prerequisites are not found per autotools.

If the docs are still lacking, we will be happy to improve them with more details.

Thanks,
--Nate
Comment 4 Simran 2020-10-14 12:16:25 MDT
(In reply to Nate Rini from comment #3)
> (In reply to Simran from comment #0)
> > 1 - From the spec
> > https://github.com/SchedMD/slurm/blob/slurm-20.02/src/slurmrestd/openapi.json
> > In the following API to submit a job, script parameter is missing. Script
> > parameter is needed to specify the command.
> > POST
> > /slurm/v0.0.35/job/submit
> We will get that patched in for 20.02.6+.

Thanks Nate.  When will 20.02.6+ be available with that patch?  Does this mean that we can't use the api to submit a job using a script/command?  

>  
> > 2 - Regarding JWT based authentication. Will slurmrestd be able to verify
> > the JWT signed by DKube? Or do we need a proxy infront of it which can use
> > DKube as a JWKS verifier?
> I'm unfamiliar with DKube but it should work as long as the correct fields
> are present and it is signed with the same key.
> 
> Fields:
> > sun -> username
> > exp -> unix timestamp of expiration date
> 
> (In reply to Simran from comment #1)
> > Also, is there any documentation to enable and run slurmrestd?
> The man page should have everything required to run it:
> > https://slurm.schedmd.com/slurmrestd.html
> 
> If you have any questions after checking the man page, we can always append
> to it.
> 
> (In reply to Simran from comment #2)
> > I just tried to build slurm 20.02.5 from source and did not get the
> > slurmrestd binary.  Is there some pre req's for slurmrestd that we will need
> > to satisfy?
> Yes, under "Prerequisites":
> > https://slurm.schedmd.com/rest.html
> 
> You may need to look at your config.log (or attach it) to see why it is not
> being built.
> 
> > Would be good to see documentation around
> > installing/configuring slurmresd.  Seems like there is some high level info
> > on schedmd's site but nothing in too much detail, but I am might be missing
> > something.
> In general, as long as the Prerequisites are found and
> "--disable-slurmrestd" is not specified, it should install along with all
> the other Slurm daemons. The config.log should error/warn when Prerequisites
> are not found per autotools.
> 
> If the docs are still lacking, we will be happy to improve them with more
> details.
> 
> Thanks,
> --Nate
Comment 5 Nate Rini 2020-10-14 12:20:19 MDT
(In reply to Simran from comment #4)
> > We will get that patched in for 20.02.6+.
> 
> When will 20.02.6+ be available with that patch?
Current plan is sometime in October. Release times vary due to QA testing and having to correct regressions.

> Does this mean that we can't use the api to submit a job using a script?
The OpenAPI spec (OAS) provided is to make it easier for client and documentation generation. Job submission should work fine when the "script" field is in the job request, if not that is a different and more pressing issue then OAS being out of sync.
Comment 6 Nate Rini 2020-10-14 13:09:35 MDT
Created attachment 16218 [details]
patch for 20.02
Comment 11 Nate Rini 2020-11-17 14:20:25 MST
(In reply to Nate Rini from comment #5)
> (In reply to Simran from comment #4)
> > > We will get that patched in for 20.02.6+.
> > 
> > When will 20.02.6+ be available with that patch?
> Current plan is sometime in October. Release times vary due to QA testing
> and having to correct regressions.

20.02.6 has been released but we missed the patch window.

Please note that 20.11.0 has changes.
Comment 12 Nate Rini 2020-11-17 20:21:42 MST
(In reply to Nate Rini from comment #11)
> Please note that 20.11.0 has changes.
Looks like that got sentence got cut off.

20.11.0 has the changes to add "script" for job submission in the OpenAPI specification.
Comment 13 Nate Rini 2020-12-09 14:04:40 MST
After consulting internally, slurm-20.02 is being limited to only critical/security bug fixes and we suggest using slurm-20.11.

If you have any more questions, please respond. Otherwise, I'm going to close this ticket.