Skip to content

Conversation

jiangzho
Copy link
Contributor

@jiangzho jiangzho commented Sep 2, 2025

What changes were proposed in this pull request?

This PR exposes fabric8 dependencies as api in gradle build and hence in pom

Why are the changes needed?

Our public API surfaces fabric8 types (e.g. PodTemplateSpec), so hiding the dependencies behind implementation may cause comile errors for customers who need to use those types along with our API library.

This enhances developer experience and avoid surprises when integrating our API with projects that already depends on fabric8.

Does this PR introduce any user-facing change?

Pom change only

How was this patch tested?

CIs

Was this patch authored or co-authored using generative AI tooling?

No

@jiangzho
Copy link
Contributor Author

jiangzho commented Sep 2, 2025

cc @peter-toth for review - thanks!

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on the real example of the cases? AFAIK, the official users of this repositories are supposed to use or provide YAML files only, @jiangzho . Maybe, did you want to say some downstream fork? Exposing something should be very careful.

Our public API surfaces fabric8 types (e.g. PodTemplateSpec), so hiding the dependencies behind implementation may cause comile errors for customers who need to use those types along with our API library.

@jiangzho
Copy link
Contributor Author

jiangzho commented Sep 3, 2025

In addition to direct YAML, user may also leverage our Java API library to create and manage Spark workloads. Its a common practice for user to use a microservice to orchestrate and record status at higher level. (example - they invented a set of POJO for Kubeflow operator previously as it's in Golang - but for Apache Spark Operator people may directly ask for Java API). While they build Spark spec in such microservices, they could be interacting with fabric8 models. It would become necessary for us to declare our dependencies in pom.

@dongjoon-hyun
Copy link
Member

We don't provide such a promise as a Contract yet, because it means that the exposed fabric8 dependency will be a breaking change at every upgrade. Could you provide safe alternatives, @jiangzho ?

In addition to direct YAML, user may also leverage our Java API library to create and manage Spark workloads. Its a common practice for user to use a microservice to orchestrate and record status at higher level. (example - they invented a set of POJO for Kubeflow operator previously as it's in Golang - but for Apache Spark Operator people may directly ask for Java API). While they build Spark spec in such microservices, they could be interacting with fabric8 models. It would become necessary for us to declare our dependencies in pom.

@jiangzho
Copy link
Contributor Author

jiangzho commented Sep 4, 2025

Could you provide safe alternatives ?

To avoid breaking changes in our current artifact - how about publishing one additional artifact, like spark-operator-api-fabric8 to serve the Java users / microservices ? We can declare dependencies in the pom for the new artifact

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Sep 15, 2025

For the record, I landed a new fabric8 dependency which is marked as a breaking change from their side.

### What changes were proposed in this pull request?

This PR exposes fabric8 dependencies as api in gradle build and hence in pom

### Why are the changes needed?

Our public API surfaces fabric8 types (e.g. PodTemplateSpec), so hiding the dependencies behind `implementation` may cause comile errors for customers who need to use those types along with our API library.

This enhances developer experience and avoid surprises when integrating our API with projects that already depends on fabric8.

### Does this PR introduce _any_ user-facing change?

Pom change only

### How was this patch tested?

CIs

### Was this patch authored or co-authored using generative AI tooling?

No
@jiangzho jiangzho force-pushed the api branch 3 times, most recently from 37d4097 to edf00fa Compare September 16, 2025 00:35
@dongjoon-hyun
Copy link
Member

For the record, I'm currently auditing the dependencies officially. This kind of activity should be done before exposing anything officially in the ASF community. Thank you for raising this kind of use-case issue, @jiangzho .

@dongjoon-hyun
Copy link
Member

BTW, please make the PR title and description up-to-date according to your changes (proposing a new java library module), @jiangzho .

spark-operator-api-fabric8

# Use Spark Operator API Library in Your Java Application

In addition to direct YAML, you may also leverage our Java API library to create and manage Spark
workloads.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention that Apache Spark community doesn't aim to provide a compatibility for this module in terms of Semantic Versioning. Every version can talk to the exactly same version's Spark Operator, @jiangzho .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants