Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated documentation link

...

Textstyles
Colorrgb(236,0,140)

DRAFT - WORK IN PROGRESS | Services are in active development and are subject to change

...

The Remote Job Submission API enables integration of Charity Engine as a backend service and provides functions for managing the entire lifecycle of jobs submitted to the network.

Info

See Computing with Charity Engine for a contextual overview of the Charity Engine ecosystem (including additional interfaces such as Remote CLI, Ethereum Smart Contract, and Ethereum Dapp).

...

Also see External APIs, which lists APIs that the Remote API is able to call.

API definition

Open API (Swagger) Integration for Confluence
displayRequestDurationtrue
showExtensionstrue
urlhttps://api.bitbucket.org/2.0/repositories/gridrepublic/ce-apis/src/main/remote-job-submission-api-v2.yaml

External APIs (draft)

Charity Engine can call the following API endpoints upon circumstances outlined in this document. An HTTP POST request with JSON payload will be dispatched to a URL hosted by the compute provider or other external services.

...

Code Block
languagejs
ComputeCapacity[] capacity // List of ComputeCapacity objects, one per instance type that is being reserved.

float duration // Maximum number of hours the compute capacity is reserved for. Compute payloads may exit early. 

...

Code Block
languagejs
int count // Number of successfully launched instances.

string error // Error message, if any. Optional.

...

To use cURL to submit a job from a .json file:

Code Block
languagetextbash
$ curl -v "content-type: application/json" https://api.charityengine.services/remotejobs/v2/job-create -d @example-job-create.json

Contents of the POST data (example-job-create.json file):

Code Block
languagetextbash
{
  "authenticator":"c503d86bc4e82d9415cb5912a0986c80",
  "app":"charityengine:wolframengine",
  "commandLine":"math 2+2 > output/out.txt",
  "specs": {
    "vcpus":2,
    "ram": 512,
    "disk": 512,
    "networkDownload": 0,
    "networkUpload": 0
  },
  "hours": 1,
  "inputFiles": [
    {
      "filename": "in.txt",
      "url": "http://work.charityengine.com/rytis/mathtest.m"
    }
  ]
}

...