-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Merged by Bors] - Spark history server #187
Closed
Closed
Changes from 60 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
91f5936
Remove zombie test definition.
razvan 0fc5125
wip : history server
razvan e5044f4
Consolidate constants.
razvan 057f37c
wip: create deployment, service and config map
razvan a5abf76
Update changelog
razvan 34c3dd5
Use framework image struct, update crds and more.
razvan e587200
Use roles and role groups.
razvan 79ea167
Kuttl tests almost green
razvan 8362df5
Populate spark config automatically.
razvan 8f593c2
Use S3 secrets for the logs bucket
razvan 9d2c661
Successfuly started histo server, cleanups, replicas.
razvan c82335c
collect all three controllers
adwk67 dfb7d7b
write logs to history server and check results
adwk67 16ff530
merged main
adwk67 0027f45
re-format
adwk67 a9622f7
added resources using fragments
adwk67 6e26cb7
service account
adwk67 2895ab4
added sleep in tests for minio
adwk67 b2765f8
regenerate charts
adwk67 3c99f0d
use same clusterrole for history server, and add pvc permissions
adwk67 935d9bf
documentation
adwk67 21a20c3
added operator-rs update to changelog
adwk67 6cec93c
parse cleaner config
adwk67 9b382ba
use history api for test
adwk67 977eb05
linting
adwk67 bfbc8dd
Extract cleaner settings into their own function.
razvan 3b04da8
The operator chooses the appropriate s3 credentials provider
razvan d14788a
Extract S3LogDir to it's own module.
razvan d9c76c4
Automatically configure event logs for applications that require it.
razvan ad26663
removed unused dependency
adwk67 918a2dd
Clean eventual orphaned resources.
razvan 2d20012
Update docs.
razvan a21bc75
Update docs/modules/ROOT/pages/history_server.adoc
razvan 6af52e6
Update docs/modules/ROOT/examples/example-history-server.yaml
razvan 3070945
Update docs/modules/ROOT/pages/history_server.adoc
razvan ae9e5d4
Update docs/modules/ROOT/pages/history_server.adoc
razvan e211669
Update docs/modules/ROOT/pages/history_server.adoc
razvan 213e223
Update docs/modules/ROOT/pages/history_server.adoc
razvan 1650f09
Mount credentials in separate folders and configure bucket specific p…
razvan b3158b1
Use different endpoints for data and event logs.
razvan 664e6ec
Implement fix for "S3 reference inconsistency #162"
razvan f308142
main merge
razvan 1fd5ebb
Update docs/modules/ROOT/pages/history_server.adoc
razvan bd49457
Update docs/modules/ROOT/pages/history_server.adoc
razvan 30479f5
Update docs/modules/ROOT/pages/history_server.adoc
razvan 149bc1f
Update CHANGELOG, docs and clean up
razvan 91bb1df
Remove alternative Dockerfile
razvan 6ab2278
Merge branch 'main' into 124-implement-adr-22-spark-history-server
razvan 685b292
Use references to S3 objects in tests.
razvan 2c843b7
Update rust/operator-binary/src/spark_k8s_controller.rs
razvan 9037986
Update rust/operator-binary/src/history_controller.rs
razvan 3f95292
Update rust/operator-binary/src/history_controller.rs
razvan e0c7d8c
Update rust/operator-binary/src/history_controller.rs
razvan 2de8ee4
Update rust/crd/src/history.rs
razvan fe169a1
Update docs/modules/ROOT/pages/usage.adoc
razvan 702b828
Update Rust code with review feedback.
razvan 5bc89dd
Update rust/crd/src/s3logdir.rs
sbernauer 78210d5
Update rust/crd/src/s3logdir.rs
sbernauer 3e5d845
Update rust/operator-binary/src/history_controller.rs
sbernauer 12cb8d9
Update rust/operator-binary/src/history_controller.rs
sbernauer 73aad65
Fix services and watch more objects.
razvan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ rules: | |
- "" | ||
resources: | ||
- configmaps | ||
- persistentvolumeclaims | ||
- pods | ||
- secrets | ||
- serviceaccounts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
apiVersion: spark.stackable.tech/v1alpha1 | ||
kind: SparkApplication | ||
metadata: | ||
name: spark-pi-s3-1 | ||
spec: | ||
version: "1.0" | ||
sparkImage: docker.stackable.tech/stackable/spark-k8s:3.3.0-stackable0.3.0 | ||
sparkImagePullPolicy: IfNotPresent | ||
mode: cluster | ||
mainClass: org.apache.spark.examples.SparkPi | ||
mainApplicationFile: s3a://my-bucket/spark-examples_2.12-3.3.0.jar | ||
s3connection: # <1> | ||
razvan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
inline: | ||
host: test-minio | ||
port: 9000 | ||
accessStyle: Path | ||
credentials: | ||
secretClass: s3-credentials-class # <2> | ||
logFileDirectory: # <3> | ||
s3: | ||
prefix: eventlogs/ # <4> | ||
bucket: | ||
inline: | ||
bucketName: spark-logs # <5> | ||
connection: | ||
inline: | ||
host: test-minio | ||
port: 9000 | ||
accessStyle: Path | ||
credentials: | ||
secretClass: history-credentials-class # <6> | ||
executor: | ||
instances: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
apiVersion: spark.stackable.tech/v1alpha1 | ||
kind: SparkHistoryServer | ||
metadata: | ||
name: spark-history | ||
spec: | ||
image: | ||
productVersion: 3.3.0 | ||
stackableVersion: 0.3.0 | ||
logFileDirectory: # <1> | ||
sbernauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
s3: | ||
prefix: eventlogs/ # <2> | ||
bucket: # <3> | ||
inline: | ||
bucketName: spark-logs | ||
connection: | ||
inline: | ||
host: test-minio | ||
port: 9000 | ||
accessStyle: Path | ||
credentials: | ||
secretClass: history-credentials-class | ||
sparkConf: # <4> | ||
nodes: | ||
roleGroups: | ||
cleaner: | ||
replicas: 1 # <5> | ||
config: | ||
cleaner: true # <6> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
* xref:usage.adoc[] | ||
* xref:job_dependencies.adoc[] | ||
* xref:rbac.adoc[] | ||
* xref:history_server.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
= Spark History Server | ||
|
||
== Overview | ||
|
||
The Stackable Spark-on-Kubernetes operator runs Apache Spark workloads in a Kubernetes cluster, whereby driver- and executor-pods are created for the duration of the job and then terminated. One or more Spark History Server instances can be deployed independently of `SparkApplication` jobs and used as an end-point for spark logging, so that job information can be viewed once the job pods are no longer available. | ||
|
||
== Deployment | ||
|
||
The example below demonstrates how to set up the history server running in one Pod with scheduled cleanups of the event logs. The event logs are loaded from an S3 bucket named `spark-logs` and the folder `eventlogs/`. The credentials for this bucket are provided by the secret class `s3-credentials-class`. For more details on how the Stackable Data Platform manages S3 resources see the xref:home:concepts:s3.adoc[S3 resources] page. | ||
|
||
|
||
[source,yaml] | ||
---- | ||
include::example$example-history-server.yaml[] | ||
---- | ||
|
||
<1> The location of the event logs. Must be a S3 bucket. Future implementations might add support for other shared filesystems such as HDFS. | ||
<2> Folder within the S3 bucket where the log files are located. This folder is required and must exist before setting up the history server. | ||
<3> The S3 bucket definition, here provided in-line. | ||
<4> Additional history server configuration properties can be provided here as a map. For possible properties see: https://spark.apache.org/docs/latest/monitoring.html#spark-history-server-configuration-options | ||
<5> This deployment has only one Pod. Multiple history servers can be started, all reading the same event logs by increasing the replica count. | ||
<6> This history server will automatically clean up old log files by using default properties. You can change any of these by using the `sparkConf` map. | ||
|
||
NOTE: Only one role group can have scheduled cleanups enabled (`cleaner: true`) and this role group cannot have more than 1 replica. | ||
|
||
The secret with S3 credentials must contain at least the following two keys: | ||
|
||
* `accessKey` - the access key of a user with read and write access to the event log bucket. | ||
* `secretKey` - the secret key of a user with read and write access to the event log bucket. | ||
|
||
Any other entries of the Secret are ignored by the operator. | ||
|
||
== Application configuration | ||
|
||
|
||
The example below demonstrates how to configure Spark applications to write log events to an S3 bucket. | ||
|
||
[source,yaml] | ||
---- | ||
include::example$example-history-app.yaml[] | ||
---- | ||
|
||
<1> Location of the data that is being processed by the application. | ||
<2> Credentials used to access the data above. | ||
<3> Instruct the operator to configure the application with logging enabled. | ||
<4> Folder to store logs. This must match the prefix used by the history server. | ||
<5> Bucket to store logs. This must match the bucket used by the history server. | ||
<6> Credentials used to write event logs. These can, of course, differ from the credentials used to process data. | ||
|
||
|
||
|
||
== History Web UI | ||
|
||
To access the history server web UI, use one of the `NodePort` services created by the operator. For the example above, the operator created two services as shown: | ||
|
||
[source,bash] | ||
---- | ||
$ kubectl get svc | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
spark-history-node NodePort 10.96.222.233 <none> 18080:30136/TCP 52m | ||
spark-history-node-cleaner NodePort 10.96.203.43 <none> 18080:32585/TCP 52m | ||
---- | ||
|
||
By setting up port forwarding on 18080 the UI can be opened by pointing your browser to `http://localhost:18080`: | ||
|
||
image::history-server-ui.png[History Server Console] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird but it is what it is