Skip to content

Commit 37d4097

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

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

docs/spark_operator_api_library.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Use Spark Operator API Library in Your Java Application
2+
3+
In addition to direct YAML, you may also leverage our Java API library to create and manage Spark
4+
workloads.
5+
6+
## Choosing the Right Dependency
7+
8+
We publish two variants of this library:
9+
10+
```groovy
11+
implementation("org.apache.spark:spark-operator-api")
12+
```
13+
14+
This library keeps your project free from a direct dependency on Fabric8 Kubernetes Client. It's
15+
recommended if you only interact with our API at the YAML/CRD level (e.g. generating manifests,
16+
using our higher-level abstractions). Use this if you don’t need direct access to Fabric8 model
17+
objects like PodTemplateSpec, Deployment, etc.
18+
19+
If your application requires access on fabric8 models, it's recommended to use
20+
21+
```groovy
22+
implementation("org.apache.spark:spark-operator-api-fabric8")
23+
```
24+
25+
This library publishes the same core library, with Fabric8 declared as an API dependency. This
26+
means Fabric8 model classes (Pod, PodTemplateSpec, Deployment, etc.) are available directly on
27+
your classpath when you depend on our library. It's recommended if you want to compose or extend
28+
Spark Operator API using Fabric8 types (for example, embedding a Fabric8 PodTemplateSpec into
29+
Spark Operator CRD).
30+
31+
Do not depend on both `spark-operator-api` and `spark-operator-api-fabric8` at the same time. They
32+
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)