stencila / executa

⚡ Execution engine for executable documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discovery of peer executors

nokome opened this issue · comments

I propose to reinstate the files based Executor registration and discovery mechanism that we had previously. This time around however we will keep it simpler by using STDIO where possible (e.g

Previously the approach was...Executors (f.k.a. Hosts) register() themselves by creating a JSON file containing their "manifest". For example, the Python host created the following ~/.stencila/hosts/py.json file here

{
 "id": "py-host-6494cd21-0424-4dda-a407-8e5d2957d652", 
 "stencila": {
  "package": "py", 
  "version": "0.0.0"
 }, 
 "spawn": [
  "/usr/bin/python", 
  "-m", 
  "stencila", 
  "spawn"
 ], 
 "environs": [
  {
   "version": null, 
   "id": "local", 
   "name": "local"
  }
 ], 
 "types": {
  "SqliteContext": {
   "client": "ContextHttpClient", 
   "name": "SqliteContext"
  }, 
  "PythonContext": {
   "client": "ContextHttpClient", 
   "name": "PythonContext"
  }
 }
}

The Node Host scanned the relevant directory for those JSON files to discover peers that it could then spawn in response to client requests for alternative types of execution contexts.

In this iteration, we would still need the spawn property, but instead of types would have capabilities ala this.

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