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

code-generator: create stable and more extensible cli interface for top-level scripts – "kube-gen" #53524

Closed
sttts opened this issue Oct 6, 2017 · 13 comments
Assignees
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@sttts
Copy link
Contributor

sttts commented Oct 6, 2017

The scripts https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator/generate-groups.sh and https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator/generate-internal-groups.sh were created to provide a standardized way of calling the generators for 90% of the CRD and UAS usa-cases. The command-line interface is simplistic, driven by the bash implementation rather than stability and extensibility in mind:

$ generate-groups.sh <generators> <output-package> <internal-apis-package> <extensiona-apis-package> <groups-versions> ...

I.e. the options are positional without flags syntax. Adding another option is impossible. Because #53449 should go into 1.8 as early as possible to give CRD users a tool to create especially deepcopy funcs easily, a proper Go implementation was out of reach because it is needs more changes, e.g. in Gengo (now merged). But mid-term we probably want to convert this to Go.

It was also suggested to turn k8s.io/code-generator into a Docker container to make it even easier to 3rdparties to generate code for Kubernetes style api types:

$ docker run -v $GOPATH:/go k8s.io/code-generator:1.8 generate-group github.com/foo/bar example:v1

Another line of thought is the question how and whether to use this also in Kubernetes itself instead of our pretty complex Makefile.generated_files mechanism.

@sttts sttts added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 6, 2017
@sttts sttts added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Oct 6, 2017
@mml
Copy link
Contributor

mml commented Oct 12, 2017

cc @pwittrock

I'm also curious about how we might implement this. Are we planning to make it a bazel target so that it can execute incrementally?

@pwittrock
Copy link
Member

@mml just saw the comment. I had a similar idea to what you suggest, and think that would be really cool to build, as well as providing some lower level tools the bazel rules could leverage.

@pwittrock
Copy link
Member

/assign @apelisse

@pwittrock
Copy link
Member

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Oct 30, 2017
@pwittrock
Copy link
Member

@sttts where should this go?

kubernetes/code-generator#17

@sttts
Copy link
Contributor Author

sttts commented Nov 1, 2017

where should this go?

Usually into the community repo or even just as google doc. I would not commit it into k/code-generator.

@pwittrock
Copy link
Member

@ssts move to kubernetes/community#1315

@mml
Copy link
Contributor

mml commented Nov 1, 2017 via email

@sttts
Copy link
Contributor Author

sttts commented Jan 22, 2018

@pwittrock is this work stalled?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 22, 2018
@sttts
Copy link
Contributor Author

sttts commented Apr 24, 2018

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 24, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 23, 2018
@sttts
Copy link
Contributor Author

sttts commented Jul 27, 2018

This turned into kubebuilder.

@sttts sttts closed this as completed Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

7 participants