-
Couldn't load subscription status.
- Fork 527
Add support for running Kubernetes builds via Google Cloud Build #900
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
Conversation
|
@justaugustus: Adding label: Reasons for blocking this PR:[Changes to certain release tools can affect our ability to test, build, and release Kubernetes. This PR must be explicitly approved by SIG Release repo admins.] Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
302651e to
59d32ce
Compare
4b5de9b to
d6e5cc6
Compare
|
/retest |
5ef8e05 to
ccf7743
Compare
ccf7743 to
393c166
Compare
|
/assign @tpepper @calebamiles |
| timeout: 7200s | ||
| steps: | ||
| - name: 'gcr.io/cloud-builders/git' | ||
| dir: 'go/src/k8s.io' |
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.
Shouldn't this be /workspace/go/src/k8s.io ?
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.
@listx -- either would work, I think.
dir is set relative to /workspace.
ref: https://cloud.google.com/cloud-build/docs/build-config
| && apt-get -y install git \ | ||
| # Setup Google Cloud SDK (latest) | ||
| && curl -sSL https://sdk.cloud.google.com > /tmp/install.sh \ | ||
| && bash /tmp/install.sh --install-dir=/opt/google --disable-prompts \ |
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.
A nit, but could this be gotten via apt-get also?
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.
@tpepper -- yep, it can. This Dockerfile is Frankenstein work from a few strewn across other repos (that are known to work). I'm going to squash the layers (as you can see some repetition of commands as well) in a follow-up PR.
| python-dev \ | ||
| python-setuptools \ | ||
| wget \ | ||
| && rm -rf /var/lib/apt/lists/* \ |
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.
My thinking on getting the Google Cloud SDK via apt was around being able to inventory the container contents, which is useful if nothing else for runtime debug, but likely other reasons too. Being able to docker run and dpkg -L or apt list --installed and see which gcc, which python-dev, which Google Cloud SDK are in a given binary instance of the container described by this Dockerfile is really important versus "it's whatever was available on the internet at build time".
|
/hold /lgtm |
- Update the k8s-cloud-builder Dockerfile
Here we instead base the image on the most recent version of
k8s.gcr.io/kube-cross (v1.12.12-1), which is an image that contains
all of the relevant dependencies to build Kubernetes. We also add
build steps for the GCP CLI tools (to be able to access GCP resources
within the image) and install docker (to build and push container
images to GCR).
- Add gcb/build.yaml
This is a new GCB config file which encapsulates the build steps of
the `kubernetes_build` scenario, which we use in CI to build
Kubernetes. Specifically, the following build steps are happening:
- git clone kubernetes/kubernetes
- git clone kubernetes/release
- (k/k) make clean
- (k/k) make release-in-a-container
- (k/r) push-build.sh
- Add gcb/variants.yaml
variants.yaml files store a set of build types, which contain a set of
GCB substitutions, which are interpreted by
k/test-infra/images/builder before submitting a build or set of builds
to GCB. This pattern is used in several places in k/test-infra to
define build variations (primarily for image building via GCB).
We adopt it here to circumvent creating an additional dependent of
gcbmgr/anago.
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
393c166 to
312ae43
Compare
|
@justaugustus: Adding label: Reasons for blocking this PR:[Changes to certain release tools can affect our ability to test, build, and release Kubernetes. This PR must be explicitly approved by SIG Release repo admins.] Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
This is ready to go. Squashed with an updated commit message and PR description. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, tpepper 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 |
This PR abstracts the steps of the
kubernetes_buildscenario in k/test-infra into GCB build steps and a set of build variants which can be triggered without having to dissect the job configs in test-infra.This is the k/release counterpart to the following PRs: kubernetes/test-infra#14747, kubernetes/test-infra#14773, kubernetes/test-infra#14788
As a note, I plan on cleaning up the Dockerfile in a future PR. I just want to minimize the changes in this PR, so I can start getting signal on these build runs.
Update the
k8s-cloud-builderDockerfileHere we instead base the image on the most recent version of
k8s.gcr.io/kube-cross(v1.12.12-1), which is an image that containsall of the relevant dependencies to build Kubernetes. We also add
build steps for the GCP CLI tools (to be able to access GCP resources
within the image) and install docker (to build and push container
images to GCR).
Add
gcb/build.yamlThis is a new GCB config file which encapsulates the build steps of
the
kubernetes_buildscenario, which we use in CI to buildKubernetes. Specifically, the following build steps are happening:
kubernetes/kuberneteskubernetes/releasemake cleanmake release-in-a-containerpush-build.shAdd
gcb/variants.yamlvariants.yamlfiles store a set of build types, which contain a set ofGCB substitutions, which are interpreted by
k/test-infra/images/builder before submitting a build or set of builds
to GCB. This pattern is used in several places in k/test-infra to
define build variations (primarily for image building via GCB).
We adopt it here to circumvent creating an additional dependent of
gcbmgr/anago.Signed-off-by: Stephen Augustus saugustus@vmware.com