WorkloadRequirements platform.workload-requirements@1

Generated at from openvibe-contracts v0.79.0 and openvibe-sdk v0.25.0.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/platform/workload-requirements.v1.json

What a workload needs, so the platform can place it (roadmap WS-Z9). Hard constraints are filtered before any objective is scored; a cheaper candidate that misses one is never chosen.

Fields

FieldTypeRequiredDescriptionConstraints
kindstringyeswhat runs, e.g. watch.browser, media.transcode, ai.run, events.deliver
mobilityenumyes
  • one of "request", "job", "session", "stateful-partition"
latency_classenumyes
  • one of "realtime", "interactive", "background", "bulk", "critical"
objectiveenumyes
  • one of "cheapest", "lowest-latency", "balanced", "private", "local-only", "first-party-only", "high-reliability", "correctness"
max_latency_msnumber
  • minimum 0
deadline_msnumber
  • minimum 0
max_cost_usdnumber
  • minimum 0
durabilityenum
  • one of "none", "at-least-once", "authoritative"
residencystringregion or jurisdiction the work and its data must stay in
trustarray of enumtrust levels allowed to run it
  • minItems 1
  • items: one of "first-party", "partner", "community", "external"
regionstringa region, or 'nearest'
capabilitiesarray of stringcapabilities a candidate must offer (worker:browser, …)
resourcesobject
  • no other fields
resources.cpunumber
  • minimum 0
resources.memory_mbnumber
  • minimum 0
resources.gpuboolean
resources.scratch_gbnumber
  • minimum 0
resources.egressenum
  • one of "none", "public", "openvibe-only"
project_idstring
  • pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$
partition_keystringstable key for rendezvous placement (room, stream, session)

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: browser-watch
{
  "kind": "watch.browser",
  "mobility": "job",
  "latency_class": "interactive",
  "objective": "balanced",
  "max_latency_ms": 1000,
  "max_cost_usd": 0.002,
  "durability": "at-least-once",
  "trust": [
    "first-party",
    "partner"
  ],
  "region": "nearest",
  "capabilities": [
    "worker:browser"
  ],
  "resources": {
    "cpu": 2,
    "memory_mb": 1024,
    "egress": "public"
  }
}
Valid: ledger
{
  "kind": "billing.post",
  "mobility": "stateful-partition",
  "latency_class": "critical",
  "objective": "correctness",
  "durability": "authoritative"
}
Rejected: no-mobility
{
  "kind": "x",
  "latency_class": "background",
  "objective": "cheapest"
}
Rejected: unknown-objective
{
  "kind": "x",
  "mobility": "job",
  "latency_class": "background",
  "objective": "free"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('platform.workload-requirements@1', value);   // { valid, errors: [{ path, message }] }