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

Unable to follow steps in developer_guide.md #2025

Closed
jdcfd opened this issue Mar 12, 2024 · 14 comments · Fixed by #2026 or #2043
Closed

Unable to follow steps in developer_guide.md #2025

jdcfd opened this issue Mar 12, 2024 · 14 comments · Fixed by #2026 or #2043

Comments

@jdcfd
Copy link
Contributor

jdcfd commented Mar 12, 2024

Hello, I am trying to follow the steps in https://github.com/kubeflow/training-operator/blob/master/docs/development/developer_guide.md . However, keep getting a segmentation fault.

I started a cluster using minikube. I am using Go 1.22. Ubuntu 22.04.

$ kubectl version # alias for "minikube kubectl -- version"
Client Version: v1.28.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.3

When I run make install, this is the message I get:

GOBIN=/home/juandiego/repos/kubeflow/training-operator/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0
/home/juandiego/go/src/github.com/kubeflow/training-operator/bin/controller-gen "crd:generateEmbeddedObjectMeta=true,maxDescLen=400" rbac:roleName=training-operator webhook paths="./pkg/..." output:crd:artifacts:config=manifests/base/crds output:rbac:artifacts:config=manifests/base/rbac
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa0e55e]

goroutine 72 [running]:
go/types.(*Checker).handleBailout(0xc0001a0400, 0xc001275d40)
	/usr/local/go/src/go/types/check.go:367 +0x88
panic({0xbc8860?, 0x12b5880?})
...
go/types.(*Checker).Files(...)
	/usr/local/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0003114a0, 0xc0003ae2e0)
	/home/juandiego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0003ae2e0)
	/home/juandiego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc00064e330, 0xc0003ae2e0)
	/home/juandiego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x0?)
	/home/juandiego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 1
	/home/juandiego/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:260 +0x1c5
make: *** [Makefile:40: manifests] Error 2

Could anyone please guide me on how to get over this? Thanks.

@jdcfd
Copy link
Contributor Author

jdcfd commented Mar 12, 2024

/help

@jdcfd
Copy link
Contributor Author

jdcfd commented Mar 12, 2024

/remove-help

@jdcfd
Copy link
Contributor Author

jdcfd commented Mar 12, 2024

could this be related to #1999 ?

@champon1020
Copy link
Contributor

According to the issue controller-tools (#888), it can be resolved by upgrading the version of controller-gen to v0.14.0. (I have already confirmed on my machine)

training-operator/Makefile

Lines 109 to 111 in 395e8ca

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0

@tenzen-y
Copy link
Member

According to the issue controller-tools (#888), it can be resolved by upgrading the version of controller-gen to v0.14.0. (I have already confirmed on my machine)

training-operator/Makefile

Lines 109 to 111 in 395e8ca

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0

@champon1020 Would you like to send a PR? If so, I'd be happy to review it :)

@champon1020
Copy link
Contributor

champon1020 commented Mar 12, 2024

@champon1020 Would you like to send a PR? If so, I'd be happy to review it :)

OK, I'll prepare! 👍

@tenzen-y
Copy link
Member

@champon1020 Would you like to send a PR? If so, I'd be happy to review it :)

OK, I'll prepare! 👍

Great to hear it!

@jdcfd
Copy link
Contributor Author

jdcfd commented Mar 17, 2024

awesome, thanks @champon1020 , this fixed my issue. I will leave the issue open so it is closed once the PR is approved.

@jdcfd
Copy link
Contributor Author

jdcfd commented Mar 17, 2024

Actually, I would like to follow up. I was able to do make install. When I tried make run I got a similar error as before. I upgraded crd-ref-docs to v0.0.11 and it got past the error I was getting. In any case, it seems the default version, crd-ref-docs@v0.0.8, would need to be updated as well in hack/generate-apidoc.sh. Since I am new to Go, maybe someone more experienced can verify.

CRD_REF_GEN_VERSION=v0.0.8
go install github.com/elastic/crd-ref-docs@${CRD_REF_GEN_VERSION}

@tenzen-y @champon1020

@tenzen-y
Copy link
Member

/reopen

It seems that another issue still happen.

Copy link

@tenzen-y: Reopened this issue.

In response to this:

/reopen

It seems that another issue still happen.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@google-oss-prow google-oss-prow bot reopened this Mar 20, 2024
@tenzen-y
Copy link
Member

Actually, I would like to follow up. I was able to do make install. When I tried make run I got a similar error as before. I upgraded crd-ref-docs to v0.0.11 and it got past the error I was getting. In any case, it seems the default version, crd-ref-docs@v0.0.8, would need to be updated as well in hack/generate-apidoc.sh. Since I am new to Go, maybe someone more experienced can verify.

CRD_REF_GEN_VERSION=v0.0.8
go install github.com/elastic/crd-ref-docs@${CRD_REF_GEN_VERSION}

@tenzen-y @champon1020

@jdcfd Thank you for reporting that! Can you create a PR?

@jdcfd
Copy link
Contributor Author

jdcfd commented Apr 3, 2024

Hi @tenzen-y , sure, I can do that. Do you think anything can break by upgrading to v0.0.11 for those using go 1.20 or 1.21? I wonder if upgrading to v0.0.11 would force users to have to bump up their version of Go.

@tenzen-y
Copy link
Member

tenzen-y commented Apr 3, 2024

Hi @tenzen-y , sure, I can do that. Do you think anything can break by upgrading to v0.0.11 for those using go 1.20 or 1.21? I wonder if upgrading to v0.0.11 would force users to have to bump up their version of Go.

I don't think so. It should work fine.

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