Targets & Integration Model
This page describes what a target is from the dAIEdge-VLab’s point of view, how it is packaged as a target repository and a Docker image, and how it becomes visible to the Scheduler through the edgedevice Nomad plugin. If you are integrating a new target, this is the conceptual model behind the practical steps described in the Developer Documentation.
What is a target ?
A target is the hardware board (an OS-based single-board computer, an MCU, …) that actually runs the model. A target is never reached directly by the dAIEdge-VLab : it is physically attached to (or otherwise reachable from) a host machine, and every interaction with the target goes through scripts executed on that host, as described in the Host page.
Because the target is only reachable through the host and can be power-cycled, reflashed, or left in an unknown state between two benchmarks, the dAIEdge-VLab treats it as an unreliable, potentially uninitialized system. Nothing about its state is assumed to persist between two jobs, this is what motivates the strict, four-step execution model described below.
Two identifiers matter when talking about a target :
- The target family (e.g.
rpi5) groups together boards that are hardware-identical, this is what a benchmark request selects astarget. - The target UID uniquely identifies one physical board within a family, obtained when registering a target. It is what links the results produced by a specific board back to it.
The target repository
The scripts needed to run a benchmark on a target live in a dedicated Git repository, the target repository. They are normally baked into the Docker image built from that repository, so the image is self-contained and nothing needs to be fetched at benchmark time. Cloning the repository at runtime instead, directly inside that same developer-provided container, is also supported : it is mainly useful during development, since it lets you update the scripts without rebuilding the whole image (and every dependency in it) each time. See the live script updates reference for the environment variables that control this.
Since the pipeline described below is the same for every target, the target repository must follow a strict folder structure : four mandatory scripts, one per folder, executed in a fixed order.
sequenceDiagram
participant Job as dAIEdge-VLab benchmarking job
participant Repo as Target repository
participant Target
Job->>Repo: support.sh
Repo->>Job: Fetch necessary files (e.g. the model) from the web
Job->>Repo: build.sh
Repo->>Job: Build/cross-compile tools for the target, if needed
Job->>Target: deploy.sh
Target->>Job: Copy the model and scripts onto the target, program it
Job->>Target: manager.sh
Target->>Job: Run the inferences, collect metrics, generate the report
Each script receives the information it needs (model file name, dataset, benchmark type, …) through environment variables provided by the pipeline, see the dAIEdge-VLab Pipeline and the benchmark types pages for the exact contract.
The Docker image
The target repository also defines a Docker image, built from its own dockerfile. Packaging the scripts and every one of their dependencies into a single image means the execution environment is fully reproducible and independent of whatever else is installed on the host, there is nothing to manually install or configure on a host for it to run a given target’s scripts.
When a benchmark job is scheduled, this image is pulled onto the selected host and run by the dAIEdge-VLab benchmarking job container (see Nomad and Docker container), which then executes the four scripts described above against the physically attached target.
Advertising a target to the cluster : the edgedevice plugin
On its own, Nomad only knows about generic node resources (CPU, RAM, disk). It has no notion of “a Raspberry Pi 5 with the ort and tflite engines, currently idle”. To bridge that gap, every host runs a custom Nomad device plugin, edgedevice, alongside Nomad.
The plugin reads the host’s local target.json file, the file where every target attached to that host is declared, and periodically advertises each one to the rest of the cluster as a Nomad device resource with two kinds of attributes :
- Static attributes : target family, supported runtimes/engines, supported benchmark types, …
- Dynamic attributes : whether the target is currently busy and how far along its current job is.
sequenceDiagram
participant Target.json as target.json (Host)
participant Plugin as edgedevice plugin (Host)
participant Nomad as Nomad cluster
participant Scheduler
Plugin->>Target.json: Read declared targets
loop Periodically
Plugin->>Nomad: Advertise device resources + attributes
end
Scheduler->>Nomad: Job with device constraints (family, engine, ...)
Nomad->>Nomad: Match constraints against advertised devices
Nomad->>Plugin: Run job against the matching target's host
This is exactly the mechanism the Scheduler relies on when it writes job constraints such as ${device.attr.family} or ${device.attr.dynamic.progress} : one edgedevice instance per host publishes the attributes of every target physically attached to that host, and the Nomad leader matches a job’s requirements against everything currently advertised across the whole cluster, regardless of which host it is running on.
target.json is therefore the single place where a target becomes visible to the rest of the dAIEdge-VLab. See the target configuration reference for the full file format, and Register a target for how to obtain the target_uid it requires.
target.json (registry credentials, board IP addresses, …) stay local to the host. Only the attributes needed for scheduling are advertised to the cluster.Benchmark types
A target does not have to implement every kind of benchmark. What it declares supporting in target.json (supported_types) determines which of the following it can be scheduled for :
| Type | What it does | Extra input needed |
|---|---|---|
| TYPE1 | Runs inferences on randomly generated data to measure raw performance (latency, …). | None, the simplest service and a good starting point. |
| TYPE2 | Runs inferences on a dataset provided by the user. | A pre-processed dataset. |
| TYPE3 | Trains the model on the target itself (on-device training) instead of only running inference. | A train/test dataset and an on-device training configuration. |
| TYPE4 | Uses the target as a client in a Federated Learning experiment. | Nothing to implement : any target that supports both TYPE2 and TYPE3 is automatically compatible. |
See the Services section for the full implementation details (environment variables, pipeline simulation) of each type.