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.

This API is only minimally documented below. If you need more info, contact us at gpulab@ilabt.imec.be.

Endpoint and authentication

The endpoint for the production GPULab is: https://gpulab.ilabt.imec.be/api/gpulab/v3.0/

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 on a custom site you make, you’ll run into trouble with CORS. You’ll need to contact us to get that to work.

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

API Details

Some example API calls with curl (APIv3 and Job2 format).

Get all Job:

curl -X GET --key $GPULAB_CERT --cert $GPULAB_CERT 'https://gpulab.ilabt.imec.be/api/gpulab/v3.1/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/api/gpulab/v3.1/jobs/bd9fd6ba-505d-11e9-94d0-8f0c600a321d'

Create Job:

curl -X POST --key $GPULAB_CERT --cert $GPULAB_CERT -H "Content-Type: application/json" --data '{"name": "test","request": {"resources": {"cpus": 1,"gpus": 1,"cpuMemoryGb": 1,"minCudaVersion": 10,"clusterId": 9},"docker": {"image": "<MYIMAGE>","storage": [{"hostPath": "/project_ghent"}]},"scheduling": {"interactive": false,"restartable": false}},"description": "test","extra":{"emailOnRun":["me@example.com"],"emailOnEnd":["me@example.com"]}}' https://gpulab.ilabt.imec.be/api/gpulab/v3.1/jobs

Cancel job:

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

Examples

Some examples of using the GPULab API in applications: