signalfx / maestro-ng

Orchestration of Docker-based, multi-host environments
https://signalfx.com
Apache License 2.0
685 stars 83 forks source link

Python 3 and Maestro-NG TypeError #166

Closed valentinbud closed 8 years ago

valentinbud commented 8 years ago

I have installed Maestro-NG on my Mac Notebook with pip3 install maestro-ng. Python3 is installed via brew

$ brew info
python3: stable 3.5.1 (bottled), HEAD
Interpreted, interactive, object-oriented programming language

$ pip3 freeze | grep maestro
maestro-ng==0.2.8.2

I have a docker-machine running on my laptop which I want to connect maestro to.

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                          SWARM   DOCKER    ERRORS
dev    *        virtualbox   Running   tcp://192.168.200.100:2376           v1.10.0

Here it is my maestro.yaml file.

__maestro:
    schema: 2

name: kryptospace-com

registries:
    databussystems:
        registry: https://registry.databus.systems
        username: maestro
        password: *****
        email: maestro@databus.systems

ship_defaults:
    timeout: 60

ships:
    dev: {ip: 192.168.200.100}

services:
    devnomad:
        image: registry.databus.systems/devnomad
        instances:
            ship: dev
            devnomad:
                ports:
                    client: 4646

Running maestro status yields:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/maestro/__main__.py", line 167, in execute
    c = maestro.Conductor(config)
  File "/usr/local/lib/python3.5/site-packages/maestro/maestro.py", line 59, in __init__
    name, self.ships[instance['ship']],
TypeError: string indices must be integers

What can I do better? Thanks.

mpetazzoni commented 8 years ago

Hi,

The ship needs to be defined per instance. Just move the line ship: dev inside the devnomad instance definition (instead of under instances):

services:
  devnomad:
    image: registry.databus.systems/devnomad
    instances:
      devnomad:
        ship: dev
        ports:
          client: 4646

And you'll be all set!

valentinbud commented 8 years ago

Thank you!