Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Update openapi-gen to not rely on vendor #274

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

Jeffwan
Copy link
Member

@Jeffwan Jeffwan commented May 19, 2020

  1. Update gen-sdk.sh to use kube-openapi from go modules rather than vendor. Not all code-generator has /cmd/openapi-gen, 1.15 doesn't while it's added back in 1.16. Let's use kube-openapi here.
  2. central.maven.org is not resolvable on my end, seems it's http legacy url. Update the jar url and points to repo1.maven.org

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
Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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,

Copy link
Member

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

@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
Copy link
Member

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

@Jeffwan I do not remember hit the problem. If the problem can be resolved by adding the input , yeah, please go ahead.

@@ -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"
Copy link
Member

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!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will do.

@Jeffwan
Copy link
Member Author

Jeffwan commented Jun 24, 2020

@jinchihe Please have another check

@jinchihe
Copy link
Member

/lgtm

@Jeffwan Thanks!

@Jeffwan
Copy link
Member Author

Jeffwan commented Jun 28, 2020

/cc @johnugeorge @gaocegege

@johnugeorge
Copy link
Member

Sorry for being late
/approve

@k8s-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 9, 2020

/test kubeflow-pytorch-operator-presubmit

@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 9, 2020

Test failure is probably related with disk out of capacity failure.

@k8s-ci-robot k8s-ci-robot merged commit 61fefa8 into kubeflow:master Jul 9, 2020
@Jeffwan Jeffwan deleted the update_generator branch July 15, 2020 01:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants