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

Linear search does not account for the case when the container is not found #868

Closed
zzvara opened this issue Apr 11, 2020 · 9 comments · Fixed by #876
Closed

Linear search does not account for the case when the container is not found #868

zzvara opened this issue Apr 11, 2020 · 9 comments · Fixed by #876

Comments

@zzvara
Copy link
Contributor

zzvara commented Apr 11, 2020

https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/2e4559eac0f593398d5e19ef85bfc6a5df032033/pkg/webhook/patch.go#L167

When the container not found with the name, hardcoded into the configuration, it should log an error that it was not able to patch the Pod spec. Currently, this results in an NPE and panic. In addition, provide a hint to the users that the problem around container naming may be fixed using spark.kubernetes.executor.podTemplate.

@liyinan926
Copy link
Collaborator

Yeah, it needs to be guarded against that. Will definitely fix that. However, the operator will not use the pod template support in Spark 3.0 and has no plan to support that given that it already has an API for most pod configuration needs. So there won't be a way for users to use a custom container name for the driver and container.

@zzvara
Copy link
Contributor Author

zzvara commented Apr 15, 2020

I see. spark.kubernetes.executor.podTemplate is required to make Spark 3.0.0-rc1 work with the current Spark Operator.

@liyinan926
Copy link
Collaborator

No, spark.kubernetes.executor.podTemplate is not required. It's just an optional way to customize the executor pods using some YAML template. One can still use Spark 3.0.0 with the operator.

@zzvara
Copy link
Contributor Author

zzvara commented Apr 15, 2020

Spark 3.0.0-rc1 names the executor pod as "spark-kubernetes-executor". Spark Operator has a configuration constant for that, "executor". Spark Operator searches for "executor" container name, but the container name is "spark-kubernetes-executor".

Thus, the following line of code will result in an NPE:

https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/2e4559eac0f593398d5e19ef85bfc6a5df032033/pkg/webhook/patch.go#L177

As far as I know, there is no other way to rename the executor Pod's container name, then using podTemplate.

@liyinan926
Copy link
Collaborator

I wasn't aware of the renaming of the default executor container name. It was simply executor in Spark 2.4.x and 2.3.x. We can use a different default value depending on the value of spec.sparkVersion.

@zzvara
Copy link
Contributor Author

zzvara commented Apr 15, 2020

Sure, that can work!

Apart from that, we are running Spark 3.0.0-rc1 in production with the Spark Operator as we speak without any issues for 12 Spark streaming jobs.

@liyinan926
Copy link
Collaborator

Good to know that! Will create a PR with the fix.

@liyinan926
Copy link
Collaborator

@zzvara FYI: #876.

@zzvara
Copy link
Contributor Author

zzvara commented Apr 17, 2020

Thanks, when it goes live I throw out my podTemplates! :-D

liyinan926 added a commit to liyinan926/spark-on-k8s-operator that referenced this issue Apr 22, 2020
liyinan926 added a commit that referenced this issue Apr 22, 2020
akhurana001 pushed a commit to lyft/spark-on-k8s-operator that referenced this issue Oct 29, 2020
jbhalodia-slack pushed a commit to jbhalodia-slack/spark-operator that referenced this issue Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants