Main Forecast Engine Middle Tier Microservice
834
This repository contains images for the TrueCommerce Forecast Engine Middle Tier
Prior to running the container the application requires an Administrator Certificate from Foundry Platform. One way this can be obtained is by running the associated tool from the Foundry Security Tools. Follow the steps in the "Generate authentication certificate" and save the output.
This certificate is only used to initialize the Middle Tiers and is needed every time a Middle Tier comes online. The exception would be if another instance of the same middle tier has cached an application specific version in a distributed cache which is still running and valid. As such the value should either be a long lived certificate (years) or be regularly updated to ensure issues don't exist when starting up the Middle Tier.
The Middle Tier supports running multiple instances simultaneously and is recommended for high volume production environments.
The recommended configuration also includes using Redis as a cache provider. As such, for a Docker deployment a docker-compose file combined with a .env or secrets is the recommended approach and is what will be detailed below.
This is an example of a full production deployment docker-compose file including multiple nodes for both the Middle Tiers and Providers:
version: '3.4' services: forecastredis: image: redis:6.0-alpine container_name: ForecastEngine_Redis restart: unless-stopped forecastengine: image: truecommerce/tc.forecastengine.middletier:${IMAGE_VERSION} container_name: ForecastEngine restart: unless-stopped environment: - ASPNETCORE_ENVIRONMENT=Production - MiddleTier__Registration__ProviderHost=${MT_HOST}:${MT_PORT} - MiddleTier__Registration__MiddleTierHost=${MT_HOST}:${MT_PORT} - MiddleTier__InitializationCertificate=${INITIALIZATION_CERT} - MiddleTier__CorsOriginAllowed=http://localhost:30000;http://${MT_HOST}:${MT_PORT} - Foundry__Security__RootUrl=${SECURITY_MICROSERVICE_HOST} - Foundry__CoreOData__RootUrl=${COREODATA_HOST} - Foundry__RabbitMQ__Host=${RABBIT_CONNECTION} - Foundry__RabbitMQ__Username=${RABBIT_USER} - Foundry__RabbitMQ__Password=${RABBIT_PASSWORD} - Logging__ElasticSearch__nodeUris=${ELASTICSEARCH_URI} - MiddleTier__Caching__Provider=${CACHE_PROVIDER} - MiddleTier__Caching__Redis_Configuration__Connection=forecastredis:6379 - MiddleTier__Caching__Redis_Configuration__InstanceName=${REDIS_INSTANCE} - MiddleTier__Caching__Redis_Configuration__UseWithNHibernate=${USE_REDIS_NHIBERNATE} - Foundry__RabbitMQ__Timeout=${RABBIT_TIMEOUT} - MiddleTier__CertificateLife=${MT_ADMIN_CERT_LIFE} - MiddleTier__RenewCertificatesOlderThan=${MT_ADMIN_CERT_RENEWAL} - MiddleTier__AuthenticationMessageLife=${MT_ADMIN_CERT_MESSAGE_LIFE} - MiddleTier__Registration__AgentName=System Agent - MiddleTier__Registration__UseHttps=false - MiddleTier__Registration__SupportsAlerts=false - MiddleTier__Registration__SupportsMetadata=false - MiddleTier__Registration__SupportScheduledTasks=false - MiddleTier__Registration__RegisterGlobalTenant=true - Forecasting__Defaults__DefaultLocation=Unknown - Forecasting__Defaults__DefaultChannel=None - Forecasting__AmazonEngineDefaults__AwsRoleName=${AwsRoleArn} - Forecasting__AmazonEngineDefaults__UserAccessToken=${AwsUserToken} - Forecasting__AmazonEngineDefaults__SecretAccessToken=${AwsSecretToken} - Forecasting__AmazonEngineDefaults__AwsRegion=us-east-2 - Forecasting__AmazonEngineDefaults__Algorithm=auto ports: - 12905:80 links: - redis
| Variable Name | Description | Example |
|---|---|---|
| IMAGE_VERSION | Version component of the tag | 1.0.200.0000 |
| INITIALIZATION_CERT | Initialization certificate generated by security tools | |
| COREODATA_HOST | Location of the Core OData (MSI) services | https://localhost:30000 |
| SECURITY_MICROSERVICE_HOST | Location of the Security Microservice | https://localhost:30100 |
| CACHE_PROVIDER | Mechanism to use for distributed caching. One of 'Redis' or 'InMemory' | Redis |
| REDIS_INSTANCE | Name of the instance used for Redis when CACHE_PROVIDER is Redis | Translation |
| USE_REDIS_NHIBERNATE | 'true' if Redis should be used for 2nd level caching in NHibernate and 'false' otherwise | true |
| ELASTICSEARCH_URI | Location of ElasticSearch | http://localhost:9200 |
| RABBIT_CONNECTION | Connection string for RabbitMQ instance used by Foundry | rabbitmq://localhost |
| RABBIT_USER | The username for the Foundry RabbitMQ connection | tc |
| RABBIT_PASSWORD | The password for the Foundry RabbitMQ connection | tc |
| RABBIT_TIMEOUT | A default timeout for RabbitMQ messages | 0.00:00:05 |
| MT_ADMIN_CERT_LIFE | When the Middle Tiers generate an internal certificate for admin access, this is used to determine the expiry | 7.00:00:00 |
| MT_ADMIN_CERT_RENEWAL | Frequency at which the internal admin certificate should be refreshed. Should be a value less than MT_ADMIN_CERT_LIFE | 3.00:00:00 |
| MT_ADMIN_CERT_MESSAGE_LIFE | Lifespan of authentication messages used to sign authentication tickets generated by internal admin ticket. Should be a value just long enough to ensure successful handshake between MT and Security Microservice to prevent MITM attacks | 0.00:00:30 |
| MT_HOST | External name or IP where nginx will be run | localhost |
| MT_PORT | External port used to load balance and proxy for this middle tier | 13020 |
| AwsRoleArn | A default Amazon Resource Number (ARN) if desired which is associated with a role with the correct IAM access to use both the Forecasting and the S3 buckets for data | |
| AwsUserToken | Amazon AWS User Access Token associated with the default account if desired | |
| AwsSecretToken | Amazon Secret Access Token to provide access for the user associated with the AwsUserToken to use as the default for Forecasting if desired |
Content type
Image
Digest
Size
113.6 MB
Last updated
over 5 years ago
docker pull truecommerce/tc.forecastengine.middletier