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

Allow option to containerize Go Model Schema generation builds #2662

Closed
rohanKanojia opened this issue Dec 14, 2020 · 0 comments · Fixed by #2791 or jenkinsci/kubernetes-client-api-plugin#83
Assignees
Labels
component/kubernetes-model Deals with the kubernetes-model

Comments

@rohanKanojia
Copy link
Member

Right now we require user to have a golang setup in order to generate model. We should try to get rid of this requirement as not all Java Developers can have golang setup like this. Model schema generation can easily be containerized like this:

FROM golang:1.15.6
ADD .  /home/generator/
WORKDIR /home/generator/
RUN CGO_ENABLED=0 GO111MODULE=on GO15VENDOREXPERIMENT=1 go build -a ./cmd/generate/generate.go
ENTRYPOINT ["./generate"]

You can build image for this Dockerfile and then run it to generate schema like this:

generator : $ docker build -t model-generator . 
Sending build context to Docker daemon  13.39MB
Step 1/5 : FROM golang:1.15.6
 ---> 8e2ffcb73e11
Step 2/5 : ADD .  /home/generator/
 ---> Using cache
 ---> ec0c1de47fcc
Step 3/5 : WORKDIR /home/generator/
 ---> Using cache
 ---> 16edbd2aa17f
Step 4/5 : RUN CGO_ENABLED=0 GO111MODULE=on GO15VENDOREXPERIMENT=1 go build -a ./cmd/generate/generate.go
 ---> Using cache
 ---> 11eef9d1b219
Step 5/5 : ENTRYPOINT ["./generate"]
 ---> Using cache
 ---> 1c7898ab2840
Successfully built 1c7898ab2840
generator : $ docker run 1c7898ab2840
{
  "id": "http://fabric8.io/code-generator/Schema#",
  "$schema": "http://json-schema.org/schema#",
  "definitions": {
    "k8s_io_sample-controller_pkg_apis_samplecontroller_v1alpha1_Foo": {
      "type": "object",
      "description": "",
      "properties": {
@rohanKanojia rohanKanojia added the component/kubernetes-model Deals with the kubernetes-model label Dec 14, 2020
@rohanKanojia rohanKanojia self-assigned this Feb 5, 2021
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 5, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 5, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 5, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 5, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 5, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
manusa pushed a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 17, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 24, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
manusa pushed a commit to rohanKanojia/kubernetes-client that referenced this issue Mar 1, 2021
…ration builds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
manusa pushed a commit that referenced this issue Mar 1, 2021
…ilds

Added a bash script for doing Go Model generation Builds inside a docker
container. Go Build and schema generation are done inside a container
and copied to host folders afterwards
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment