kueue icon indicating copy to clipboard operation
kueue copied to clipboard

fix: Solving `make run` errors under Go vendor mode.

Open village-way opened this issue 1 year ago • 21 comments

What type of PR is this?

kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@alculquicondor

Does this PR introduce a user-facing change?


village-way avatar Mar 06 '24 06:03 village-way

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

k8s-ci-robot avatar Mar 06 '24 06:03 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: village-way Once this PR has been reviewed and has the lgtm label, please assign alculquicondor for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Mar 06 '24 06:03 k8s-ci-robot

Welcome @village-way!

It looks like this is your first PR to kubernetes-sigs/kueue 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kueue has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Mar 06 '24 06:03 k8s-ci-robot

Hi @village-way. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

k8s-ci-robot avatar Mar 06 '24 06:03 k8s-ci-robot

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
Latest commit 9761017fe729669430b13436d8ded6944901b5f3
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/65e815cf7a76550008ed0fb7

netlify[bot] avatar Mar 06 '24 06:03 netlify[bot]

/easycla

village-way avatar Mar 06 '24 08:03 village-way

Do you have a specific use-case for this?

Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

village-way avatar Mar 08 '24 01:03 village-way

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

tenzen-y avatar Mar 08 '24 10:03 tenzen-y

Can you make sure you are using go v1.21 or newer and that you enable go modules support in golang? https://www.jetbrains.com/help/go/create-a-project-with-go-modules-integration.html#using-go-modules-in-your-project

You should not run go mod vendor

alculquicondor avatar Mar 08 '24 15:03 alculquicondor

Can you make sure you are using go v1.21 or newer and that you enable go modules support in golang? https://www.jetbrains.com/help/go/create-a-project-with-go-modules-integration.html#using-go-modules-in-your-project

You should not run go mod vendor this is the go env

GO111MODULE='on'
GOARCH='amd64'
GOBIN='/Users/devine/go'
GOCACHE='/Users/devine/Library/Caches/go-build'
GOENV='/Users/devine/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/devine/go/pkg/mod'
GONOPROXY='gitlab.*.com'
GONOSUMDB='gitlab.*.com'
GOOS='darwin'
GOPATH='/Users/devine/go'
GOPRIVATE='gitlab.*.com'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/devine/GolandProjects/kueue/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/fm/sp8j2q9d5q55x1rdzlywfzs00000gp/T/go-build1822828399=/tmp/go-build -gno-record-gcc-switches -fno-common'

if not run go mod vendor everythings is ok, after run go mod vendor the make run this command, will occurs cannot find module providing package sigs.k8s.io/controller-tools/cmd/controller-gen: import lookup disabled by -mod=vendor (Go version in go.mod is at least 1.14 and vendor directory exists.) make: *** [controller-gen] Error 1 that's why i add the version for the controller-gen in the script dependencies. Only run go mod vendor, the goland can find the dependencies. The config of goland is image

village-way avatar Mar 09 '24 03:03 village-way

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found.

image

village-way avatar Mar 09 '24 04:03 village-way

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found.

image

That problem could be fixed by https://github.com/kubernetes-sigs/kueue/issues/1345.

tenzen-y avatar Mar 09 '24 10:03 tenzen-y

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. image

That problem could be fixed by #1345.

Thank you very much, according to #1345 , this problem can be fixed and we don't need run go mod vendor, so why not add this lines to go.mod file ? @tenzen-y

replace (
	k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
	k8s.io/kubectl => k8s.io/kubectl v0.28.3
	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
)

village-way avatar Mar 09 '24 11:03 village-way

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. image

That problem could be fixed by #1345.

Thank you very much, according to #1345 , this problem can be fixed and we don't need run go mod vendor, so why not add this lines to go.mod file ? @tenzen-y

replace (
	k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
	k8s.io/kubectl => k8s.io/kubectl v0.28.3
	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
)

I don't think so since after #1345 is fixed, we don't need such imports. We're working on fixing it in the autoscaler repository.

tenzen-y avatar Mar 09 '24 11:03 tenzen-y

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. image

That problem could be fixed by #1345.

Thank you very much, according to #1345 , this problem can be fixed and we don't need run go mod vendor, so why not add this lines to go.mod file ? @tenzen-y

