Mesos-Compose Framework for Apache Mesos



With Mesos-Compose I offer an alternative to Mesosphere Marathon. Here the goal is to translate docker-compose files into MesosTasks.

The goal is to adapt the way of working with Mesos closer to the workflow of the developers. It is indisputable that the majority of developers in the microservice environment are familiar with the docker-compose syntax and may test the workload in a local test the workload in a local Docker environment. The same docker-compose.yaml can be used with the help of the Mesos CLI to the mesos-compose framework. The framework then schedules the appropriate containers in Apache Mesos.

Features

The mesos-compose framework provides the following features

  • Long and Shortrunning Jobs
  • Constraints to control which node the job should run on
  • Support for Docker container engine as well as Mesos UCR
  • Bridge, Host and User Network
  • Capabilities
  • CPU and memory resource limits
  • Hashicorb Vault to store passwords and certificates from the secretstore

Compose File

The Docker Compose syntax supported is version 3.9. The following parameters have been implemented so far:

version: '3.9'
services:
  app:
    image: alpine:latest
    command: "sleep 1000"
    volumes:
      - "12345test:/tmp"
    environment:
      - MYSQL_HOST=test
    labels:
      biz.aventer.mesos_compose.container_type: "DOCKER"
      traefik.enable: "true"
      traefik.http.routers.test.entrypoints: "web"
      traefik.http.routers.test.service: "mc:test:app:80"
      traefik.http.routers.test.rule: "HostRegexp(`example.com`, `{subdomain:[a-z]+}.example.com`)"
    network_mode: "BRIDGE"
    network: default
    networks:
      default:
        aliases:
          - "test.example.de"
    pull_policy: always
    ports:
      - "8080:80"
    cap_add:
      - SYS_ADMIN
    cap_drop:
      - NET_ADMIN
    deploy:
      placement:
        constraints:
          - "node.hostname==localhost"
      replicas: 1
      resources:
        limits:
          cpus: "0.01"
          memory: "50"

networks:
  default:
    external: true
    name: weave

volumes:
  12345test:
    driver: local

We use the Docker labels for configuring both Traefik (if available), but also the mesos-compose framework.