Skip to content

Docker-Compose

Comet provides a docker compose sample file for cases where Linux Deployments or Kubernetes deployments are not an option. We only recommend it for PoC's.

Basic Requirements

  • Docker: https://docs.docker.com/install/
  • Docker-compose: https://docs.docker.com/compose/install/

  • If you intend to use SSL, an A record for your (sub)domain will be required:
    e.g. comet-ml.yourcompany.com

A repository username and password that will also double as your license key will be provided by Comet. You will need these values during the installation process.

Server Requirements

Hardware requirements

  • 16 VCPUS
  • 32GB RAM (64GB Recommended)
  • 1TB Root Disk space

The disk space allocation may be adjusted downward if you plan on storing experiment data on another partition or offsite.

If you're using a public cloud provider, the following instance types are recommended for use:

Log in to Comet private docker registry

Login to our docker registry with the previously shared credentials

docker login docker.comet.com

Configuring your .env file

  • The first step is to create your own .env file, where you will configure most of the variables for your environment.

  • Update the COMET_BASE_URL variable with the external IP or hostname you’re going to use in the installation. E.g.

# Rename this to .env

# Required variables:
# In order to enable https (via external Load Balancer, please replace http to https)
COMET_BASE_URL=http://comet.yourdomain.com

# License token provided by Comet
LICENSE_TOKEN=

# Pinned component versions.
# In order to update CometML, you will get notified of new versions, then you should update the relevant variable here.
FRONTEND_VERSION=5.54.19
BACKEND_VERSION=3.7.45
OPTIMIZER_VERSION=2.0.25

# Optional settings

#MYSQL_ROOT_PASSWORD=
#MYSQL_DATABASE=
#MYSQL_USER=
#MYSQL_PASSWORD=
#S3_ACCESS_KEY=
#S3_SECRET_KEY=
#S3_BUCKET=

Note

There are other variables you might want to set to increase security, please take a look at the docker-compose.yml below for a full list.

  • Make sure you create your docker-compose.yaml file with the following contents:
version: '3'

