Start all supporting containers (containers required for CKAN to
    operate) if they aren't already running, along with some extra
    containers specified by the user
177633
def start_supporting_containers(sitedir, srcdir, passwords,
        get_container_name, extra_containers, log_syslog=False):
    
    if docker.is_boot2docker():
        docker.data_only_container(get_container_name('pgdata'),
            ['/var/lib/postgresql/data'])
        rw = {}
        volumes_from = get_container_name('pgdata')
    else:
        rw = {sitedir + '/postgres': '/var/lib/postgresql/data'}
        volumes_from = None

    running = set(containers_running(get_container_name))

    needed = set(extra_containers).union({'postgres', 'solr'})

    if not needed.issubset(running):
        stop_supporting_containers(get_container_name, extra_containers)

        # users are created when data dir is blank so we must pass
        # all the user passwords as environment vars
        # XXX: postgres entrypoint magic
        docker.run_container(
            name=get_container_name('postgres'),
            image='datacats/postgres',
            environment=passwords,
            rw=rw,
            volumes_from=volumes_from,
            log_syslog=log_syslog)

        docker.run_container(
            name=get_container_name('solr'),
            image='datacats/solr',
            rw={sitedir + '/solr': '/var/lib/solr'},
            ro={srcdir + '/schema.xml': '/etc/solr/conf/schema.xml'},
            log_syslog=log_syslog)

        for container in extra_containers:
            # We don't know a whole lot about the extra containers so we're just gonna have to
            # mount /project and /datadir r/o even if they're not needed for ease of
            # implementation.
            docker.run_container(
                name=get_container_name(container),
                image=EXTRA_IMAGE_MAPPING[container],
                ro={
                    sitedir: '/datadir',
                    srcdir: '/project'
                },
                log_syslog=log_syslog
            )
707203
def start(self):
        '''
        
        '''
        super(SaltAPI, self).start()
        if check_user(self.config['user']):
            log.info('The salt-api is starting up')
            self.api.run()
902841
def run(self):
        
        self.collector.start()
        if self.standalone:
            self.collector.join()
1245470
public function boot()
    {
        if (!$this->booted) {

            $this->initializeContainer();
            $this->initializeBundles();
            $this->initializeRouting();
            $this->initializeConfigure();

            $this->booted = true;
        }
    }
396753
private synchronized void initializeListOfPreviousContainers() {
    if (this.previousContainers == null) {
      final List<Container> yarnPrevContainers =
          this.registration.getRegistration().getContainersFromPreviousAttempts();

      // If it's still null, create an empty list to indicate that it's not a restart.
      if (yarnPrevContainers == null) {
        this.previousContainers = Collections.unmodifiableSet(new HashSet<Container>());
      } else {
        this.previousContainers = Collections.unmodifiableSet(new HashSet<>(yarnPrevContainers));
      }

      yarnContainerManager.onContainersRecovered(this.previousContainers);
    }
  }
314765
function initContainer(opts) {
    var apps, appDir;

    container = opts.container;

    // if batch, preload that dir
    container === 'batch' ?
        opts.preload.push('batch') :
        opts.preload.push('middleware');

    if (container === 'webserver') {
        appDir = path.join(opts.rootDir, '/app');
        apps = fs.readdirSync(appDir);
        _.each(apps, function (app) {
            opts.preload = opts.preload.concat([
                'app/' + app + '/filters',
                'app/' + app + '/utils'
            ]);
        });
    }

    init(opts);
}
336021
def start(self):
    

    if self.__running:
      raise RuntimeError('ThreadPool already running')
    [t.start() for t in self.__threads]
    self.__running = True
225969
def run(self, user_kw=None, build_kw=None):
        
        user_kw = {} if user_kw is None else user_kw
        build_kw = {} if build_kw is None else build_kw
        n = self._build(self.get_items(**user_kw), **build_kw)
        finalized = self.finalize(self._status.has_failures())
        if not finalized:
            _log.error("Finalization failed")
        return n
528556
function(dockcontainer, cb) {
          var opts = confImage && confImage.options && confImage.options.start
              || {};
          grunt.log.writeln("Starting container.");
          dockcontainer.start(opts, cb);
        }
945882
def run_container():
    """"""

    os.chdir(my_directory)

    cmd = [
        'docker', 'run',
        '-it', '--rm',
        '-v', '{}:/cauldron'.format(my_directory),
        '-p', '5010:5010',
        'cauldron_app',
        '/bin/bash'
    ]

    return os.system(' '.join(cmd))
1101523
def runContainer(image, **kwargs):
    '''
    '''
    container = None
    try:
        container = client.containers.run(image, **kwargs)
        if "name" in kwargs.keys():
          print("Container", kwargs["name"], "is now running.")
    except ContainerError as exc:
        eprint("Failed to run container")
        raise exc
    except ImageNotFound as exc:
        eprint("Failed to find image to run as a docker container")
        raise exc
    except APIError as exc:
        eprint("Unhandled error")
        raise exc

    return container
1056530
def run(self):
        '''
        
        '''
        self.utils = salt.loader.utils(self.opts, proxy=self.proxy)
        if salt.utils.platform.is_windows():
            # Calculate function references since they can't be pickled.
            if self.opts['__role'] == 'master':
                self.runners = salt.loader.runner(self.opts, utils=self.utils)
            else:
                self.runners = []
            self.funcs = salt.loader.minion_mods(self.opts, utils=self.utils, proxy=self.proxy)

        self.engine = salt.loader.engines(self.opts,
                                          self.funcs,
                                          self.runners,
                                          self.utils,
                                          proxy=self.proxy)
        kwargs = self.config or {}
        try:
            self.engine[self.fun](**kwargs)
        except Exception as exc:
            log.critical(
                'Engine \'%s\' could not be started!',
                self.fun.split('.')[0], exc_info=True
            )
559566
def get_containers(config,
                   all=True,
                   trunc=False,
                   since=None,
                   before=None,
                   limit=-1,
                   *args,
                   **kwargs):
    '''
    
    '''
    err = "Unknown"
    client = _get_client(config)
    try:
        ret = client.containers(all=all,
                                trunc=trunc,
                                since=since,
                                before=before,
                                limit=limit)
        return ret
    except Exception as e:
        err = e
    utils.error("Unable to list Docker containers: %s"%err)
    return None
960269
def _run_arvados(args):
    
    assert not args.no_container, "Arvados runs require containers"
    assert "ARVADOS_API_TOKEN" in os.environ and "ARVADOS_API_HOST" in os.environ, \
        "Need to set ARVADOS_API_TOKEN and ARVADOS_API_HOST in environment to run"
    main_file, json_file, project_name = _get_main_and_json(args.directory)
    flags = ["--enable-reuse", "--api", "containers", "--submit", "--no-wait"]
    cmd = ["arvados-cwl-runner"] + flags + args.toolargs + [main_file, json_file]
    _run_tool(cmd)
666041
def run_container(self, image_id, service_name, **kwargs):
        """"""
        run_kwargs = self.run_kwargs_for_service(service_name)
        run_kwargs.update(kwargs, relax=True)
        logger.debug('Running container in docker', image=image_id, params=run_kwargs)

        container_obj = self.client.containers.run(
            image=image_id,
            detach=True,
            **run_kwargs
        )

        log_iter = container_obj.logs(stdout=True, stderr=True, stream=True)
        mux = logmux.LogMultiplexer()
        mux.add_iterator(log_iter, plainLogger)
        return container_obj.id
1163983
def start(self, run=False):
        """"""
        if run:
            args, argv = [], []
            # for coconut-run, all args beyond the source file should be wrapped in an --argv
            for i in range(1, len(sys.argv)):
                arg = sys.argv[i]
                args.append(arg)
                # if arg is source file, put everything else in argv
                if not arg.startswith("-") and canparse(arguments, args[:-1]):
                    argv = sys.argv[i + 1:]
                    break
            if "--verbose" in args:
                args = list(coconut_run_verbose_args) + args
            else:
                args = list(coconut_run_args) + args
            args += ["--argv"] + argv
        else:
            args = None
        self.cmd(args)
1034124
def _run_atstart():
    ''''''
    global _atstart
    for callback, args, kwargs in _atstart:
        callback(*args, **kwargs)
    del _atstart[:]