def run_rancherserver():
    # Render teh template
   cfg = config()
   render('docker-compose.yml', 'files/rancherserver/docker-compose.yml', cfg)

   comp = Compose('files/rancherserver')
   comp.up()
def run_rancherserver():
    # Render teh template
    cfg = config()
    render('docker-compose.yml', 'files/rancherserver/docker-compose.yml', cfg)

    comp = Compose('files/rancherserver')
    comp.up()
Exemple #3
0
def start_cadvisor():
    '''Start the cAdvisor container that gives metrics about the other
    application containers on this system. '''
    compose = Compose('files/kubernetes')
    compose.up('cadvisor')
    set_state('cadvisor.available')
    status_set('active', 'cadvisor running on port 8088')
    hookenv.open_port(8088)
Exemple #4
0
def start_cadvisor():
    '''Start the cAdvisor container that gives metrics about the other
    application containers on this system. '''
    compose = Compose('files/kubernetes')
    compose.up('cadvisor')
    set_state('cadvisor.available')
    status_set('active', 'cadvisor running on port 8088')
    hookenv.open_port(8088)
Exemple #5
0
def start_drone():
    cfg = config()
    if not cfg.get('github_secret') or not cfg.get('github_client'):
        status_set('blocked', 'Requires DVCS credentials - see charm config')
        return
    render('docker-compose.yml', 'files/drone/docker-compose.yml', {})
    render('drone.env', 'files/drone/drone.env', cfg)
    compose = Compose('files/drone')
    compose.up()
    hookenv.open_port(80)
    status_set('active', 'Drone running.')
Exemple #6
0
def run_ems():
    # authenticate to private docker repository
    d = Docker()
    cfg = config()
    d.login(cfg['distribution-user'], cfg['distribution-pass'],
            cfg['distribution-email'])

    # Render the template
    render('docker-compose.yml', 'files/ems/docker-compose.yml', cfg)

    comp = Compose('files/ems')
    comp.up()
Exemple #7
0
def start_rabbitmq():
    ''' Starts a RabbitMQ application'''

    # Render the formation
    cfg = config()
    render('docker-compose.yml', 'files/rabbitmq/docker-compose.yml', cfg)

    # Initialize the docker compose object, looking @ our work directory
    compose = Compose('files/rabbitmq')

    # Launch the service(s)
    status_set('maintenance', "Fetching / Starting the rabbitmq containers")
    compose.up()
    status_set('active', 'Redmine is running on port 5672, 15672 and 1883')
def start_redmine():
    ''' Starts a Redmine application in standalone configuration'''

    # Render the formation
    cfg = config()
    render('docker-compose.yml', 'files/redmine/docker-compose.yml', cfg)

    # Initialize the docker compose object, looking @ our work directory
    compose = Compose('files/redmine')

    # Launch the service(s)
    status_set('maintenance', "Fetching / Starting the redmine containers")
    compose.up()
    status_set('active', 'Redmine is running on port 10030')
def start_redmine():
    ''' Starts a Redmine application in standalone configuration'''

    # Render the formation
    cfg = config()
    render('docker-compose.yml', 'files/redmine/docker-compose.yml', cfg)

    # Initialize the docker compose object, looking @ our work directory
    compose = Compose('files/redmine')

    # Launch the service(s)
    status_set('maintenance', "Fetching / Starting the redmine containers")
    compose.up()
    status_set('active', 'Redmine is running on port 10030')
Exemple #10
0
def master(etcd):
    '''Install and run the hyperkube container that starts kubernetes-master.
    This actually runs the kubelet, which in turn runs a pod that contains the
    other master components. '''
    render_files(etcd)
    # Use the Compose class that encapsulates the docker-compose commands.
    compose = Compose('files/kubernetes')
    status_set('maintenance', 'Starting the Kubernetes kubelet container.')
    # Start the Kubernetes kubelet container using docker-compose.
    compose.up('kubelet')
    set_state('kubelet.available')
    # Open the secure port for api-server.
    hookenv.open_port(6443)
    status_set('maintenance', 'Starting the Kubernetes proxy container')
    # Start the Kubernetes proxy container using docker-compose.
    compose.up('proxy')
    set_state('proxy.available')
    status_set('active', 'Kubernetes started')
Exemple #11
0
def master(etcd):
    '''Install and run the hyperkube container that starts kubernetes-master.
    This actually runs the kubelet, which in turn runs a pod that contains the
    other master components. '''
    render_files(etcd)
    # Use the Compose class that encapsulates the docker-compose commands.
    compose = Compose('files/kubernetes')
    status_set('maintenance', 'Starting the Kubernetes kubelet container.')
    # Start the Kubernetes kubelet container using docker-compose.
    compose.up('kubelet')
    set_state('kubelet.available')
    # Open the secure port for api-server.
    hookenv.open_port(6443)
    status_set('maintenance', 'Starting the Kubernetes proxy container')
    # Start the Kubernetes proxy container using docker-compose.
    compose.up('proxy')
    set_state('proxy.available')
    status_set('active', 'Kubernetes started')
Exemple #12
0
def start_kubelet(etcd):
    '''Run the hyperkube container that starts the kubernetes services.
    When the leader, run the master services (apiserver, controller, scheduler,
    proxy)
    using the master.json from the rendered manifest directory.
    When a follower, start the node services (kubelet, and proxy). '''
    render_files(etcd)
    # Use the Compose class that encapsulates the docker-compose commands.
    compose = Compose('files/kubernetes')
    status_set('maintenance', 'Starting the Kubernetes services.')
    if is_leader():
        compose.up('master')
        compose.up('proxy')
        set_state('kubelet.available')
        # Open the secure port for api-server.
        hookenv.open_port(6443)
    else:
        # Start the Kubernetes kubelet container using docker-compose.
        compose.up('kubelet')
        set_state('kubelet.available')
        # Start the Kubernetes proxy container using docker-compose.
        compose.up('proxy')
        set_state('proxy.available')
    status_set('active', 'Kubernetes services started')
Exemple #13
0
def start_kubelet(etcd):
    '''Run the hyperkube container that starts the kubernetes services.
    When the leader, run the master services (apiserver, controller, scheduler,
    proxy)
    using the master.json from the rendered manifest directory.
    When a follower, start the node services (kubelet, and proxy). '''
    render_files(etcd)
    # Use the Compose class that encapsulates the docker-compose commands.
    compose = Compose('files/kubernetes')
    status_set('maintenance', 'Starting the Kubernetes services.')
    if is_leader():
        compose.up('master')
        compose.up('proxy')
        set_state('kubelet.available')
        # Open the secure port for api-server.
        hookenv.open_port(6443)
    else:
        # Start the Kubernetes kubelet container using docker-compose.
        compose.up('kubelet')
        set_state('kubelet.available')
        # Start the Kubernetes proxy container using docker-compose.
        compose.up('proxy')
        set_state('proxy.available')
    status_set('active', 'Kubernetes services started')
Exemple #14
0
def start_logspout():
    compose = Compose('files/logspout')
    compose.up()
    remove_state('logspout.ready')
    status_set('active', 'Logspout running')
Exemple #15
0
def run_scope():
    compose = Compose('files/scope')
    compose.up()
    hookenv.open_port(4040)
    hookenv.status_set('active', 'Weave Started. Visit me on port 4040')
    reactive.set_state('scope.started')