Skip to content

Conversation

troychiu
Copy link
Contributor

@troychiu troychiu commented May 20, 2025

Why are these changes needed?

Having multiple go.mod files and using replace in each of them is hard to manage and not the best practice. We should either use a Go workspace or just keep one go.mod file. Since KubeRay is not a very big project, it makes more sense to have only one go.mod file. That’s why I chose to combine everything into a single go.mod.

This also fixes an issue that was opened some time ago.

Related issue number

Closes #3487

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
@troychiu troychiu changed the title single-go-mod Single go.mod file May 20, 2025
troychiu added 3 commits May 20, 2025 00:05
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
@troychiu troychiu marked this pull request as ready for review May 20, 2025 07:51
@rueian
Copy link
Contributor

rueian commented May 20, 2025

Well, I am sure that using one go.mod is not the best practice for not downloading unnecessary dependencies. For example, users who use apiserversdk as a library may not need to download grpc gateway at all. However, using one go.mod indeed simplifies many things.

Copy link
Member

@MortalHappiness MortalHappiness left a comment

Choose a reason for hiding this comment

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

LGTM. Only have 2 questions:

  • Did you run go mod tidy?
  • Are there version conflicts and how did you resolve them?

@troychiu
Copy link
Contributor Author

Well, I am sure that using one go.mod is not the best practice for not downloading unnecessary dependencies. For example, users who use apiserversdk as a library may not need to download grpc gateway at all. However, using one go.mod indeed simplifies many things.

Yeah you are right from this point of view. Let me update the PR description a bit to be more clear. What I meant not the best practice is "Having multiple go.mod files and using replace in each of them". If in the future, kuberay become a large size package. We can then switch back to multiple go.mod but with go workspace. But at this point, using one go.mod should be easiest.

@troychiu
Copy link
Contributor Author

troychiu commented May 20, 2025

LGTM. Only have 2 questions:

  • Did you run go mod tidy?
  • Are there version conflicts and how did you resolve them?
  1. Yes I ran go mod tidy
  2. I didn't run into any version conflicts. I guess it's because we have been quite active on upgrading packages.

@kevin85421 kevin85421 merged commit d0683a9 into ray-project:master May 21, 2025
24 checks passed
pawelpaszki pushed a commit to opendatahub-io/kuberay that referenced this pull request May 26, 2025
@andrewsykim
Copy link
Member

andrewsykim commented May 30, 2025

Having multiple go.mod files and using replace in each of them is hard to manage and not the best practice.

Not sure I would consider having multiple modules as not a best practice. I think it depends.

Just FYI that this change is potentially breaking Go compatibility for any external project that is importing github.com/ray-project/kuberay/ray-operator. Were we aware of this when making this change?

@andrewsykim
Copy link
Member

The benefit of the module in github.com/ray-project/kuberay/ray-operator was that it had a minimal amount of dependencies for importing CRD types and controller utils. With a single Go module, other repos now need to take in all dependencies of KubeRay even if they only need ones for ray-operator

@andrewsykim
Copy link
Member

Reviewing go modules in v1.3, I tend to agree we had way too many go modules, but I would suggest keeping the one in ray-operator because many users are importing the CRD types into their own projects and this change will now require those projects to inherit more dependencies

@kevin85421
Copy link
Member

The benefit of the module in github.com/ray-project/kuberay/ray-operator was that it had a minimal amount of dependencies for importing CRD types and controller utils.

We have taken this into consideration. You can take a look at: #3640 (comment).

We decided to unify go.mod because we were spending too much time resolving dependency issues.

pawelpaszki pushed a commit to opendatahub-io/kuberay that referenced this pull request Jun 10, 2025
chipspeak pushed a commit to chipspeak/kuberay that referenced this pull request Jul 2, 2025
kryanbeane pushed a commit to kryanbeane/kuberay that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Consolidate go module files
6 participants