Public Repository

Last pushed: 2 years ago
Short Description
Provides this Docker Swarm Image for some extra functions related with Mesos.
Full Description

Description

Currently, Swarm on Mesos integration is experimental, and does not support some main features of Mesos. This image is built based on Swarm v 1.1.3, and with some extra functions as below:

  • Supports to register to Mesos with a specified role.
  • Supports to use reserved resources on Mesos.

    The design proposal is to use the reserved resource firstly by default, if the reserved resoruces are not enought to create a contianer, then will use the unreserved resource for the gap. This behaviour could eventually be configurable by end user (use unreserved resources or reserved resources firstly), although we may want to avoid providing that option until we see a valid use case.

  • Supports to use the revocable resources on Mesos.

    Refer to https://github.com/qianzhangxa/swarm/blob/master/cluster/mesos/use-mesos-revocable-resource-proposal.md for the detailed proposals.

  • Enhance docker info to show the resource type: regular(reserved/unreserved) or revocable.

Start Swarm on Mesos

Specify mesos.enablerevocable=true to enable Swarm to receive the revocable resources on Mesos.

Specify mesos.role=sales to register Mesos with the specified role sales.

docker run -d \
  --net=host  gradywang/swarm-mesos  \
  --debug manage \
  -c mesos-experimental \
  --cluster-opt mesos.address=9.111.255.10 \
  --cluster-opt mesos.tasktimeout=10s \
  --cluster-opt mesos.user=root \
  --cluster-opt mesos.offertimeout=10m \
  --cluster-opt mesos.port=3375 \
  --cluster-opt mesos.enablerevocable=true \
  --cluster-opt mesos.role=sales \
  --host=0.0.0.0:4375 zk://gradyzk.wyq.com:2181/mesos

Use cases:

  • Case 1: As a Swarm user, I want to create my high priority container with regular resources only.

    docker -H gradyswarm.wyq.com:4375 run -d \
    --cpu-shares 2 ubuntu:14.04 sleep 100
    

    or

    docker -H gradyswarm.wyq.com:4375 run -d \
    -e constraint:res-type==regular \
    --cpu-shares 2 ubuntu:14.04 sleep 100
    
  • Case 2: As a Swarm user, I want to create my medium priority container with regular resources first, if there are no enough regular resources, it is OK to create the container with revocable resources.

    docker -H gradyswarm.wyq.com:4375 run -d \
    -e constraint:res-type==~regular \
    --cpu-shares 2 ubuntu:14.04 sleep 100
    
  • Case 3: As a Swarm user, I want to create my low priority container with revocable resources only.

    docker -H gradyswarm.wyq.com:4375 run -d \
    -e constraint:res-type==revocable \
    --cpu-shares 2 ubuntu:14.04 sleep 100
    
  • Case 4: As a Swarm user, I want to create my low priority container with revocable resources first, if there are no enough revocable resources, it is OK to create the container with regular resources.

    docker -H gradyswarm.wyq.com:4375 run -d \
    -e constraint:res-type==~revocable \
    --cpu-shares 2 ubuntu:14.04 sleep 100
    

Supporter

Yongqiao Wang: Mail: yqwyq@cn.ibm.com Weichat:gradyYQwang

Like this image? Give me a star at the top of this page!

Docker Pull Command
Owner
gradywang