replace (
	k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
	k8s.io/kubectl => k8s.io/kubectl v0.28.3
	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
)

I don't think so since after #1345 is fixed, we don't need such imports. We're working on fixing it in the autoscaler repository.

I saw the PR you mentioned at https://github.com/kubernetes/autoscaler/pull/6315. I'm not very familiar with the Go module dependencies, but I roughly understand that the issue arises because the clusterAutoscale is trying to reuse the code from Schedule without it being a separate Go module. However, I'm still quite confused about this area. Could you please help explain why this problem occurred? I'm looking forward to your reply. ♥

village-way avatar Mar 09 '24 12:03 village-way

@tenzen-y do you think we are close to merging the split of cluster-autoscaler packages? If it's taking too long, maybe it's worth introducing the replace for now?

alculquicondor avatar Mar 11 '24 12:03 alculquicondor

do you think we are close to merging the split of cluster-autoscaler packages? If it's taking too long, maybe it's worth introducing the replace for now?

All tasks have already been done. I'm waiting for approval from @x13n (for CA approval) and @mwielgus (for autoscaler repository approval). Both approvals are necessary.

tenzen-y avatar Mar 11 '24 12:03 tenzen-y

do you think we are close to merging the split of cluster-autoscaler packages? If it's taking too long, maybe it's worth introducing the replace for now?

All tasks have already been done. I'm waiting for approval from @x13n (for CA approval) and @mwielgus (for autoscaler repository approval). Both approvals are necessary.

Or only approval from @mwielgus should be fine since @x13n already approved that PR.

tenzen-y avatar Mar 11 '24 12:03 tenzen-y

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. image

That problem could be fixed by #1345.

Thank you very much, according to #1345 , this problem can be fixed and we don't need run go mod vendor, so why not add this lines to go.mod file ? @tenzen-y

replace (
	k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
	k8s.io/kubectl => k8s.io/kubectl v0.28.3
	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
)

I don't think so since after #1345 is fixed, we don't need such imports. We're working on fixing it in the autoscaler repository.

I saw the PR you mentioned at kubernetes/autoscaler#6315. I'm not very familiar with the Go module dependencies, but I roughly understand that the issue arises because the clusterAutoscale is trying to reuse the code from Schedule without it being a separate Go module. However, I'm still quite confused about this area. Could you please help explain why this problem occurred? I'm looking forward to your reply. ♥

k/k repository is not assumed to be used as a go module. This issue might be helpful for you to understand reasons: https://github.com/kubernetes/kubernetes/issues/79384

tenzen-y avatar Mar 11 '24 13:03 tenzen-y

Do you have a specific use-case for this? Depending on what you want to do, in my opinion , it's easier to just install and deploy

I just want to start the kueue main.go process and debug the code in the goland, so want to run that in make run with flags or in the goland Run/Debug configurations

I'm not sure why we should have the vendor if we use Goland.

Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. image

That problem could be fixed by #1345.

Thank you very much, according to #1345 , this problem can be fixed and we don't need run go mod vendor, so why not add this lines to go.mod file ? @tenzen-y

replace (
	k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
	k8s.io/kubectl => k8s.io/kubectl v0.28.3
	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
)

I don't think so since after #1345 is fixed, we don't need such imports. We're working on fixing it in the autoscaler repository.

I saw the PR you mentioned at kubernetes/autoscaler#6315. I'm not very familiar with the Go module dependencies, but I roughly understand that the issue arises because the clusterAutoscale is trying to reuse the code from Schedule without it being a separate Go module. However, I'm still quite confused about this area. Could you please help explain why this problem occurred? I'm looking forward to your reply. ♥

k/k repository is not assumed to be used as a go module. This issue might be helpful for you to understand reasons: kubernetes/kubernetes#79384

thanks, this pr can be closed as the related issue solved.

village-way avatar Mar 12 '24 02:03 village-way

In favor of #1872 /close

tenzen-y avatar Mar 25 '24 18:03 tenzen-y

@tenzen-y: Closed this PR.

In response to this:

In favor of #1872 /close

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.

k8s-ci-robot avatar Mar 25 '24 18:03 k8s-ci-robot