Docker

Introduction

The Stream Host Docker image is available from XMPro Platform v4.4.2+.

If your installation requires multiple Stream Hosts, please be aware that Stream Host Variable Overrides must be applied as environment variables when running as a Container - enabling frictionless automation when creating multiple Stream Host instances.

Prerequisites

Hardware and Software

A container runtime tool capable of running Docker images, such as Docker Desktop.

The XMPro Docker Stream Host image has already met the rest of the hardware requirements and software requirements.

Configuration Settings

The following configuration settings are required to run the Docker Stream Host. Locate these values before you proceed.

The Keys should be set as environment variables on the running Stream Host Container.

These settings can be found in Data Stream Designer:

Repository

Below is the XMPro Docker Stream Host repository.

xmpro.azurecr.io/stream-host

Images

Image Tags

All images are tagged with the release version number, starting from 4.4.2. For example, use a version tag to reference the Stream Host for v4.4.2:

xmpro.azurecr.io/stream-host:4.4.2

The latest tag identifies the most recent XMPro Platform release version number, for example:

xmpro.azurecr.io/stream-host:latest

Using the latest tag stores a copy of the image on your system. This cached version may not be the latest release if a newer release has since been published.

We recommend specifying the specific version or re-pulling the image if a newer release has occurred since your last Stream Host docker install.

Image Flavors

A Stream Host running a Data Stream must provide the capabilities to run each of the Agents in the Data Stream. Choose your image depending on the capabilities that are required.

Creating a Custom Image

You may need a Stream Host that has capabilities that differ from the available image flavors such as additional Python modules (e.g. via pip).

Add additional Python modules

The docker image can be used to create a custom stream-host with additional Python modules installed. Use xmpro.azurecr.io/stream-host as the base image.

Example requirements.txt file

langchain-community
langchain-openai

Example docker file

FROM xmpro.azurecr.io/stream-host:4.4.3
 
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt

Run Examples

Please see the following examples to run Stream Host as a Container:

Docker Run

Create an "envfile" containing the following (replacing <values> with the actual Configuration Settings)

xm:xmpro:Gateway:Id=<Unique ID>
xm:xmpro:Gateway:CollectionId=<Collection ID>
xm:xmpro:Gateway:Name=<Device Name>
xm:xmpro:Gateway:Secret=<Collection Secret>
xm:xmpro:Gateway:ServerUrl=<Server URL>
xm:xmpro:Gateway:Rank=<Rank>

Start

Run the Stream Host using the following command. Specify the version or add "--pull always" to ensure you're using the newest release.

docker run --env-file=envfile --name stream-host xmpro.azurecr.io/stream-host:latest

Stop

Stop the Stream Host using the following command.

docker rm -f stream-host

Docker Compose

Create a file called compose.yaml in your working directory and paste the following (replacing <values> with the actual Configuration Settings):

stream-host:
  image: xmpro.azurecr.io/stream-host:latest
  pull_policy: always # specify to always use the latest release version
  container_name: 'stream-host'
  environment:
      - xm:xmpro:Gateway:Id=<Unique ID>
      - xm:xmpro:Gateway:CollectionId=<Collection ID>
      - xm:xmpro:Gateway:Name=<Device Name>
      - xm:xmpro:Gateway:Secret=<Collection Secret>
      - xm:xmpro:Gateway:ServerUrl=<Server URL>
      - xm:xmpro:Gateway:Rank=<Rank>
  restart: on-failure

See Docker Compose Overview for further details on how to use Docker Compose.

Start

In the same working directory ascompose.yaml, run the following command to start the Stream Host.

docker-compose up -d stream-host 

Stop

In the same working directory ascompose.yaml, run the following command to stop the Stream Host.

docker-compose down

Next Step: Agents & Connectors

The stream host installation is complete. Please click below to install the default Agents & Connectors:

Last updated