TimeBase orchestration with Docker Compose
Tags: deployment

Deployment with Docker Compose

With Docker Compose you can deploy, orchestrate and scale TimeBase.

  1. Install Docker
  2. Install Docker Compose
  3. Get an official TimeBase Community Edition Docker image
  4. Download and configure docker-compose.yml TimeBase file
  5. Run docker-compose up -d
# docker-compose.yml example

version: '3.9'
services:

  timebase:
    image: "finos/timebase-ce-server:latest"
    oom_kill_disable: true
    stop_grace_period: 5m
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    healthcheck:
      test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:8011/tb/ping"]
    environment:
      - JAVA_OPTS=
        -Xms8g
        -Xmx8g
        -DTimeBase.version=5.0
        -XX:+HeapDumpOnOutOfMemoryError
        -XX:HeapDumpPath=/timebase-home/timebase.hprof
        -Xlog:gc=debug:file=/timebase-home/GClog-TimeBase.log:time,uptime,level,tags:filecount=5,filesize=100m
    ports:
      - 8011:8011
    volumes:
      - "./timebase-home:/timebase-home"
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 9000M

  timebase-admin:
    image: "epam/timebase-ws-server:latest"
    environment:
      - JAVA_OPTS=
        -Xmx1g
        -Dserver.port=8099
        -Dserver.compression.enabled=true
        -Dserver.compression.mime-types=text/html,text/css,application/javascript,application/json
        -Dtimebase.url=dxtick://timebase:8011
    ports:
      - 8099:8099
    depends_on:
      - timebase
	  

TimeBase Deployment with SSL

This document provides a basic (minimal) instruction for TimeBase deployment with SSL.

Docker Compose

Configure docker-compose.yml file.

version: '3.5'
services:
  timebase:
    image: "finos/timebase-ce-server:latest" //path to TimeBase Docker image you are going to use 
    container_name: timebase
    environment:
      - JAVA_OPTS=
        -Xms8g
        -Xmx8g
        -DTimeBase.version=5.0
    ports:
      - 8011:8011 //TimeBase Server port
      - 8022:8022 //SSL port
    deploy:
      resources:
        limits:
          memory: 10G
        reservations:
          cpus: '1'
          memory: 4G
    stop_grace_period: 5m
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    entrypoint: "/bin/sh -c"
    command: ["/timebase-server/bin/tdbserver.sh -tb -home /timebase-home"]
    volumes:
        - "./...inst.properties:ro"//path to file
        - "./...admin.properties:ro"//path to file
        - "./...test.jks:ro"//path to file
        - "./...timebase-home"//path to file

admin.properties

In admin.properties configuration file specify the following parameters for TimeBase and QuantServer to enable SSL:

TimeBase.sslInfo=QSKeystoreInfo
TimeBase.sslInfo.keystoreFile=test.jks //security certificate file
TimeBase.sslInfo.keystorePass=<password>
TimeBase.enableSSL=true //enable SLL
TimeBase.sslInfo.sslPort=8022 //SSL port same as in docker-compose
TimeBase.sslInfo.sslForLoopback=false

# with User Access Control properties

TimeBase.sslInfo=QSKeystoreInfo
TimeBase.sslInfo.keystoreFile=test.jks //security certificate file
TimeBase.sslInfo.keystorePass=<password>
TimeBase.enableSSL=true //enable SLL
TimeBase.sslInfo.sslPort=8022 //SSL port same as in docker-compose
TimeBase.sslInfo.sslForLoopback=false
QuantServer.security.rulesConfig=uac-access-rules.xml //users authorization information
QuantServer.security.userDirectoryConfig=uac-file-security.xml //users authentication information
QuantServer.security=FILE

Create a JKS file in case you use a self-signed certificate. Specify JKS file name for keystoreFile and a password for keystorePass.

Useful Commands

  • docker-compose images - show you component versions.
  • docker-compose logs CONTAINER_NAME - display log output from service.
  • Use docker-compose logs -f CONTAINER_NAME to follow log output.