CLI tool to deploy to Mesos using Singularity
felixgborrego Make nmesos verify print all errors. (#41)
Currently it's stoping after the first issue is detected.
Latest commit 34e7bb5 Nov 16, 2018

README.md

NMesos Logo

Nmesos

Nmesos is a command line tool that leverages Singularity API to deploy services and schedule jobs in a Apache Mesos cluster.

Terminal output

Features

  • Service configuration in Yaml format.
  • Dryrun mode
  • Auto detect changes between yaml and Singularity request (scale up instances and resources if needed)
  • CLI tool
  • Integration with SBT(optional)
  • Scheduled jobs

Usage

Release a service

The following command will read example-service.yml and try to release the latest tag in the dev environment.

cd docs/examples
nmesos release example-service --environment dev --tag latest

Config Yml file

nmesos_version: '0.1.0'
common:
  resources:
    memoryMb: 128
  
  container:
    image: hubspot/singularity-test-service
    ports:
      - 8080
    labels:
      ServiceName: "exampleServer"
    env_vars:
      NEW_RELIC_LICENSE_KEY: "xxxxx"      
  
  singularity:
    healthcheckUri: "/hello"

environments:
  dev:
    resources:
      instances: 1 
      cpus: 0.1
    singularity:
      url: "http://192.168.99.100:7099/singularity"

  prod:
    resources:
      instances: 3 
      cpus: 1
    container:  
      env_vars:  
        JAVA_OPTS: "-Xmx1024m"
    singularity:
      url: "http://prod-singularity/singularity"      

To know more about the yml format check the yml examples

Getting Started with the CLI tool

Install Nmesos CLI manually:

curl https://s3-us-west-2.amazonaws.com/nitro-public/repo/nitro/nmesos-cli/0.1.2/nmesos-cli-0.1.2.tgz | tar -xz
cd nmesos-cli-0.1.0 && chmod u+x nmesos

Alternatively on MacOS, you can also install it with brew:

brew tap nitro/nmesos  git@github.com:Nitro/nmesos.git
brew install nmesos-cli

Update Nmesos cli:

brew update
brew upgrade nmesos-cli

Uninstall Nmesos cli:

brew uninstall nmesos-cli

Bash Completion support

If you want to install the support for the bash-completion, you can use the brew option --with-bash-completion when installing:

brew install --with-bash-completion nmesos-cli

Other Comands

nmesos release [options] service-name
 Release the a new version of the service.
 Usage:  nmesos release example-service --environment dev --tag 0.0.1
  service-name             Name of the service to release
  -e, --environment <value>
                           The environment to use
  -t, --tag <value>        Tag/Version to release
  -f, --force              Force action
  -n, --dryrun <value>     Is this a dry run?

nmesos scale [options] service-name
 Update the Environment.
 Usage: nmesos scale service_name --environment dev
  service-name             Name of the service to scale
  -e, --environment <value>
                           The environment to use
  -n, --dry-run <value>    Is this a dry run?

nmesos check [options] service-name
 Check the environment conf without running it.
 Usage: nmesos check service_name --environment dev
  service-name              Name of the service to verify
  -e, --environment <value> The environment to verify