[WIP] Project in active dev state.
GoFlint is an idiomatic Go library for submitting Apache Spark jobs via spark-submit
.
Designed for clarity and type safety, it wraps Spark’s CLI with a fluent Go API.
- Fluent API for all
spark-submit
options (masters, deploy modes, args, etc.) - Context support for cancellation/timeouts
- Extensible with custom logging and monitoring
- Zero dependencies (except Go’s standard library)
go get github.com/aagumin/flint
package main
import (
"context"
"fmt"
"os"
"path"
"github.com/aagumin/goflint/flint"
sc "github.com/aagumin/goflint/flint/sparkconf"
)
func main() {
xx := map[string]string{"spark.driver.port": "4031", "spark.driver.host": "localhost"}
sparkCfg := sc.NewFrozenConf(xx)
scalaExamples := path.Join(os.Getenv("SPARK_HOME"), "examples/jars/spark-examples_2.12-3.5.3.jar")
submit := flint.NewSparkApp(
flint.WithApplication(scalaExamples),
flint.WithSparkConf(sparkCfg),
flint.WithName("GoFlint"),
flint.WithMainClass("org.apache.spark.examples.parkPi"),
)
base := submit.Build()
updatedSubmit := flint.ExtendSparkApp(
&base,
flint.WithMaster(""),
// Other options...
)
app := updatedSubmit.Build()
ctx := context.Background()
_, err = app.Submit(ctx)
if err != nil {
fmt.Println(err)
}
}
-
Idiomatic Go
- Errors as
error
, not panics context.Context
support- Interfaces for extensibility
- Errors as
-
Spark Compatibility
- Maps 1:1 with
spark-submit
CLI - No hidden magic – transparent command generation
- Maps 1:1 with
-
Batteries Included
- Defaults for quick starts
- Extensible for complex cases
- Async job monitoring
- YARN/K8s auth helpers
- Prometheus metrics integration
PRs welcome! See CONTRIBUTING.md for guidelines.
MIT © Arsen Gumin