def get_task_pod_spec(self,<EOL>volume_mounts,<EOL>volumes,<EOL>resource_name,<EOL>persistence_outputs=None,<EOL>persistence_data=None,<EOL>outputs_refs_jobs=None,<EOL>outputs_refs_experiments=None,<EOL>env_vars=None,<EOL>command=None,<EOL>args=None,<EOL>init_command=None,<EOL>init_args=None,<EOL>init_env_vars=None,<EOL>resources=None,<EOL>ports=None,<EOL>secret_refs=None,<EOL>configmap_refs=None,<EOL>ephemeral_token=None,<EOL>node_selector=None,<EOL>affinity=None,<EOL>tolerations=None,<EOL>sidecar_context_mounts=None,<EOL>init_context_mounts=None,<EOL>restart_policy=None):
sidecar_context_mounts = to_list(sidecar_context_mounts, check_none=True)<EOL>init_context_mounts = to_list(init_context_mounts, check_none=True)<EOL>volume_mounts = to_list(volume_mounts, check_none=True)<EOL>volumes = to_list(volumes, check_none=True)<EOL>gpu_volume_mounts, gpu_volumes = get_gpu_volumes_def(resources)<EOL>volume_mounts += gpu_volume_mounts<EOL>volumes += gpu_volumes<EOL>pod_container = self.get_pod_container(volume_mounts=volume_mounts,<EOL>persistence_outputs=persistence_outputs,<EOL>persistence_data=persistence_data,<EOL>outputs_refs_jobs=outputs_refs_jobs,<EOL>outputs_refs_experiments=outputs_refs_experiments,<EOL>secret_refs=secret_refs,<EOL>configmap_refs=configmap_refs,<EOL>resources=resources,<EOL>env_vars=env_vars,<EOL>command=command,<EOL>args=args,<EOL>ports=ports,<EOL>ephemeral_token=ephemeral_token)<EOL>containers = [pod_container]<EOL>if self.use_sidecar:<EOL><INDENT>sidecar_volume_mounts = self.get_sidecar_volume_mounts(<EOL>persistence_outputs=persistence_outputs,<EOL>persistence_data=persistence_data,<EOL>context_mounts=sidecar_context_mounts)<EOL>sidecar_container = self.get_sidecar_container(volume_mounts=sidecar_volume_mounts)<EOL>containers.append(sidecar_container)<EOL><DEDENT>init_container = self.get_init_container(init_command=init_command,<EOL>init_args=init_args,<EOL>env_vars=init_env_vars,<EOL>context_mounts=init_context_mounts,<EOL>persistence_outputs=persistence_outputs,<EOL>persistence_data=persistence_data)<EOL>init_containers = to_list(init_container, check_none=True)<EOL>node_selector = self._get_node_selector(node_selector=node_selector)<EOL>affinity = self._get_affinity(affinity=affinity)<EOL>tolerations = self._get_tolerations(tolerations=tolerations)<EOL>service_account_name = self._get_service_account_name()<EOL>return client.V1PodSpec(<EOL>security_context=get_security_context() if self.use_security_context else None,<EOL>restart_policy=restart_policy,<EOL>service_account_name=service_account_name,<EOL>init_containers=init_containers,<EOL>containers=containers,<EOL>volumes=volumes,<EOL>node_selector=node_selector,<EOL>tolerations=tolerations,<EOL>affinity=affinity)<EOL>
Pod spec to be used to create pods for tasks: master, worker, ps.