

def start(self, num_minions=3, provider='gce'):
    success = True
    try:
        os.environ['NUM_MINIONS'] = str(num_minions)
        os.environ['KUBERNETES_PROVIDER'] = provider
        subprocess.check_call(['kube-up.sh'])
        binderd_proc = subprocess.Popen(['binderd'])
        time.sleep(5)
        info_log(self.TAG, 'Launching proxy server...')
        self._start_proxy_server()
        info_log(self.TAG, 'Launching private Docker registry...')
        self._start_registry_server()
        info_log(self.TAG, 'Preloading registry server with binder-base image...')
        self._preload_registry_server()
        info_log(self.TAG, 'Preloading binder-base image onto all nodes...')
        success = (success and self.preload_image('binder-base'))
        cron = CronTab()
        cmd = ' '.join([get_env_string(), os.path.join(MainSettings.ROOT, 'util', 'stop-inactive-apps'), '&>/tmp/binder-cron'])
        job = cron.new(cmd, comment='binder-stop')
        job.minute.every(MonitoringSettings.APP_CRON_PERIOD)
        job.enable(True)
        cron.write_to_user(user=True)
    except subprocess.CalledProcessError as e:
        success = False
    if success:
        info_log(self.TAG, 'Started Kubernetes cluster successfully')
    else:
        error_log(self.TAG, 'Could not launch the Kubernetes cluster')
    return success

dataset/ETHPy150Open binder-project/binder/binder/cluster.py KubernetesManager.start/original