services:
  mysql:
    image: mysql:5.7
    restart: always
    command: "--max_allowed_packet=157286400 --thread_stack=2000000 --group_concat_max_len=1000000 --log_bin_trust_function_creators=1"
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
      MYSQL_DATABASE: ${MYSQL_DATABASE:-logger}
      MYSQL_USER: ${MYSQL_USER:-user}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pass}
    volumes:
      - mysql-data:/var/lib/mysql/
    healthcheck:
      test: /usr/bin/mysql --user=root --password=${MYSQL_ROOT_PASSWORD:-root} --execute "show databases;"
      timeout: 20s
      retries: 10
      interval: 10s

  redis:
    image: redis:5

  minio:
    image: minio/minio:RELEASE.2020-07-02T00-15-09Z
    ports:
      - "9000:9000"
    environment:
      - "MINIO_ACCESS_KEY=${S3_ACCESS_KEY:-ACCESS_EXAMPLE}"
      - "MINIO_SECRET_KEY=${S3_SECRET_KEY:-SECRET_EXAMPLE}"
    volumes:
      - minio-data:/data
    command: server /data

  mc:
    image: minio/mc:RELEASE.2020-06-26T19-56-55Z
    entrypoint: >
      /bin/sh -c " /bin/sleep 20s; /usr/bin/mc config host add myminio http://minio:9000 ${S3_ACCESS_KEY:-ACCESS_EXAMPLE} ${S3_SECRET_KEY:-SECRET_EXAMPLE}; /usr/bin/mc mb myminio/${S3_BUCKET:-cometml-data}; exit 0; "

  frontend-nginx:
    image: docker.comet.com/comet-ml/frontend-nginx:${FRONTEND_VERSION}
    environment:
      NGINX_CONFIG: comet-optimizer
      ENVIRONMENT_TOKEN: ${ENVIRONMENT_TOKEN:-onprem-ami}
    depends_on:
      - "backend-python"
      - "backend-react"
      - "backend-postprocess"
    restart: always
    ports:
      - '80:8174'

  backend-react:
    image: docker.comet.com/comet-ml/backend-react:${BACKEND_VERSION}
    restart: always
    depends_on:
      - "mysql"
      - "redis"
    healthcheck:
      # In case you want to reach this healthcheck endpoint from outside, you can reach http(s)://comet-host/api/isAlive/ping
      test:
        [
          "CMD",
          "curl",
          "-f",
          "http://localhost:8080/isAlive/ping"
        ]
      interval: 1m
      timeout: 10s
      retries: 3
    environment:
      BI_ENABLED: 'false'
      COMET_BASE_URL: ${COMET_BASE_URL:-http://127.0.0.1}
      ONPREM_ENABLED: 'true'
      REDIS_HOST: ${REDIS_HOST:-redis}
      CASSANDRA_ENABLED: "false"
      S3_KEY: ${S3_ACCESS_KEY:-ACCESS_EXAMPLE}
      S3_SECRET: ${S3_SECRET_KEY:-SECRET_EXAMPLE}
      S3_BUCKET: ${S3_BUCKET:-cometml-data}
      S3_URL: ${S3_URL:-minio:9000}
      S3_REGION: ${S3_REGION:-us-east-1}
      S3_VIEW_FILE_URL: ${S3_VIEW_FILE_URL:-http://minio:9000/}
      S3_HTTPS_ENABLED: 'false'
      HTTPS_ENABLED: 'false'
      MYSQL_HOST: ${MYSQL_HOST:-mysql}
      MYSQL_USER: ${MYSQL_USER:-user}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pass}
      INIT_DB: 'true'
      INIT_PROJECT_CARDS: 'true'
      SECRET_SEED: ${SECRET_SEED:-6a1759a2d9a889d225876990b20591086a1759a2d9a889d225876990b2059108}
      FEATURE_TOGGLE_FILENAME: /opt/comet-ml/feature-toggles/feature-toggles-onprem.json
      S3_PUBLIC_MARK_RO_UPLOAD: 'false'
      REACT_LOG_FILE: /dev/stdout
      BACKEND_VERSION: ${BACKEND_VERSION}
      LICENSE_TOKEN: "${LICENSE_TOKEN}"
      WAIT_FOR_RESOURCES_ON_STARTUP: 'true'
      JAVA_EXTRA_OPTS: "-Xmx5g"
      COMET_STATS_LICENSE_REPORT_ENABLED: 'true'
      COMET_STATS_EVENTS_ENABLED: 'true'
      JWT_SAME_SITE: "LAX"

  backend-postprocess:
    restart: always
    image: docker.comet.com/comet-ml/backend-postprocess:${BACKEND_VERSION}
    depends_on:
      - "mysql"
      - "redis"
    healthcheck:
      # In case you want to reach this healthcheck endpoint from outside, you can reach http(s)://comet-host/api/isAlive/ping
      test:
        [
          "CMD",
          "curl",
          "-f",
          "http://localhost:8098/isAlive/ping"
        ]
      interval: 1m
      timeout: 10s
      retries: 3
    environment:
      BI_ENABLED: 'false'
      COMET_BASE_URL: ${COMET_BASE_URL:-http://127.0.0.1}
      ONPREM_ENABLED: 'true'
      REDIS_HOST: ${REDIS_HOST:-redis}
      CASSANDRA_ENABLED: "false"
      S3_KEY: ${S3_ACCESS_KEY:-ACCESS_EXAMPLE}
      S3_SECRET: ${S3_SECRET_KEY:-SECRET_EXAMPLE}
      S3_BUCKET: ${S3_BUCKET:-cometml-data}
      S3_URL: ${S3_URL:-minio:9000}
      S3_REGION: ${S3_REGION:-us-east-1}
      S3_VIEW_FILE_URL: ${S3_VIEW_FILE_URL:-http://minio:9000/}
      S3_HTTPS_ENABLED: 'false'
      HTTPS_ENABLED: 'false'
      MYSQL_HOST: ${MYSQL_HOST:-mysql}
      MYSQL_USER: ${MYSQL_USER:-user}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pass}
      INIT_DB: 'true'
      INIT_PROJECT_CARDS: 'true'
      SECRET_SEED: ${SECRET_SEED:-6a1759a2d9a889d225876990b20591086a1759a2d9a889d225876990b2059108}
      FEATURE_TOGGLE_FILENAME: /opt/comet-ml/feature-toggles/feature-toggles-onprem.json
      S3_PUBLIC_MARK_RO_UPLOAD: 'false'
      REACT_LOG_FILE: /dev/stdout
      BACKEND_VERSION: ${BACKEND_VERSION}
      LICENSE_TOKEN: "${LICENSE_TOKEN}"
      WAIT_FOR_RESOURCES_ON_STARTUP: 'true'
      JAVA_EXTRA_OPTS: "-Xmx5g"
      COMET_STATS_LICENSE_REPORT_ENABLED: 'true'
      COMET_STATS_EVENTS_ENABLED: 'true'
      JWT_SAME_SITE: "LAX"

  backend-python:
    image: docker.comet.com/comet-ml/backend-python:${BACKEND_VERSION}
    restart: always
    depends_on:
      - "mysql"
      - "redis"
    healthcheck:
      # In case you want to reach this healthcheck endpoint from outside, you can reach http(s)://comet-host/api/isAlive/ping
      test:
        [
          "CMD",
          "curl",
          "-f",
          "http://localhost:8090/isAlive/ping"
        ]
      interval: 1m
      timeout: 10s
      retries: 3
    environment:
      COMET_BASE_URL: ${COMET_BASE_URL:-http://127.0.0.1}
      REDIS_HOST: ${REDIS_HOST:-redis}
      BI_ENABLED: 'false'
      ONPREM_ENABLED: 'true'
      CASSANDRA_ENABLED: "false"
      S3_KEY: ${S3_ACCESS_KEY:-ACCESS_EXAMPLE}
      S3_SECRET: ${S3_SECRET_KEY:-SECRET_EXAMPLE}
      S3_BUCKET: ${S3_BUCKET:-cometml-data}
      S3_URL: ${S3_URL:-minio:9000}
      S3_REGION: ${S3_REGION:-us-east-1}
      S3_VIEW_FILE_URL: ${S3_VIEW_FILE_URL:-http://minio:9000/}
      S3_HTTPS_ENABLED: 'false'
      HTTPS_ENABLED: 'false'
      MYSQL_HOST: ${MYSQL_HOST:-mysql}
      MYSQL_USER: ${MYSQL_USER:-user}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pass}
      INIT_DB: 'true'
      INIT_PROJECT_CARDS: 'true'
      FEATURE_TOGGLE_FILENAME: /opt/comet-ml/feature-toggles/feature-toggles-onprem.json
      S3_PUBLIC_MARK_RO_UPLOAD: 'false'
      SECRET_SEED: ${SECRET_SEED:-6a1759a2d9a889d225876990b20591086a1759a2d9a889d225876990b2059108}
      PYTHON_LOG_FILE: /dev/stdout
      BACKEND_VERSION: ${BACKEND_VERSION}
      LICENSE_TOKEN: "${LICENSE_TOKEN}"
      PYPI_SDK_LATEST_CHECK_ENABLED: 'true'
      WAIT_FOR_RESOURCES_ON_STARTUP: 'true'
      JAVA_EXTRA_OPTS: "-Xmx5g"
      COMET_STATS_LICENSE_REPORT_ENABLED: 'true'
      COMET_STATS_EVENTS_ENABLED: 'true'

  backend-optimizer:
    image: docker.comet.com/comet-ml/backend-optimizer:${OPTIMIZER_VERSION}
    restart: always
    depends_on:
      - "redis"
    environment:
      REDIS_URL: "redis://${REDIS_HOST:-redis}:6379/2"
      DISABLE_OPTIMIZER_AUTH: "True"
      BACKEND_AUTH_HOST: "${COMET_BASE_URL:-http://localhost}/clientlib/"

volumes:
  mysql-data:
  minio-data:

Enabling https

Currently the only way to activate https using docker-compose is setting up a Nginx service or an Application Load Balancer in front of this installation. In that case you should update the COMET_BASE_URL variable in the .env file.

Upgrading Comet version

In your .env file, you just need to update the following variables.

FRONTEND_VERSION=5.54.19
BACKEND_VERSION=3.7.45
OPTIMIZER_VERSION=2.0.25

Note

The versions above reflect the latest stable versions available.

Dec. 19, 2023