Skip to content
Snippets Groups Projects
Unverified Commit 234c2359 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #287 from natefoo/coex-job-ttl

Support the k8s_job_ttl_secs_after_finished option as in the Galaxy Kubernetes runner
parents f61d940e a1407821
No related branches found
No related tags found
3 merge requests!44Try to fix CI.,!38Generalize orchestrated container scheduling.,!22update Pulsar to 0.15.3
......@@ -536,8 +536,7 @@ class MessageCoexecutionPodJobClient(BaseMessageJobClient):
}
}
spec = {"template": template}
if "k8s_walltime_limit" in params:
spec["activeDeadlineSeconds"] = int(params["k8s_walltime_limit"])
spec.update(self._job_spec_params(params))
k8s_job_obj = job_object_dict(params, k8s_job_prefix, spec)
pykube_client = self._pykube_client
job = Job(pykube_client, k8s_job_obj)
......@@ -578,6 +577,14 @@ class MessageCoexecutionPodJobClient(BaseMessageJobClient):
job_prefix = produce_k8s_job_prefix(app_prefix="pulsar", job_id=job_id, instance_id=self.instance_id)
return job_prefix
def _job_spec_params(self, params):
spec = {}
if "k8s_walltime_limit" in params:
spec["activeDeadlineSeconds"] = int(params["k8s_walltime_limit"])
if "k8s_job_ttl_secs_after_finished" in params and params.get("k8s_cleanup_job") != "never":
spec["ttlSecondsAfterFinished"] = int(params["k8s_job_ttl_secs_after_finished"])
return spec
def _pulsar_container_resources(self, params):
return self._container_resources(params, container='pulsar')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment