Skip to content

Commit

Permalink
support spark crd use pyFiles (#3056) (#3058)
Browse files Browse the repository at this point in the history
Co-authored-by: chengjoey <[email protected]>
  • Loading branch information
erda-bot and chengjoey authored Nov 16, 2021
1 parent 8a12314 commit 02583bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apistructs/bigdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ type SparkConf struct {
PythonVersion *string `json:"pythonVersion,omitempty"`
DriverResource BigdataResource `json:"driverResource"`
ExecutorResource BigdataResource `json:"executorResource"`
Deps Dependencies `json:"deps"`
}

type Dependencies struct {
PyFiles []string `json:"pyFiles"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ func (k *K8sSpark) generateKubeSparkJob(job *apistructs.JobFromUser, conf *apist
},
}

// add deps pyFiles
if len(conf.Spec.SparkConf.Deps.PyFiles) > 0 {
sparkApp.Spec.Deps.PyFiles = conf.Spec.SparkConf.Deps.PyFiles
}

if sparkApp.Spec.Type == sparkv1beta2.PythonApplicationType {
sparkApp.Spec.PythonVersion = stringptr("3")
if conf.Spec.SparkConf.PythonVersion != nil {
Expand Down

0 comments on commit 02583bd

Please sign in to comment.