Skip to main content

SPHERE deployment (and demos)

Deploy Owl alongside your experiment to observe its nodes and links and replay recorded activity. This guide starts with your own materialized SPHERE experiment: choose a node for RabbitMQ and the Owl server, install the owl CLI on the nodes that will publish observations, and attach an Owl XDC to view them. Your scripts and applications decide which observations to publish.

The supplied demos are optional examples at the end of this page. For everyday viewing and playback, see the browser guide.

Prerequisites​

  • A SPHERE account and a materialized experiment containing the nodes you want to observe. If you are starting a new experiment, follow the experiment walkthrough first.
  • An Ubuntu experiment node to host RabbitMQ and the Owl server, with enough storage for event history and access to the configured container registries.
  • Ubuntu nodes on which you want to install the owlclient package to publish observations, with access to the SPHERE package repository.
  • An Owl XDC attached to the realization, or a management host that can reach the experiment nodes over SSH. You need privilege escalation on the nodes where the playbooks install services or packages.
  • Git, Ansible's ansible-playbook, and the community.docker collection on the XDC or management host where you run the playbooks.

If the Docker collection is not already installed on that host:

ansible-galaxy collection install community.docker

Attach an Owl XDC​

If you need to create the viewer XDC, use the SPHERE CLI:

mrg new xdc XDC_NAME --image owl --type personal

Attach it to your experiment's realization through Launch or the XDC attachment workflow. Open its Owl link in Launch and record the Attached stream ID. It has the form REALIZATION.EXPERIMENT.PROJECT (rid.eid.pid); use that same ID in all publishers that should appear in this viewer. A detached XDC shows Waiting for attachment.

The viewer retrieves the experiment model from the SPHERE portal and can display the experiment topology before any observations have been published. Installing Owl does not automatically collect network activity.

Download the deployment repository​

The SPHERE deployment repository contains the service playbooks and optional demo models. Owl's components are separate repositories.

Open a shell in the attached XDC, or use a management host with SSH access to the experiment nodes. Download the repository there and enter its directory:

mkdir -p ~/src/owl/deploy
git clone https://gitlab.com/mergetb/frontends/owl/deploy/mergetb.git ~/src/owl/deploy/mergetb
cd ~/src/owl/deploy/mergetb

If GitLab requires authentication, use a GitLab account with read access to the repository and a token with read_repository access when prompted for a password. If you already have this checkout on the same machine, enter its directory instead of cloning it again. A checkout on your workstation must also be downloaded to the XDC if that is where you will run the playbooks.

Run the remaining playbook commands from ~/src/owl/deploy/mergetb/ unless stated otherwise. You do not need to build the server or CLI from source: the playbooks install the configured container images and packages.

Define your experiment inventory​

Create a directory for your deployment configuration:

mkdir -p experiments/my-experiment

Save an inventory as experiments/my-experiment/inventory. For example, an experiment with backend node observer and publishing nodes app1 and app2 could use:

[all:vars]
ansible_python_interpreter=/usr/bin/python3

[control]
observer

[owlclients]
app1
app2

Replace these names with SSH-reachable hosts from your experiment. Use ansible_host, ansible_user, or your SSH configuration where needed. The control group selects the node that hosts Docker, RabbitMQ, and the Owl server; the node itself does not have to be named control. The owlclients group selects the nodes where the playbooks configure the package repository and install owlclient. Add the backend node to owlclients too if it will publish events or needs the CLI.

my-experiment is a local configuration directory name, independent of your SPHERE experiment name and the viewer's stream ID. This deployment needs an inventory; it does not require a supplied demo model, peer list, or event generator configuration.

Configure and install the services​

Before running deployment, review:

FileSettings to review
rabbitmq-vars.ymlSet rabbitmq_password to your chosen password.
owlserver-vars.ymlSet the matching owlserver_rabbit_password, server image/tag, registry access, host binding/port, and log settings.
experiments/my-experiment/inventorySelect your backend host in control and your publishing hosts in owlclients.

Replace the checked-in NEW_URI_SAFE_PASSWORD placeholder in both password settings with the same value. RabbitMQ's initial user/password settings apply only to an empty data directory; changing a variable does not rotate an existing broker account. Choose a server image/tag that supports the event schema you intend to use; the checked-in tag may need updating.

