Skip to content

Deploy Center Docker Container

Nathan Bu edited this page Jul 27, 2023 · 17 revisions

Here is the deploy approach for Hydra Lab Center docker image.

1. Center env file setup

If you would like to overlap some env variables to enable/disable some submodules of Hydra Lab, you may include the key-value pairs in an env file. Format of the content should be as followed:

KEY1=VALUE1
KEY2=VALUE2

See the application.yml for available env variables (in form of ${XXX_YYY}).

Notice:

  • If the connected agent is started within docker, the env variable LOCAL_STORAGE_ENDPOINT (by default http://localhost:9886) for Center should be changed to "host.docker.internal" or the IP (public/private based on usage) of Center instance.
  • If the connected agent is started using jar package, no env variable is required to be set.

2. Center image startup

docker run -p "$(YOUR_PORT)":9886 [--env-file "${PATH_TO_YOUR_ENV_FILE}"] ghcr.io/microsoft/hydra-lab-center:latest

Notice:

  • When Center docker image is using local storage (i.e. env variable STORAGE_TYPE=LOCAL), the env variable LOCAL_STORAGE_ENDPOINT in application.yml needs to be changed according to the value of "$(YOUR_PORT)".

Use third-party storage service

Hydra Lab currently supports Azure Blob Storage as cloud file storage solution to persist various file types such as log files, video, app package, etc. Any contribution to integrating other third-party storage services is welcome. (Here's the UML class diagram for this module as a reference: storage service structure.)

Some extra environment variables need to be specified in the command according to the storage service type.

If you want to use Azure Blob storage, please go to your Azure portal, open an Azure Blob storage account, and get the connection string. Brief steps: Login Azure -> Portal -> Storage Accounts -> Create new storage account (you may disable the public access for the container) -> In the created storage account, find Access Keys tab -> copy Connection string. image

You may write the following content in an env file (e.g. env.properties):

STORAGE_TYPE=AZURE
BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR}

Then pass the path of the file to docker container

docker run --env-file env.properties -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest

Or simply run with the env parameter -e:

docker run -e STORAGE_TYPE=AZURE -e BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR} -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest

See also

For connection from Agent to Center:

Clone this wiki locally