kuberay icon indicating copy to clipboard operation
kuberay copied to clipboard

[Feature] Support go1.18+

Open kevin85421 opened this issue 2 years ago • 2 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Description

Currently, KubeRay only supports go1.16 and go1.17. When I try to build KubeRay with go1.19, it cannot download the binary of controller-gen successfully.

> make build

go: creating new go.mod: module tmp
Downloading sigs.k8s.io/controller-tools/cmd/[email protected]
.
.
....../kuberay/ray-operator/bin/controller-gen: No such file or directory
make: *** [generate] Error 127

The root cause is that go get is deprecated (Link) starting in go1.17, go install may be used instead. An workaround solution is to update go get to go install in the Makefile. However, the Makefile seems to be generated by operator-sdk, and thus I am not sure whether updating it manually is a good idea or not.

define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
rm -rf $$TMP_DIR ;\
}

This issue is used to track the progress of https://github.com/ray-project/kuberay/pull/241.

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

kevin85421 avatar Sep 01 '22 00:09 kevin85421

cc @DmitriGekhtman

kevin85421 avatar Sep 01 '22 00:09 kevin85421

Thanks for helping us track this, @kevin85421 ! cc @Jeffwan @akanso as well

DmitriGekhtman avatar Sep 01 '22 00:09 DmitriGekhtman

I'm finding this pretty annoying -- I have to maintain multiple go installations to develop KubeRay.

DmitriGekhtman avatar Dec 09 '22 21:12 DmitriGekhtman

I recently started a new operator via the sdk -- it generated a makefile with the following:

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
	test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

I think we should be able to make updates as needed.

anishasthana avatar May 26 '23 14:05 anishasthana

Follow up after #1283:

  1. Update the CI to use a newer Go version for building the KubeRay operator.
  2. Update the Go version specified in DEVELOPMENT.md.

kevin85421 avatar Aug 01 '23 23:08 kevin85421

Closed by #1325

kevin85421 avatar Aug 18 '23 22:08 kevin85421