Run the service deployment playbook with your inventory:

ansible-playbook -i experiments/my-experiment/inventory \
-e @rabbitmq-vars.yml -e @owlserver-vars.yml deploy.yml

This installs Docker and Compose, RabbitMQ, and the Owl server on the control group, and the SPHERE package repository and owlclient package on owlclients. It does not install or start an event generator. The ./scripts/deploy.sh helper also installs a demo generator and is covered in Demos below.

RabbitMQ and the Owl server use containers with Compose directories /opt/rabbitmq and /opt/owlserver. RabbitMQ stores history in a Docker named volume. The server connects to RabbitMQ on port 5552 over their shared Docker network; the broker's management UI is bound to localhost.

Connect the viewer and publishers to your backend​

Use the backend node's reachable address and the published port configured in owlserver-vars.yml. With the example inventory and default port, publishers on experiment nodes might use http://observer.infra. Replace that address if your experiment uses a different hostname or route.

The XDC viewer defaults to backend control:80. If your backend is named observer, configure its OWL_UPSTREAM_HOST to an address reachable from the XDC, such as observer, and its OWL_UPSTREAM_PORT to the published port. These are XDC web server settings, not variables in your publishing shell; see viewer deployment for configuration details. The Ansible inventory's group name does not change the viewer's backend address.

Keep backend access within the intended private experiment network: direct Owl requests have no login checks. The viewer applies Launch and materialization access checks only to requests through its own proxy.

Publish observations from your experiment​

On a node in owlclients, use your backend URL, the viewer's attached stream ID, and a node name from your experiment model. For the example inventory:

owl --server http://observer.infra --owlid REALIZATION.EXPERIMENT.PROJECT \
send node app1 --state ok --message "Application ready"
owl --server http://observer.infra --owlid REALIZATION.EXPERIMENT.PROJECT \
send link app1 app2 --state warning --message "Measured packet loss"

Publish link observations only for endpoint pairs connected in your model. The experiment model defines every experiment node name. Use those names to update experiment nodes; observations with names outside the model create additional visualization nodes for observability purposes. Link observations update existing two-node links.

Call the CLI from your experiment scripts when measurements or application state change, or integrate the Owl API directly. See the CLI guide for persistent server/stream configuration and the event examples for legends and snapshots. Publish a legend to explain your chosen states, colors, and shapes. The viewer retrieves the experiment model from the SPHERE portal to build its initial topology; you do not need to publish a topology snapshot for it to appear.

In the viewer, select Play from offset 0 to include earlier observations and any startup legend. Select Live to receive only new events. Stop your own publishing scripts or services to stop generating observations. The viewer's Stop button closes that browser's reader; it does not stop publishers or remove history.

Check a deployment​

From a host with the CLI and access to the backend, read the same stream as the viewer, replacing the URL with your backend's address:

owl --server http://observer.infra --owlid REALIZATION.EXPERIMENT.PROJECT \
get stream 0 --speed 0

The reader prints stored events and waits for new ones. Press Ctrl+C to stop reading. On the backend node, inspect the containers with:

sudo docker ps
sudo docker logs --tail 50 owlserver
sudo docker logs --tail 50 rabbitmq

Server startup logs currently include broker credentials; keep them private.

ProblemCheck
Ansible cannot reach hostsXDC attachment, inventory hostnames, SSH access, and privilege escalation.
Container pull failsServer image repository/tag and registry credentials on the backend node.
Publishing failsBackend address/port, matching broker credentials, and enabled stream plugin. See server setup.
CLI reads events but the viewer does notMatch the attached stream ID and check the XDC's upstream host/port and materialization access.
Event appears in the feed but not in the topologyMatch the model's node names and connected two-node endpoint pairs.
Script flags or event kinds are unsupportedUse CLI and server builds that support the documented event schema. Deployment installs configured builds.
Stream refills after deletionStop your publishers before clearing history.

Stopping publishers preserves RabbitMQ's data volume and your SPHERE realization. Tear down the realization and XDC through your normal testbed workflow when finished. Removing RabbitMQ's data volume erases stored history for every stream on that broker.

Use a locally built CLI​

Download the CLI source on the same XDC or management host. Build a Linux binary appropriate for the publishing nodes, then copy it to your inventory's owlclients group. For amd64 nodes:

