-
Notifications
You must be signed in to change notification settings - Fork 143
Update openapi-gen to not rely on vendor #274
Conversation
echo "Generating OpenAPI specification ..." | ||
go run vendor/k8s.io/code-generator/cmd/openapi-gen/main.go --input-dirs github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1,github.com/kubeflow/common/job_controller/api/v1 --output-package github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --go-header-file hack/boilerplate/boilerplate.go.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jinchihe Do we need to addgithub.com/kubeflow/common/job_controller/api/v1
as input? I actually have some failure if I add common API github.com/kubeflow/common/job_controller/api/v1
like below. Have you ever seen the problem?
$ ./openapi-gen --input-dirs github.com/kubeflow/common/job_controller/api/v1,github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --output-package github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --go-header-file hack/boilerplate/boilerplate.go.txt
E0519 14:11:58.053066 14182 openapi.go:294] Error when generating: PodInformerSynced, PodInformerSynced k8s.io/client-go/tools/cache.InformerSynced
2020/05/19 14:11:58 OpenAPI code generation error: Failed executing generator: some packages had errors:
cannot generate spec for type k8s.io/client-go/tools/cache.InformerSynced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @jinchihe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed the PR since I was on vacation last month, will take a look asap. Thanks,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jinchihe Do we need to add
github.com/kubeflow/common/job_controller/api/v1
as input? I actually have some failure if I add common APIgithub.com/kubeflow/common/job_controller/api/v1
like below. Have you ever seen the problem?$ ./openapi-gen --input-dirs github.com/kubeflow/common/job_controller/api/v1,github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --output-package github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --go-header-file hack/boilerplate/boilerplate.go.txt E0519 14:11:58.053066 14182 openapi.go:294] Error when generating: PodInformerSynced, PodInformerSynced k8s.io/client-go/tools/cache.InformerSynced 2020/05/19 14:11:58 OpenAPI code generation error: Failed executing generator: some packages had errors: cannot generate spec for type k8s.io/client-go/tools/cache.InformerSynced
@Jeffwan I do not remember hit the problem. If the problem can be resolved by adding the input , yeah, please go ahead.
echo "Generating OpenAPI specification ..." | ||
go run vendor/k8s.io/code-generator/cmd/openapi-gen/main.go --input-dirs github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1,github.com/kubeflow/common/job_controller/api/v1 --output-package github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --go-header-file hack/boilerplate/boilerplate.go.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jinchihe Do we need to add
github.com/kubeflow/common/job_controller/api/v1
as input? I actually have some failure if I add common APIgithub.com/kubeflow/common/job_controller/api/v1
like below. Have you ever seen the problem?$ ./openapi-gen --input-dirs github.com/kubeflow/common/job_controller/api/v1,github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --output-package github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1 --go-header-file hack/boilerplate/boilerplate.go.txt E0519 14:11:58.053066 14182 openapi.go:294] Error when generating: PodInformerSynced, PodInformerSynced k8s.io/client-go/tools/cache.InformerSynced 2020/05/19 14:11:58 OpenAPI code generation error: Failed executing generator: some packages had errors: cannot generate spec for type k8s.io/client-go/tools/cache.InformerSynced
@Jeffwan I do not remember hit the problem. If the problem can be resolved by adding the input , yeah, please go ahead.
hack/python-sdk/gen-sdk.sh
Outdated
@@ -18,7 +18,7 @@ set -o errexit | |||
set -o nounset | |||
set -o pipefail | |||
|
|||
SWAGGER_JAR_URL="http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.6/swagger-codegen-cli-2.4.6.jar" | |||
SWAGGER_JAR_URL="https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.6/swagger-codegen-cli-2.4.6.jar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to rebase to remove this change. I did not realized the PR, and already fixed this last week. Thanks a lot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I will do.
d07db48
to
6b71277
Compare
@jinchihe Please have another check |
/lgtm @Jeffwan Thanks! |
Sorry for being late |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johnugeorge The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test kubeflow-pytorch-operator-presubmit |
Test failure is probably related with disk out of capacity failure. |
gen-sdk.sh
to use kube-openapi from go modules rather than vendor. Not allcode-generator
has/cmd/openapi-gen
, 1.15 doesn't while it's added back in 1.16. Let's use kube-openapi here.central.maven.org
is not resolvable on my end, seems it's http legacy url. Update the jar url and points torepo1.maven.org