Skip to content

Commit edf00fa

Browse files
committed
Add new library publishing with docs
1 parent 6ce5189 commit edf00fa

File tree

4 files changed

+83
-1
lines changed

4 files changed

+83
-1
lines changed

docs/spark_operator_api_library.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# Use Spark Operator API Library in Your Java Application
21+
22+
In addition to direct YAML, you may also leverage our Java API library to create and manage Spark
23+
workloads.
24+
25+
## Choosing the Right Dependency
26+
27+
We publish two variants of this library:
28+
29+
```groovy
30+
implementation("org.apache.spark:spark-operator-api")
31+
```
32+
33+
This library keeps your project free from a direct dependency on Fabric8 Kubernetes Client. It's
34+
recommended if you only interact with our API at the YAML/CRD level (e.g. generating manifests,
35+
using our higher-level abstractions). Use this if you don’t need direct access to Fabric8 model
36+
objects like PodTemplateSpec, Deployment, etc.
37+
38+
If your application requires access on fabric8 models, it's recommended to use
39+
40+
```groovy
41+
implementation("org.apache.spark:spark-operator-api-fabric8")
42+
```
43+
44+
This library publishes the same core library, with Fabric8 declared as an API dependency. This
45+
means Fabric8 model classes (Pod, PodTemplateSpec, Deployment, etc.) are available directly on
46+
your classpath when you depend on our library. It's recommended if you want to compose or extend
47+
Spark Operator API using Fabric8 types (for example, embedding a Fabric8 PodTemplateSpec into
48+
Spark Operator CRD).
49+
50+
Do not depend on both `spark-operator-api` and `spark-operator-api-fabric8` at the same time. They
51+
contain the same classes and will conflict on the classpath. Choose one based on your use case.

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
rootProject.name = 'apache-spark-kubernetes-operator'
2020
include 'spark-operator-api'
21+
include 'spark-operator-api-fabric8'
2122
include 'spark-submission-worker'
2223
include 'spark-operator'
2324
include "build-tools-docs-utils"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
plugins {
21+
id 'java-library'
22+
}
23+
24+
dependencies {
25+
api project(":spark-operator-api")
26+
// fabric8
27+
api(libs.kubernetes.client) {
28+
exclude group: 'com.squareup.okhttp3'
29+
}
30+
}

spark-operator-api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222

2323
dependencies {
2424
// fabric8
25-
api(libs.kubernetes.client) {
25+
implementation(libs.kubernetes.client) {
2626
exclude group: 'com.squareup.okhttp3'
2727
}
2828
compileOnly(libs.crd.generator.apt)

0 commit comments

Comments
 (0)