cd ~/src/owl/cli
make build-amd64
cd ~/src/owl/deploy/mergetb
./scripts/copy-cli.sh --experiment my-experiment --binary ~/src/owl/cli/build/owl-amd64

For this helper, --experiment selects the directory under experiments/. It installs the executable as /usr/local/bin/owl, which takes precedence over the packaged CLI. Restart any publishing services that should use the updated binary.

Demos​

The repository also includes sample experiment models and event generators. Use these to try Owl before instrumenting your own experiment or to see how to publish legends, snapshots, and characteristic changes.

Demo directoryBehavior
starA server with ten clients; ongoing random node and link observations.
treeA tree of nodes; ongoing random node and link observations.
attackA roughly 45-second scripted incident with three sources and two targets: reconnaissance, simulated request flood, containment, and recovery.

Deploy and run a demo​

From a checkout on a host with SPHERE's mrg CLI and experiment modeling tools, deploy a supplied model with your actual experiment and project names:

cd ~/src/owl/deploy/mergetb
mrg deploy experiments/star/model.py -e EXPERIMENT -p PROJECT

Complete the realization and materialization workflow and attach an Owl XDC to that realization. Download the deployment repository in that XDC too if needed, using the download instructions. Use the viewer's Attached stream ID in the deployment command below. Review rabbitmq-vars.yml, owlserver-vars.yml, and the selected demo's inventory and owl-events-vars.yml before running:

./scripts/deploy.sh --experiment star --owl-id REALIZATION.EXPERIMENT.PROJECT
./scripts/events.sh --experiment star start

Here, --experiment star selects the local experiments/star/ directory; it is not the SPHERE experiment name. The demo deployment helper installs the backend, CLI packages, and the demo's generator and systemd service. It does not start publishing until you run events.sh ... start.

On startup, the demo's server node publishes its legend and a complete topology snapshot derived from owl_event_peers. The star and tree demos then publish ongoing random node and link changes. Play from offset 0 to include startup records. Live mode skips events published before connecting.

To stop the demo generator while keeping its history for replay:

./scripts/events.sh --experiment star stop

To run the tree demo, use experiments/tree/model.py and replace star with tree in the helper commands.

Run the scripted incident demo​

The attack demo publishes visualization events only; it does not generate network attack traffic. Its generator runs once on server. Source-to-target links turn orange during reconnaissance, red during the simulated flood, teal during rate limiting, and gray after recovery. Messages, narratives, and temporary states explain the phases; see the browser walkthrough.

Deploy and materialize experiments/attack/model.py, attach the Owl XDC, then run with that realization's stream ID:

./scripts/deploy.sh --experiment attack --owl-id REALIZATION.EXPERIMENT.PROJECT
./scripts/events.sh --experiment attack start

Play from 0 to watch the entire scenario. The service completes after one run, so selecting Live after completion produces no new observations. To run it again, use events.sh --experiment attack stop followed by start. Runs append to the existing stream; delete history deliberately if you want a fresh recording, then start the demo again.

Configure a demo generator​

Each demo's experiments/NAME/owl-events-vars.yml controls its event source:

VariablePurpose
owl_event_serverBackend URL for demo publishing; defaults to http://control.infra.
owl_event_peersNode-to-peer mapping used by the random generator and topology snapshot.
owl_event_legend_entriesDescriptions of the demo's states, colors, and shapes.
owl_event_interval_secondsBase delay between random generator cycles.
owl_event_jitter_secondsAdditional random delay, including startup jitter.
owl_event_script_sourceScript to install, relative to the deployment checkout; defaults to scripts/owl-events.sh.
owl_event_scenario_secondsDuration setting for the attack demo.

Installed settings are in /etc/default/owl-events, the script is /usr/local/bin/owl-events, and the systemd unit is owl-events.service. Snapshot JSON files are placed in /etc/owl-events/ on server by default. The generator service is not enabled to start at boot.

After changing a script, legend, peers, or timing, rerun the demo deployment and restart the generator with stop followed by start. This republishes startup snapshots. Start alone does not restart an already running service. If adapting a demo topology, update its model, inventory, and event peers together; publishing a topology snapshot does not replace the experiment model or the viewer's initial topology derived from it.

Inspect a demo generator on its publishing node with:

systemctl status owl-events.service
journalctl -u owl-events.service -n 50 --no-pager