kubeflow / training-operator

Distributed ML Training and Fine-Tuning on Kubernetes
https://www.kubeflow.org/docs/components/training
Apache License 2.0
1.62k stars 701 forks source link

Ensure code generation dependencies are downloaded #2339

Open astefanutti opened 11 hours ago

astefanutti commented 11 hours ago

What this PR does / why we need it:

This PR runs go mod download prior to running code generation to ensure the required dependencies are present.

Before:

$ sudo rm -rf `go list -m -mod=readonly -f "{{.Dir}}" k8s.io/code-generator`
$ make generate
GOBIN=/workdir/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5
/workdir/bin/controller-gen "crd:generateEmbeddedObjectMeta=true,maxDescLen=400" rbac:roleName=training-operator webhook paths="./pkg/apis/kubeflow.org/v1/..." \
    output:crd:artifacts:config=manifests/base/crds \
    output:rbac:artifacts:config=manifests/base/rbac \
    output:webhook:artifacts:config=manifests/base/webhook
/workdir/bin/controller-gen "crd:generateEmbeddedObjectMeta=true" rbac:roleName=training-operator-v2 webhook \
    paths="./pkg/apis/kubeflow.org/v2alpha1/...;./pkg/controller.v2/...;./pkg/runtime.v2/...;./pkg/webhook.v2/...;./pkg/cert/..." \
    output:crd:artifacts:config=manifests/v2/base/crds \
    output:rbac:artifacts:config=manifests/v2/base/rbac \
    output:webhook:artifacts:config=manifests/v2/base/webhook
/workdir/bin/controller-gen object:headerFile="hack/boilerplate/boilerplate.go.txt" paths="./pkg/apis/..."
hack/update-codegen.sh
hack/update-codegen.sh: line 19: /kube_codegen.sh: No such file or directory
make: *** [Makefile:52: generate] Error 1

After:

$ sudo rm -rf `go list -m -mod=readonly -f "{{.Dir}}" k8s.io/code-generator`
$ make generate
# OK

Checklist:

google-oss-prow[bot] commented 11 hours ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign jeffwan 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: - **[OWNERS](https://github.com/kubeflow/training-operator/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
coveralls commented 2 hours ago

Pull Request Test Coverage Report for Build 12089250799

Details


Totals Coverage Status
Change from base Build 12088918617: 0.0%
Covered Lines: 77
Relevant Lines: 77

💛 - Coveralls