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

Quit all processes when "apiserver-boot run local" failed #410

Merged
merged 4 commits into from
Aug 30, 2019

Conversation

wallrj
Copy link
Contributor

@wallrj wallrj commented Aug 30, 2019

Address outstanding code-review feedback from #255

@k8s-ci-robot
Copy link
Contributor

Welcome @wallrj!

It looks like this is your first PR to kubernetes-sigs/apiserver-builder-alpha 🎉. 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/apiserver-builder-alpha 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. 😃

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 30, 2019
@wallrj wallrj force-pushed the 253-quit-all-processes branch from 2b47bb9 to 0848b1d Compare August 30, 2019 11:03
@wallrj
Copy link
Contributor Author

wallrj commented Aug 30, 2019

Here's an example of the output when the APIserver crashes, and cleans up the Etcd server too

/home/richard/go/bin/apiserver-boot run local --build=false --generate=false --run apiserver,etcd --print-apiserver
...

panic: unable to get openapi models: expected pointer, but got invalid kind

goroutine 1 [running]:
main.main()
	/home/richard/go/src/gitlab.jetstack.net/portal/portal-api/cmd/apiserver/main.go:35 +0x1a1
2019/08/30 12:08:33 Failed to run bin/apiserver, error: exit status 2
2019/08/30 12:08:33 Failed to run etcd, error: signal: killed
to test the server run `kubectl --kubeconfig kubeconfig api-versions`


Copied from https://github.com/kubernetes/apiserver/tree/729b73dd4aed4c03c6757f1c453a317578a8e1f0/pkg/server

TODO: Remove this copied package and import from k8s.io/apiserver/pkg/server
Copy link
Member

Choose a reason for hiding this comment

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

can you expand why copy the package from k8s.io/apiserver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally attempted to import it, but the dependencies of k8s.io/apiserver clash with the dependencies in this project.
See https://travis-ci.org/kubernetes-sigs/apiserver-builder-alpha/builds/578741517

/build-tools.sh

# sigs.k8s.io/apiserver-builder-alpha/cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:181:55: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:182:20: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:229:52: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:230:11: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:237:11: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:245:11: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:252:12: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:263:12: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:265:40: undefined: schema.UnionField

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:272:12: undefined: schema.Union

../../cmd/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go:272:12: too many errors

Copy link
Member

Choose a reason for hiding this comment

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

yea, but i updated the vendor by #411.. but it's supposed to be working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yue9944882 Thanks, but sadly it still doesn't compile. I now get:

richard   717a61c  …  src  sigs.k8s.io  apiserver-builder-alpha  130  make install
rm -rf *.deb *.rpm *.tar.gz ./release
go run ./cmd/apiserver-builder-release/main.go vendor --version v1.15.alpha.0 --commit 717a61c5e9922a63741934090526756d87db6186
cp -R -H vendor /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/src
cp -R -H pkg /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/src/vendor/sigs.k8s.io/apiserver-builder-alpha/pkg
bash -c find /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/src/vendor/sigs.k8s.io/apiserver-builder-alpha/pkg -name BUILD.bazel| xargs sed -i='' s'|//pkg|//vendor/sigs.k8s.io/apiserver-builder-alpha/pkg|g'
cp -R -H Gopkg.toml /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/src/Gopkg.toml
cp -R -H Gopkg.lock /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/src/Gopkg.lock
go run ./cmd/apiserver-builder-release/main.go build --version v1.15.alpha.0
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/gen-apidocs cmd/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/client-gen cmd/vendor/k8s.io/code-generator/cmd/client-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/conversion-gen cmd/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/deepcopy-gen cmd/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/defaulter-gen cmd/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/informer-gen cmd/vendor/k8s.io/code-generator/cmd/informer-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/lister-gen cmd/vendor/k8s.io/code-generator/cmd/lister-gen/main.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/openapi-gen cmd/vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go
go build -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/apiregister-gen cmd/apiregister-gen/main.go
go build -ldflags -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.apiserverBuilderVersion=v1.15.alpha.0 -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.kubernetesVendorVersion=1.15.3 -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.goos=linux -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.goarch=amd64 -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.gitCommit=717a61c5e9922a63741934090526756d87db6186
 -X sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.buildDate=2019-08-30-12:44:30 -o /home/richard/go/src/sigs.k8s.io/apiserver-builder-alpha/release/v1.15.alpha.0/bin/apiserver-boot cmd/apiserver-boot/main.go
# sigs.k8s.io/apiserver-builder-alpha/cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/gvkparser.go:41:3: cannot use nil as type typed.ParseableType in return argument
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:45:14: cannot use make(map[string]*fieldpath.VersionedSet) (type map[string]*fieldpath.VersionedSet) as type fieldpath.ManagedFields in return argument
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:78:16: cannot use make(map[string]*fieldpath.VersionedSet, len(encodedManagedFields)) (type map[string]*fieldpath.VersionedSet) as type fieldpath.ManagedFields in assignment
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:84:31: cannot assign *fieldpath.VersionedSet to managedFields[manager] (type fieldpath.VersionedSet) in multiple assignment:
	*fieldpath.VersionedSet is pointer to interface, not interface
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:116:17: invalid pointer type *fieldpath.VersionedSet for composite literal
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:117:14: versionedSet.APIVersion undefined (type *fieldpath.VersionedSet is pointer to interface, not interface)
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:119:15: versionedSet.Applied undefined (type *fieldpath.VersionedSet is pointer to interface, not interface)
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:130:14: versionedSet.Set undefined (type *fieldpath.VersionedSet is pointer to interface, not interface)
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:147:38: cannot use versionedSet (type fieldpath.VersionedSet) as type *fieldpath.VersionedSet in argument to encodeManagerVersionedSet:
	*fieldpath.VersionedSet is pointer to interface, not interface
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/versionconverter.go:35:5: cannot use &versionConverter literal (type *versionConverter) as type merge.Converter in assignment:
	*versionConverter does not implement merge.Converter (wrong type for Convert method)
		have Convert(typed.TypedValue, fieldpath.APIVersion) (typed.TypedValue, error)
		want Convert(*typed.TypedValue, fieldpath.APIVersion) (*typed.TypedValue, error)
cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go:147:38: too many errors
2019/08/30 12:44:32 exit status 2
exit status 1
make: *** [Makefile:62: build] Error 1

Copy link
Member

@yue9944882 yue9944882 Aug 30, 2019

Choose a reason for hiding this comment

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

go run ./cmd/apiserver-builder-release/main.go vendor --version v1.15.alpha.0 --commit 717a61c5e9922a63741934090526756d87db6186

what's commit 717a61c5e? it doesn't exist in the repo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a local commit, where I'm in the process of rebasing on top of master.
I'll force push it so that you can see the build results.

Copy link
Member

Choose a reason for hiding this comment

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

thanks, i re-pro'd locally, now the build is passing

@wallrj wallrj force-pushed the 253-quit-all-processes branch from 0848b1d to ba456bc Compare August 30, 2019 11:28
@wallrj wallrj changed the title WIP: Quit all processes when "apiserver-boot run local" failed Quit all processes when "apiserver-boot run local" failed Aug 30, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 30, 2019
@wallrj wallrj force-pushed the 253-quit-all-processes branch from ba456bc to 8027233 Compare August 30, 2019 12:02
@yue9944882
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj, yue9944882

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 30, 2019
@k8s-ci-robot k8s-ci-robot merged commit d6354c9 into kubernetes-sigs:master Aug 30, 2019
@wallrj wallrj deleted the 253-quit-all-processes branch August 30, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants