Skip to content

Conversation

@justaugustus
Copy link
Member

@justaugustus justaugustus commented Oct 17, 2019

This PR abstracts the steps of the kubernetes_build scenario 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-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

@k8s-ci-robot
Copy link
Contributor

@justaugustus: Adding label: do-not-merge/blocked-paths because PR changes a protected file.

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.

@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. do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. 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. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels Oct 17, 2019
@justaugustus justaugustus force-pushed the k8s-build branch 4 times, most recently from 302651e to 59d32ce Compare October 19, 2019 10:25
@justaugustus justaugustus force-pushed the k8s-build branch 2 times, most recently from 4b5de9b to d6e5cc6 Compare October 19, 2019 17:07
@justaugustus justaugustus changed the title [WIP] gcb: Update k8s-cloud-builder image to support Kubernetes builds [WIP] Add support for running Kubernetes builds via Google Cloud Build Oct 19, 2019
@justaugustus justaugustus added this to the v1.17 milestone Oct 19, 2019
@justaugustus
Copy link
Member Author

/retest

@justaugustus justaugustus force-pushed the k8s-build branch 4 times, most recently from 5ef8e05 to ccf7743 Compare October 21, 2019 19:00
@justaugustus justaugustus changed the title [WIP] Add support for running Kubernetes builds via Google Cloud Build Add support for running Kubernetes builds via Google Cloud Build Oct 21, 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 Oct 21, 2019
@justaugustus justaugustus removed the do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. label Oct 21, 2019
@justaugustus
Copy link
Member Author

/assign @tpepper @calebamiles
cc: @kubernetes/release-engineering

timeout: 7200s
steps:
- name: 'gcr.io/cloud-builders/git'
dir: 'go/src/k8s.io'
Copy link

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 ?

Copy link
Member Author

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 \
Copy link

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?

Copy link
Member Author

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/* \
Copy link

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".

@tpepper
Copy link

tpepper commented Oct 21, 2019

/hold
please squash and put a meaningful description on the commit but otherwise

/lgtm
to merge...ping after you squash for a re-lgtm since this will get cleared.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 21, 2019
- 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>
@k8s-ci-robot
Copy link
Contributor

@justaugustus: Adding label: do-not-merge/blocked-paths because PR changes a protected file.

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.

@k8s-ci-robot k8s-ci-robot added do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 21, 2019
@justaugustus justaugustus removed the do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. label Oct 21, 2019
@justaugustus
Copy link
Member Author

This is ready to go. Squashed with an updated commit message and PR description.
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2019
@tpepper
Copy link

tpepper commented Oct 22, 2019

/lgtm

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

[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:
  • OWNERS [justaugustus,tpepper]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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. area/release-eng Issues or PRs related to the Release Engineering subproject 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. sig/release Categorizes an issue or PR as relevant to SIG Release. 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.

5 participants