Skip to main content

Viewer deployment

The Owl viewer is already deployed on SPHERE and available through the owl XDC image. To use it, create an XDC with that image and attach it to your experiment's realization.

Use the viewer on SPHERE​

Create an Owl XDC using the SPHERE CLI:

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

Attach it to your realization through Launch or the XDC attachment workflow, then open the XDC's Owl link in Launch. Sign in with your SPHERE account if prompted. The viewer selects the attached realization's stream automatically.

For viewing and playback controls, see the browser user guide. Your experiment also needs an Owl backend and publishers; follow SPHERE deployment to set those up in your experiment.

Local XDC deployment reference​

The remaining sections are reference material for building and configuring the viewer, including running your own viewer as a local XDC. SPHERE users can use the existing owl image as described above.

A local XDC must provide the attachment state and configuration described below, along with connectivity to the Owl backend and the SPHERE login, identity, and portal services used for access checks and topology.

Download the viewer repository​

On your build host, install Git, Node.js/npm, and Podman. Download the separate Owlview repository and enter its root directory:

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

If you already have the checkout, enter its directory instead of cloning it again. For a private repository, authenticate with a GitLab account and a token with read_repository access when prompted for a password. Package registry access for the build is configured separately below.

Build and deploy the XDC container​

The browser imports @mergetb/owl-api@0.3.0, generated by the Owl API GitLab pipeline. For a private API project, set GITLAB_NPM_TOKEN to a token with package read access before running npm ci. The GUI pipeline uses its GitLab job token; the API project must allow that job token to read its packages. If that is unavailable, set the GUI CI variable OWL_API_NPM_TOKEN to a package read token.

Build the React app with npm ci && npm run build before building the XDC image. The Dockerfile copies the resulting build/ directory and the Node server source into the existing xdc-base image. Supervisor starts /usr/bin/node /usr/src/app/auth-server.js alongside the XDC support processes. The browser uses the same-origin /api path by default; no startup configuration writer is needed.

Run these commands from ~/src/owl/gui/owlview/, with package access configured:

npm ci
npm run build
podman build -f container/xdc/Dockerfile -t owl-xdc:local .

Use the resulting image with your local XDC runtime and supply the deployment configuration described below. For a custom image deployed through a portal, publish it through that site's XDC image workflow before creating an XDC with it. The base image supplies the XDC support processes and Node runtime. The container listens on port 8080.

npm start runs the React development server only. The complete interface also needs the authenticated server's session, attachment, topology, and API endpoints; pointing a standalone React server at the Owl backend is not a complete XDC deployment.

Authentication and topology​

The XDC web server uses the existing Launch login. It checks the Kratos session cookie before serving any page, asset, attachment state, or /api/ request. Unauthenticated page visits show an Owl GUI sign-in page. Its button takes the user to Launch login with a return_to URL back to Owl GUI; API, asset, and attachment requests return HTTP 401. The server calls portal GetMaterialization with the same cookie and the attached stream ID before revealing the attachment or forwarding an Owl request. Portal denial returns HTTP 403. The RPC body must name the attached stream, and only the GUI's read, stop, and delete methods are forwarded. A live event stream is rechecked every 15 seconds and closed if its session, materialization access, or attachment changes. The browser checks the attachment every two seconds and clears its view after access is lost.

The GUI server also calls portal GetRealization for the attached realization, then GetRevision with its xhash. It exposes the typed XIR nodes and links as a small /topology.json projection. This experiment model defines the experiment topology and forms the viewer's initial topology. Owl entity events update its nodes and two-node links; node observations with names outside the experiment model create additional visualization nodes. Owl topology events are ignored. Links with more than two endpoints appear as labeled LAN junctions connected to each member node. Select a LAN to inspect its members. Owl link events do not address LANs yet.

The portal API check accepts a self-signed HTTPS certificate by default. Set OWL_PORTAL_TLS_VERIFY=true to require normal certificate verification. This setting applies only to the portal API check; browser and Kratos TLS verification are unchanged. An unavailable portal API produces HTTP 503, which the GUI reports separately from a detached XDC.

The XDC deployment supplies XDC_LAUNCH_LOGIN_URI and MERGE_KRATOS_API_URL. By default, the portal API URL is derived by replacing the launch. hostname prefix with api.. Set OWL_PORTAL_API_URL when the API uses another hostname. OWL_UPSTREAM_HOST and OWL_UPSTREAM_PORT select the private Owl server (defaults: control:80). OWL_AUTH_RECHECK_MS can change the live stream recheck interval. All upstream checks fail closed when a service is unavailable.

Configuration reference​

These environment variables configure the Node server. The owl CLI has its own configuration.

Environment variableDefault / purpose
PORT8080; HTTP listening port.
XDC_LAUNCH_LOGIN_URILaunch login URL supplied by the XDC deployment.
MERGE_KRATOS_API_URLKratos API base URL; otherwise derived as /auth on the Launch origin.
OWL_PORTAL_API_URLPortal API base URL; otherwise derived from the launch. hostname prefix. Required if that prefix is absent.
OWL_PORTAL_TLS_VERIFYfalse; set exactly true for normal portal certificate verification.
OWL_UPSTREAM_HOSTcontrol; Owl backend hostname.
OWL_UPSTREAM_PORT80; Owl backend port (HTTP).
OWL_AUTH_RECHECK_MS15000; active stream access recheck interval in milliseconds.
OWL_ATTACHMENT_FILE/etc/mergetb/attached_state.json; XDC attachment file.
OWL_BUILD_DIRbuild beside the server script; built static assets.
MERGE_XDC_FQDNPublic XDC hostname used for the login return URL when supplied.

The browser API base URL defaults to /api. For a custom frontend deployment, it resolves window.OWL_RUNTIME_CONFIG.apiBaseUrl from public/runtime-config.js first, then the build-time REACT_APP_OWL_API_URL, then /api. Changing that URL does not replace the separate session, attachment, and topology endpoints or provide access checks for another backend.

Only GetEvents, GetEventsStream, StopEventsStream, and DeleteStream are forwarded by the authenticated /api proxy. Publishing must use the backend's private endpoint through the CLI or an application.

The Owl server must remain private to the pod or cluster. Its separate Helm chart currently enables a public ingress by default; disable that ingress in deployments that rely on this GUI's access checks.