Cloud-builders: bazel cloud builder does not tag the bazel version inside it

Created on 9 Feb 2018  路  6Comments  路  Source: GoogleCloudPlatform/cloud-builders

I was hoping I could do something like:

steps:
# Build the main Docker cmd image
- name: gcr.io/cloud-builders/bazel:0.7
  args: ['run', '//:docker']

But seems the cloud build images are not being tagged beside the latest tag.

cloud builder images on google cloud

screen shot 2018-02-08 at 3 06 54 pm

Am I missing something ?

All 6 comments

Tags are defined in the cloudbuild.yaml for the particular builder. For instance, the Docker builder defines tags for several versions as can be seen here (scroll to the bottom): https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/docker/cloudbuild.yaml
Also note that if you look in gcr.io/cloud-builders/docker, you'll also find an older tagged docker:1.12.6 -- which is no longer supported, but the old image lingers.

If you require a specific version of bazel, you can submit a PR adding it to https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/bazel/cloudbuild.yaml. (If you go this route, please include an explanation of your need for a specific version.)

So there is no id for Bazel, and is always assumed to be the latest. Seems to me that the issue is open.
This is not about a particular bazel id but more about the process of how the bazel cloudbuild images are tagged (or not tagged in this case).
bazel is quickly evolving and is not back compatible yet. You need __strict__ versioning. I don't have the time to figure out the PR and follow on, I just know that my cloudbuild setup with bazel is suddenly failing and I can't spin up the previous version or tag it, because there are no tags.

The latest version of bazel, 0.10.0, was released Feb 1, 8 days ago.

Looking at the image history, a version of the bazel builder was pushed before that, e.g., gcr.io/cloud-builders/bazel@sha256:43ef5417084ff06a8c7b55b773728b1eb172799253c96cb09a74f7ab5b3f3031

$ docker run -v /tmp:/workspace gcr.io/cloud-builders/bazel@sha256:43ef5417084ff06a8c7b55b773728b1eb172799253c96cb09a74f7ab5b3f3031 version
Build label: 0.9.0
Build target: bazel-out/k8-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Dec 19 09:31:58 2017 (1513675918)
Build timestamp: 1513675918
Build timestamp as int: 1513675918

So you can at least use that image in the meantime until either a.) you can update your build to be compatible with 0.10.0, or b.) bazel pushes a fix for your issue in some new latest release, or c.) we decide to version all bazel releases.

IMHO this should be reopened, this seems like a pretty useful FR!

The Bazel team recently began building container images for bazel, tagged with each release. You can see them at https://l.gcr.io/google/bazel

At this time, images are tagged for :0.15.2 and :0.16.1 (which is :latest)

You can use them like:

steps:
- name: l.gcr.io/google/bazel:0.15.2
  entrypoint: 'bazel'
  args: ['build', '//...']

(The need for entrypoint:bazel should not be needed for long, they're going to set the entrypoint to bazel themselves soon)

Images at https://l.gcr.io/google/bazel are now having entrypoint set to bazel

Was this page helpful?
0 / 5 - 0 ratings