dxos / gravity

System testing frameworks.
GNU Affero General Public License v3.0
1 stars 1 forks source link

Rationalize testing frameworks #7

Open richburdon opened 4 years ago

richburdon commented 4 years ago

Gravity should contain a set of low-level testing modules and a SMALL number of non-redundant testing frameworks (or harnesses/testbenches).

Types of test

Use cases

Notes

Design issues

Candidate repos to merge:

Naming

In the design and code let’s use the word node consistently instead of agent. Node orchestrator, factory, etc. you spawn a node. INSIDE the node runs a bot or agent. The bot/agent is user code that may be instantiated via ipfs etc.

Nodes are peers of each other. Bots are a kind if agent. They create a Client object to interact with parties and manipulate data. But other summer kinds of agents can be instantiated within a node. Eg a random number agent that just logs numbers. Or a logging agent that just logs events.

Related: https://github.com/dxos/gravity/pull/4

dmaretskyi commented 4 years ago

Agent testing

Goals

Architecture

Remote testing mechanism

  1. Orchestrator spawns centralized infrastructure: IPFS node, signaling server
  2. Bundles for remote execution are created and distributed (either with node or/and browser)
    • All machines connect to central IPFS node to mitigate long IPFS sync times
    • IPFS bundles should be split into multiple files:
      • Archive with agent sources
      • Archive with node_modules
      • Extra binaries: node, browser, webrtc
      • Manifest that describes how to unpack the bundle
    • This bundle format is designed to capitalise on IPFS file caching and also combine small JS files into a single archive for performance reasons
  3. Remote bot factories are launched in test mode and allow spawning agents by their IPFS hash & IPFS node URL
  4. An RPC channel is created from orchestrator to each agent
    • This can reuse our existing network swarming solutions provided we can achieve a star topology around orchestrator
richburdon commented 4 years ago

Discussion

Eventually

Example

const nodeGenerator = (env) => {
  const { feedStore } = env;
  return new Client({ feedStore });
}