GPULab API

GPULab uses a simple “REST-like” web API that uses JSON data. This means you can use the API from any app, or browser, using HTTP calls.

Endpoint and authentication

There are 2 different endpoints, with different authentication methods:

Note that when using athe API from a browser, you’ll run into trouble with CORS.

When creating a client app, it is easiest to use SSL client authentication.

API Details

Some example API calls with curl.

Get all Job:

curl -X GET --key $GPULAB_CERT --cert $GPULAB_CERT 'https://gpulab.ilabt.imec.be/gpulab/api/v2.0/jobs?max_hours=900&max_count=100&pending=true&finished=true&running=true'

Get Single Job details:

curl -X GET --key $GPULAB_CERT --cert $GPULAB_CERT 'https://gpulab.ilabt.imec.be/gpulab/api/v2.0/jobs/bd9fd6ba-505d-11e9-94d0-8f0c600a321d'

Create Job:

curl -X POST --key $GPULAB_CERT --cert $GPULAB_CERT -H "Content-Type: application/json" --data '{"jobDefinition":{"name":"test","description":"test","dockerImage":"<MYIMAGE>","command":"","resources":{"gpus":1,"systemMemory":1024,"cpuCores":1,"minCudaVersion":10},"jobDataLocations":[{"mountPoint":"/project"}],"portMappings":[],"clusterId":9},"project":"<MYPROJECT>","email_run":[],"email_done":[]}' https://gpulab.ilabt.imec.be/gpulab/api/v2.0/jobs

Cancel job:

curl -X PUT --key $GPULAB_CERT --cert $GPULAB_CERT -H "Content-Type: text/plain" --data 'CANCELLED' 'https://gpulab.ilabt.imec.be/gpulab/api/v2.0/jobs/bd9fd6ba-505d-11e9-94d0-8f0c600a321d/state'