Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRD][2/n] Update from CRD v1alpha1 to v1 #1482

Merged
merged 8 commits into from
Oct 13, 2023

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Oct 11, 2023

Why are these changes needed?

This PR is the step 2 of #1209 (comment).

  • 76fe63f
    • Set v1 as the storage version
  • 6817793
    • Update update-codegen.sh from v1alpha1 to v1.
    • Run ./hack/update-codegen.sh to create lister / informer / client for v1.
    • Delete v1alpha1 related directories in pkg/client.
    • Create apis/ray/v1/register.go.
  • c48e91e
    • Replace all occurrences of github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1 in ray-operator/controllers/ray with github.com/ray-project/kuberay/ray-operator/apis/ray/v1.
  • fd6dd58
    • Update KubeRay API server.
  • 868f328
    • Replace all occurrences of rayv1alpha1 in ray-operator/controllers/ray with rayv1.
  • 07b659d
  • 7657d0e
    • The latest release v1.0.0-rc.0 does not support CRD v1, so the sample YAML tests fail consistently. This commit comments the tests out, and will uncomment them after v1.0.0-rc.1 is out.

Related issue number

#1209
#1481

Checks

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

@kevin85421 kevin85421 changed the title [WIP] Set v1 as the storage version [WIP] Oct 11, 2023
@@ -128,7 +128,7 @@ func startHttpProxy() {

// Create a top level mux to include both Http gRPC servers and other endpoints like metrics
topMux := http.NewServeMux()
// Seems /apis (matches /apis/v1alpha1/clusters) works fine
Copy link
Contributor

@z103cb z103cb Oct 12, 2023

Choose a reason for hiding this comment

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

This change is meaningless without changes in the .proto files. I think that apiserver API might not be 'v1' ready. Do you want to make the changes to the API server rest path now ? I think we can move the Kuberay API server paths independent of the underlying kuberay operator clients.

cc: @blublinsky

Copy link
Contributor

Choose a reason for hiding this comment

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

To move to v1 we need to modify .proto files, for example:

service ClusterService {
  // Creates a new Cluster.
  rpc CreateCluster(CreateClusterRequest) returns (Cluster) {
    option (google.api.http) = {
      post: "/apis/v1alpha2/namespaces/{namespace}/clusters"
      body: "cluster"
    };
  }

  // Finds a specific Cluster by ID.
  rpc GetCluster(GetClusterRequest) returns (Cluster) {
    option (google.api.http) = {
      get: "/apis/v1alpha2/namespaces/{namespace}/clusters/{name}"
    };
  }

  // Finds all Clusters in a given namespace. Supports pagination, and sorting on certain fields.
  rpc ListCluster(ListClustersRequest) returns (ListClustersResponse) {
    option (google.api.http) = {
      get: "/apis/v1alpha2/namespaces/{namespace}/clusters"
    };
  }

  // Finds all Clusters in all namespaces. Supports pagination, and sorting on certain fields.
  rpc ListAllClusters(ListAllClustersRequest) returns (ListAllClustersResponse) {
    option (google.api.http) = {
      get: "/apis/v1alpha2/clusters"
    };
  }

  // Deletes an cluster without deleting the cluster's runs and jobs. To
  // avoid unexpected behaviors, delete an cluster's runs and jobs before
  // deleting the cluster.
  rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {
      delete: "/apis/v1alpha2/namespaces/{namespace}/clusters/{name}"
    };
  }
}

and replace v1alpha2 with v1

We can do it now, but its a breaking change

Copy link
Member Author

Choose a reason for hiding this comment

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

I reverted the change 07b659d.

@z103cb
Copy link
Contributor

z103cb commented Oct 12, 2023

@kevin85421,
I think you might want to rebase main unto this PR. I have tried running make test in the apiserver directory and got this error

--- FAIL: TestBuildVolumes (0.00s)
    --- FAIL: TestBuildVolumes/configmap_test (0.00s)
        cluster_test.go:377: failed for configmap test ..., got [{configMap {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:my-config-map,},Items:[]KeyToPath{KeyToPath{Key:key2,Path:path2,Mode:nil,},KeyToPath{Key:key1,Path:path1,Mode:nil,},},DefaultMode:nil,Optional:nil,} nil nil nil nil nil nil nil nil nil nil}}], expected [{configMap {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:my-config-map,},Items:[]KeyToPath{KeyToPath{Key:key1,Path:path1,Mode:nil,},KeyToPath{Key:key2,Path:path2,Mode:nil,},},DefaultMode:nil,Optional:nil,} nil nil nil nil nil nil nil nil nil nil}}]
FAIL

There is was some test flakiness that @blublinsky has fixed in his latest merged PR.

@z103cb
Copy link
Contributor

z103cb commented Oct 12, 2023

I have ran a few of the examples from the README.md, so far this PR is LGTM. I will approve it once the review comments are disposed of and the PR is no long in WIP state.

@kevin85421 kevin85421 changed the title [WIP] [CRD][2/n] Update from CRD v1alpha1 to v1 Oct 12, 2023
@kevin85421
Copy link
Member Author

@z103cb There is was some test flakiness that @blublinsky has fixed in his latest merged PR.

My branch has the commit #1461.

Screen Shot 2023-10-12 at 12 52 02 PM

@kevin85421 kevin85421 marked this pull request as ready for review October 12, 2023 20:39
Copy link
Member

@hongchaodeng hongchaodeng left a comment

Choose a reason for hiding this comment

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

LGTM
Let's merge this after @blublinsky's approval.

Copy link
Contributor

@z103cb z103cb left a comment

Choose a reason for hiding this comment

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

LGTM

@z103cb
Copy link
Contributor

z103cb commented Oct 13, 2023

@z103cb There is was some test flakiness that @blublinsky has fixed in his latest merged PR.

My branch has the commit #1461.

Screen Shot 2023-10-12 at 12 52 02 PM

Ok. Will need to fix the flaky test then, in a separate PR (this should be merged).

Copy link
Contributor

@blublinsky blublinsky left a comment

Choose a reason for hiding this comment

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

LGTM

@kevin85421
Copy link
Member Author

Thanks, @hongchaodeng @z103cb @blublinsky!

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.

4 participants