feat: add gRPC Spark submitter plugin + proto (optional plugin for spark-submit via gRPC) #2748
+842
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a configurable gRPC plugin for submitting Spark applications (instead of invoking
${SPARK_HOME}/bin/spark-submit).Submitting via gRPC reduces per-submission overhead (no new process per submission) and enables improved controller throughput
when reconciling many new SparkApplications.
What this PR adds / changes
proto/sparksubmit/spark_submit.protoSparkSubmitServiceand messages forSubmitRequest/SubmitResponse.Generated protobuf stubs (under
proto/sparksubmit/):spark_submit.pb.gospark_submit_grpc.pb.gointernal/controller/sparkapplication/grpc_submitter.goGRPCSubmitterimplementing the existingSparkApplicationSubmitterinterface.SparkSubmitterwhich runsspark-submitlocally.internal/controller/sparkapplication/grpc_submitter_test.gocmd/operator/controller/start.goto scheduled spark application reconciler options (
--scheduled-sa-timestamp-precision).charts/spark-operator-chart/templates/controller/deployment.yamlcharts/spark-operator-chart/values.yamlcontroller.scheduledSparkApplication.timestampPrecision.Makefileproto-gentarget usesprotocandprotoc-gen-go/protoc-gen-go-grpc.Tests
Behavior & Backwards compatibility
SparkSubmitterwhich runsspark-submit.SparkApplicationSubmitter. It can be used by configuring the controller to use it (future config/flag or DI).--scheduled-sa-timestamp-precisioncontroller.scheduledSparkApplication.timestampPrecisionnanos.How to generate proto stubs locally
From repo root:
Files changed
Added:
proto/sparksubmit/spark_submit.protoproto/sparksubmit/spark_submit.pb.go(generated)proto/sparksubmit/spark_submit_grpc.pb.go(generated)internal/controller/sparkapplication/grpc_submitter.gointernal/controller/sparkapplication/grpc_submitter_test.goModified:
Makefile(proto-gen bits)cmd/operator/controller/start.gocharts/spark-operator-chart/templates/controller/deployment.yamlcharts/spark-operator-chart/values.yamlgo.mod(if needed for generated packages)internal/controller/scheduledsparkapplication/controller_test.go(tests)Fixed Issue
#2746
Testing and status
internal/controller/sparkapplicationpass locally in my environment.protocand go-based codegen used to generate stubs; go test passes for the updated packages.Checklist (for reviewers)