Skip to content

Starting Manticore and Environment Variables

Chris edited this page Apr 24, 2017 · 26 revisions

Set up Manticore

Manticore runs in a Docker container and is provisioned by Nomad, just like with sdl_core and an HMI. However, Manticore needs some environment variables before it can function properly. Everything you need to generate and submit the Manticore job file is created for you under the build/ folder. All you need to do is pass in the appropriate environment variables. Manticore uses dotenv so all your environment variables can be stored in a .env file inside the build/ folder. Manticore's .gitignore will not push that file to repositories.

Environment variables

There are certain requirements for environment variables for Manticore to even run. Setting up the wrong configuration will make Manticore refuse to run. Check out /server/lib/config.js for details on how this works.

Base Requirements

# The logging level for Manticore. Defaults to DEBUG. Set to PRODUCTION to only log errors
NODE_LOGS
# Port of the web server. Defaults to 4000. Highly recommend not changing it, as the Dockerfile
# for Manticore exposes only port 4000, meaning you will need to build your own image of Manticore
# in order to use different internal ports.
HTTP_PORT
# Whether CORS should be enabled. Defaults to false
CORS
# Whether the webpage for testing the Manticore API should be accessible. Defaults to false
DISABLE_WEBPAGE

Enable JWT Mode

# For expecting JWTs, using a shared secret string. If disabled, users are identified by an "id" property in the request body
JWT_SECRET

Enable Trace Mode

# The service name used for your Trace infrastructure 
TRACE_SERVICE_NAME
# The API Key for authenticating with Trace
TRACE_API_KEY

Enable HAProxy Mode

# The name of your domain that you use to direct users to local ip addresses of cores and HMIs
DOMAIN_NAME
# The lowest port and highest number that HAProxy can open ports on for TCP connections. 
# Make sure your security groups are configured so that these ports can be accessed from anywhere 
# and that there are no other programs on your OS that are currently using these ports.
TCP_PORT_RANGE_START
TCP_PORT_RANGE_END
# The port HAProxy opens for web traffic, including to Manticore
HAPROXY_HTTP_LISTEN

Enable AWS Mode

# The region name of where Manticore is hosted (ex. us-east-1)
AWS_REGION

Enable ELB Mode (Requires that AWS mode is enabled)

# The name of the AWS ELB that Manticore should be controlling
ELB_MANTICORE_NAME
# The port for the SSL protocol listener for the ELB. Do NOT make it 443! You should be using
# a classic load balancer for Manticore, and Websocket and HTTP cannot happen on the same port in this case!
ELB_SSL_PORT
# The ARN of your SSL certificate for enabling secure connections
SSL_CERTIFICATE_ARN

Enable CloudWatch (Requires that AWS mode is enabled)

# The namespace name of which Manticore publishes it's metrics under
CLOUD_WATCH_NAMESPACE

Start Manticore

While in the build folder (NOT THE SERVER FOLDER), type the following to install dependencies and start the job submission process

npm install
npm start

You can check your status of jobs running the following:

# For all jobs
nomad status -address=http://<IP of this machine>:4646 
# For specifically Manticore
nomad status -address=http://<IP of this machine>:4646 manticore

Here's what you have to do if you want HTTPS and SSL through the ELB

Clone this wiki locally