def start(self):
     self.log.info('Start Kubernetes executor')
     self.worker_uuid = KubeWorkerIdentifier.get_or_create_current_kube_worker_uuid(
     )
     self.log.debug('Start with worker_uuid: %s', self.worker_uuid)
     # always need to reset resource version since we don't know
     # when we last started, note for behavior below
     # https://github.com/kubernetes-client/python/blob/master/kubernetes/docs
     # /CoreV1Api.md#list_namespaced_pod
     KubeResourceVersion.reset_resource_version()
     self.task_queue = Queue()
     self.result_queue = Queue()
     self.kube_client = get_kube_client()
     self.kube_scheduler = AirflowKubernetesScheduler(
         self.kube_config, self.task_queue, self.result_queue,
         self.kube_client, self.worker_uuid)
     self._inject_secrets()
     self.clear_not_launched_queued_tasks()
Esempio n. 2
0
 def start(self):
     self.log.info('Start Kubernetes executor')
     self.worker_uuid = KubeWorkerIdentifier.get_or_create_current_kube_worker_uuid()
     self.log.debug('Start with worker_uuid: %s', self.worker_uuid)
     # always need to reset resource version since we don't know
     # when we last started, note for behavior below
     # https://github.com/kubernetes-client/python/blob/master/kubernetes/docs
     # /CoreV1Api.md#list_namespaced_pod
     KubeResourceVersion.reset_resource_version()
     self.task_queue = Queue()
     self.result_queue = Queue()
     self.kube_client = get_kube_client()
     self.kube_scheduler = AirflowKubernetesScheduler(
         self.kube_config, self.task_queue, self.result_queue,
         self.kube_client, self.worker_uuid
     )
     self._inject_secrets()
     self.clear_not_launched_queued_tasks()
 def test_reset_resource_version(self):
     session = settings.Session()
     version = KubeResourceVersion.reset_resource_version(session)
     self.assertEqual(version, '0')
     self.assertEqual(
         KubeResourceVersion.get_current_resource_version(session), '0')
Esempio n. 4
0
 def test_reset_resource_version(self):
     session = settings.Session()
     version = KubeResourceVersion.reset_resource_version(session)
     self.assertEqual(version, '0')
     self.assertEqual(KubeResourceVersion.get_current_resource_version(session), '0')