Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User can override pod template #3891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions paasta_tools/cli/cmds/spark_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,9 @@ def paasta_spark_run(args: argparse.Namespace) -> int:
paasta_cluster = system_paasta_config.get_eks_cluster_aliases().get(
args.cluster, args.cluster
)

user_pod_template_path=user_spark_opts.get(
"spark.kubernetes.executor.podTemplateFile", ""
)
spark_conf_builder = spark_config.SparkConfBuilder()
spark_conf = spark_conf_builder.get_spark_conf(
cluster_manager=args.cluster_manager,
Expand All @@ -1234,7 +1236,13 @@ def paasta_spark_run(args: argparse.Namespace) -> int:
use_eks=True,
k8s_server_address=k8s_server_address,
)

if user_pod_template_path:
spark_conf["spark.kubernetes.executor.podTemplateFile"] = user_pod_template_path
pod_template_path=""
else:
pod_template_path = spark_conf.get(
"spark.kubernetes.executor.podTemplateFile", ""
)
return configure_and_run_docker_container(
args,
docker_img=docker_image_digest,
Expand All @@ -1243,8 +1251,6 @@ def paasta_spark_run(args: argparse.Namespace) -> int:
spark_conf=spark_conf,
aws_creds=aws_creds,
cluster_manager=args.cluster_manager,
pod_template_path=spark_conf.get(
"spark.kubernetes.executor.podTemplateFile", ""
),
pod_template_path=pod_template_path,
extra_driver_envs=driver_envs_from_tronfig,
)