kuberay icon indicating copy to clipboard operation
kuberay copied to clipboard

[discussion] folder structure to support further sub-projects

Open Jeffwan opened this issue 3 years ago • 2 comments

Due to previous project naming, we put ray-operator in a separate folder. Currently, I notice some limitation to extend this project with more sub-projects and want to discuss with you.

Option 1. Each sub-project is an individual go module

pros: project is organized by modules and it's easy to all codes belong to a module cons: several individual go modules and can not share common codes.

kuberay
├── proto
├── backend
│   ├── ...
│   └── go.mod
├── cli
│   ├── ....
│   └── go.mod
└── ray-operator
    ├── api
    ├── bin
    ├── config
    ├── controllers
    ├── go.mod
    ├── go.sum
    └── main.go
module github.com/ray-project/kuberay/ray-operator
module github.com/ray-project/kuberay/backend
module github.com/ray-project/kuberay/plugin

Option 2. Use a single module for kuberay project

Let's assume we have different components, like plugins, ray operator, backends. Even we put all into same project, they are build separately and packaged in separate container images.

Pros: good for testing, sharing utils. Easily to reference apis (no need to replace or go get) Cons: not friendly for module users?

kuberay
    ├── api
       └── raycluster
             └── v1alpha1
                     ├── groupversion_info.go
                        ├── raycluster_types.go
                        ├── raycluster_types_test.go
                        └── zz_generated.deepcopy.go
       └── notebook
             └── v1alpha1
                     ├── groupversion_info.go
                        └──notebook_types.go
       └── image
             └── v1alpha1
                     ├── groupversion_info.go
                        └──image_types.go
    ├── cmd
    │   ├── ray
    │           ├── main.go
    │   ├── kubectl-plugin
    │           ├── main.go
    │   ├── notebook
    │           ├── main.go
    ├── pkg
    │   ├── service
    │           ├── backend.go
    ├── controllers
    │   ├── common
    │   ├── raycluster_controller.go
    │   ├── notebook_controller.go
    │   ├── notebook_controller.go
    │   └── utils
    ├── go.mod
    ├── go.sum
    ├── hack
    │   └── boilerplate.go.txt
    ├── main.go

/cc @akanso @chenk008 @chaomengyuan

Jeffwan avatar Oct 14 '21 20:10 Jeffwan

why does the first structure have 2 API folders?

akanso avatar Oct 16 '21 21:10 akanso

why does the first structure have 2 API folders?

I think that's misleading. I will delete them. In my personal repo, there's a folder to store protobuf files. I should rename it to proto

Jeffwan avatar Oct 17 '21 01:10 Jeffwan