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

The endpoint for the production GPULab is:

There are 2 different authentication methods:

  • SSL client authentication
  • OAuth authentication

If you don’t use SSL client authentication, and haven’t set the needed OAuth cookies, you’ll be automatically redirected to the oauth login page.

Note that when using the 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 (These examples are for APIv2 and Job1 format. Current tools use APIv3 and Job2 format!).

Get all Job:

curl -X GET --key $GPULAB_CERT --cert $GPULAB_CERT ''

Get Single Job details:

curl -X GET --key $GPULAB_CERT --cert $GPULAB_CERT ''

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":[]}'

Cancel job:

curl -X PUT --key $GPULAB_CERT --cert $GPULAB_CERT -H "Content-Type: text/plain" --data 'CANCELLED' ''