def __init__(self, controller): self.name = "OpenStack launcher" self.docker_registry = None self.docker_user = None self.heat_server = None self.openstack_key = None self.system = System() self.installer = Installer() self.controller = controller self._init_open_stack() self._init_app_db()
def __init__(self): self.cmds = CmdHelp() self.cmds.description = "Development environment for big data applications" self.cmds.version = ferry.__version__ self.cmds.usage = "ferry COMMAND [arg...]" self.cmds.add_option("-b", "--build", "Build Ferry default images") self.cmds.add_option("-c", "--conf", "Deployment configuration") self.cmds.add_option("-d", "--dns", "Specify DNS servers") self.cmds.add_option("-k", "--key", "Specify key directory") self.cmds.add_option("-l", "--log", "Log configuration file") self.cmds.add_option("-m", "--mode", "Deployment mode") self.cmds.add_option("-n", "--naked", "Start in naked mode") self.cmds.add_option("-r", "--retry", "Retry action on failure") self.cmds.add_option("-t", "--net", "Use host network device") self.cmds.add_option("-u", "--upgrade", "Upgrade Ferry") self.cmds.add_cmd("build", "Build a Dockerfile") self.cmds.add_cmd("clean", "Clean zombie Ferry processes") self.cmds.add_cmd("help", "Print this help message") self.cmds.add_cmd("info", "Print version information") self.cmds.add_cmd("inspect", "Return low-level information on a service") self.cmds.add_cmd("install", "Install the Ferry images") self.cmds.add_cmd("login", "Login to Ferry servers") self.cmds.add_cmd("logs", "Copy over the logs to the host") self.cmds.add_cmd("ls", "View installed applications") self.cmds.add_cmd("ls-images", "View installed images") self.cmds.add_cmd("ps", "List deployed and running services") self.cmds.add_cmd("pull", "Pull a remote image") self.cmds.add_cmd("push", "Push an image to a remote registry") self.cmds.add_cmd("rm", "Remove a service or snapshot") self.cmds.add_cmd("server", "Start all the servers") self.cmds.add_cmd("snapshot", "Take a snapshot") self.cmds.add_cmd("snapshots", "List all snapshots") self.cmds.add_cmd("ssh", "Connect to a client/connector") self.cmds.add_cmd("start", "Start a new service or snapshot") self.cmds.add_cmd("stop", "Stop a running service") self.cmds.add_cmd("quit", "Stop the Ferry servers") self.ferry_server = 'http://127.0.0.1:4000' self.default_user = '******' self.installer = Installer(self)
from ferry.docker.manager import DockerManager from ferry.docker.docker import DockerInstance import os import Queue import sys import threading2 import time from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop # Initialize Flask app = Flask(__name__) # Initialize the storage driver installer = Installer() docker = DockerManager() def _stack_worker(): """ Worker thread. """ while (True): payload = _new_queue.get() if payload["_action"] == "new": _allocate_new_worker(payload["_uuid"], payload) elif payload["_action"] == "stopped": _allocate_stopped_worker(payload) elif payload["_action"] == "snapshotted":