The shiny new Process API, fleshed out

0
1

By Gert-Jan Insurgent

Golem’s Process API has launched into testnet three weeks in the past – thanks, everybody, that’s been serving to out with suggestions!

Now it’s time to dig a bit bit deeper into what that is, and what it means for the Golem customers. To make this text extra dev-oriented, to provide our customers a deeper dive into the API.

Let’s begin by the fundamentals and dive deeper all through the article:

What’s the Process API? The Process API is a python library containing a programming interface and utility capabilities. When utilizing this library for his or her mission, builders are capable of construct apps and have them simply run on the present Golem’s testnet.

Because of the Process API you’ll be able to leverage all of the computing energy within the Golem Community and never depend on centralized cloud suppliers.

In additional layman phrases, the Process API is an settlement or protocol between Golem and apps to allow them to interoperate. Golem is ready to load computational environments the place apps can run. All these layers have been cut up so we are able to add environments (like docker, gWASM ) and apps ( like blender, and tutorialapp ).

How did you construct this? What we technically did to implement was to separate these layers. Golem needed to load docker CPU and docker GPU as the underside layer, the computational environments. On high of this, we construct an app supervisor, a element that is ready to load apps from the data-dir and let the consumer allow them. Then we added a `TaskManager` for the requestor to handle the requested process state and be the bridge between the community ( TaskSession ) and the apps/environments. Final however not least, we added a brand new TaskComputer for the supplier facet, this can be a bridge between the TaskSession and apps/environments on the offering facet. And, because the cherry on high, we additionally added unit exams and integration exams for all these parts, a few of which builders can use to check their apps earlier than loading them into Golem.

Who can use the Process API? Each Golem consumer, no matter their technical competencies, can leverage the Process API energy in a manner or one other.  The builders can construct apps, the requestors to make use of apps and lease computing energy utilizing check tokens (for now, as once we launch to mainnet you can be utilizing GNT) and the suppliers to run apps and commerce CPU for tGNT (testGNT). The Process API is our second step (the primary one being our second use-case, gWASM) in an effort to combine the primary consumer group for the Golem Community, software program builders.

The shiny new Task API fleshed out

Need a extra technical rationalization?

The Process API is:

  • A GitHub repo with a code library task-api
  • A protocol definition: these are messages and capabilities describing how the task-api consumer and server work together. The library used for that is protobuf
  • A python implementation with:
    • interfaces and helpers for a consumer and server, the library used for that is grpclib
    • helper capabilities for testing
      — construct instruments ( in progress )
  • a task-api consumer implementation contained in the Golem core
    • environments and runtimes (a runtime is a computation job like requesting or offering a process.)
      • computational environments, a docker put in on the system and configured correctly, that spawn runtime when an software is run (at present, docker_cpu and docker_gpu are the one environments out there)
      • purposes, aka task-api servers
      • software descriptor JSON information within the data-dir
      • loaded, registered and benchmarked on startup
        — enabled by the consumer
  • purposes, aka task-api servers
    • App descriptor file:
      • Identify
      • Model
      • requestor conditions ( docker picture )
      • Surroundings
      • Market technique
    • this JSON file is barely required by the requestor, the supplier must whitelist the prerequisite supply in an effort to choose up the duty
      help for any task-api server in any surroundings.
      • purposes could be added for requestors by including the JSON to the golem data-dir
      • all purposes could be supplied for so long as the surroundings is enabled and the prerequisite supply is whitelisted
      • environments could be added in golem core releases
  • a task-api server implementation in blenderapp and tutorialapp
    • blenderapp is an extraction of the present blender logic in golem core
    • tutorialapp is an instance software operating a easy proof of labor computation

Are you able to tackle the problem and check out the brand new Golem Process API?

Then go for it! Get began with our docs over right here.

As a word, we wish to let you realize that though we can not keep away from unhealthy actors from forking current apps – we’d wish to ask you to make use of Golem responsibly and actually.

Our objective is to create a free ( not as in “free beer”, however as in freedom ) and open market place the place anybody can add what they need, but in addition be respectful of others.


Further helpful hyperlinks:

Operating a blender process on the present testnet

Constructing and operating the `tutorialapp` domestically

https://github.com/golemfactory/task-api

https://github.com/golemfactory/blenderapp

https://github.com/golemfactory/tutorialapp

Supply hyperlink