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

Bazel CI Release Process should build and publish Bazel docker containers #1060

Closed
philwo opened this issue Nov 16, 2020 · 21 comments
Closed
Assignees
Labels

Comments

@philwo
Copy link
Member

philwo commented Nov 16, 2020

The current Bazel Docker containers are being built by the RBE toolchains team, but they asked us to take this on.

We should setup some tooling and a pipeline (?) to regularly automatically build current Bazel containers for all released versions.

@kevingessner
Copy link

@philwo Hello, any news here? This is still blocking us on smoothly upgrading Bazel past 3.5.

@philwo
Copy link
Member Author

philwo commented Jan 25, 2021

@kevingessner Not yet, sorry :( But this is really important to me and I'll get to it as soon as I can, promised!

@EdSchouten
Copy link

Any updates on this?

@chasain
Copy link

chasain commented Jun 1, 2021

I'm all for automating this, but for now can we get a manually built image pushed

@johanbrandhorst
Copy link

Friendly bump, blocking upgrade from 3.5.0

johanbrandhorst added a commit to johanbrandhorst/bazel-mono that referenced this issue Jul 2, 2021
Apparently there are no official bazel docker images
for v3.5.0+

Ref: bazelbuild/continuous-integration#1060
johanbrandhorst added a commit to johanbrandhorst/bazel-mono that referenced this issue Jul 2, 2021
* Update bazel and various rules and dependencies

* Drop to v3.5.0 again

Apparently there are no official bazel docker images
for v3.5.0+

Ref: bazelbuild/continuous-integration#1060

* Gazelle

* Sum

* Run go mod tidy after gazelle repos update
@EdSchouten
Copy link

This is still an issue.

@prawadhwani
Copy link

Meanwhile, updating the readme with instructions to build it manually would also help!

@lbhdc
Copy link

lbhdc commented Oct 16, 2021

I came across this issue while searching for a docker image that supported bazel 4. I didn't find any, so I made my own and thought I would share.

# Dockerfile
FROM registry.fedoraproject.org/fedora:34

RUN dnf install -y dnf-plugins-core git patch python3 && \
    dnf copr enable -y vbatts/bazel                   && \
    dnf install -y bazel4                             && \
    dnf clean all                                     && \
    rm -rf /var/cache/yum

RUN ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /home/builder

ENTRYPOINT ["bazel"]
$ docker build .
...
Successfully built <container-id>
$ docker run <container-id> --version
bazel 4.2.1

@QuantamHD
Copy link

QuantamHD commented Oct 26, 2021

@philwo This is actually more critical than ever. The base image used to build the latest container is using ubuntu 16.04 which as of April 30th is now EOL. This is a security issue now.

I've also experienced CA failures due to the wildly out of date base image.

@dayfine
Copy link

dayfine commented Oct 30, 2021

It has been almost a year. Seems a bit long for a P1? Should it be now bumped to P0 to help prioritization?

I came here after updating rules_python to 0.5.0. It mentions Bazel 4 is now the LTS version. I suppose P0 might make sense?

@ScarletFlash
Copy link

Any updates here?

QuantamHD added a commit to hdl/bazel_rules_hdl that referenced this issue Nov 16, 2021
This is kind of a hack to upgrade bazel to 4.2.1. When a new Bazel Docker container is released we should remove this commit, and upgrade the docker container instead.

See bazelbuild/continuous-integration#1060
@QuantamHD
Copy link

@ScarletFlash I'm not on or affiliated with the Bazel team, but I reached out to one of my contacts inside Google to help get this prioritized.

QuantamHD added a commit to hdl/bazel_rules_hdl that referenced this issue Nov 16, 2021
This is kind of a hack to upgrade bazel to 4.2.1. When a new Bazel Docker container is released we should remove this commit, and upgrade the docker container instead.

See bazelbuild/continuous-integration#1060
@philwo
Copy link
Member Author

philwo commented Nov 24, 2021

I talked with @alexeagle about this last week who wanted to help me out (thanks!!). Alex, do you already have a Dockerfile that I could try?

@f0rmiga
Copy link
Contributor

f0rmiga commented Dec 14, 2021

@philwo Alex asked if I could come up with a Dockerfile for this. How about #1290?

@davidvandebunte
Copy link

According to this thread the current bazel image is based on the GoogleCloudPlatform/container-definitions repository. Can someone double confirm that is the case? Perhaps this is related to @philwo's initial comment on this thread about the RBE toolchains team giving up control. I'm simply trying to find the code that was used to build the current image.

@iangudger
Copy link

Maybe this could be manually updated for Bazel 5.0?

hugelgupf added a commit to hugelgupf/gobusybox that referenced this issue Mar 28, 2022
This is necessary because the new rules_go and gazelle versions require
a version of bazel newer than what's in the GCR docker image pre-built
by the bazel team. Apparently, they stopped building those in 2020.

bazelbuild/continuous-integration#1060

Signed-off-by: Chris Koch <chrisko@google.com>
hugelgupf added a commit to hugelgupf/gobusybox that referenced this issue Mar 28, 2022
This is necessary because the new rules_go and gazelle versions require
a version of bazel newer than what's in the GCR docker image pre-built
by the bazel team. Apparently, they stopped building those in 2020.

bazelbuild/continuous-integration#1060

Signed-off-by: Chris Koch <chrisko@google.com>
hugelgupf added a commit to hugelgupf/gobusybox that referenced this issue Mar 28, 2022
This is necessary because the new rules_go and gazelle versions require
a version of bazel newer than what's in the GCR docker image pre-built
by the bazel team. Apparently, they stopped building those in 2020.

bazelbuild/continuous-integration#1060

Signed-off-by: Chris Koch <chrisko@google.com>
hugelgupf added a commit to u-root/gobusybox that referenced this issue Mar 28, 2022
This is necessary because the new rules_go and gazelle versions require
a version of bazel newer than what's in the GCR docker image pre-built
by the bazel team. Apparently, they stopped building those in 2020.

bazelbuild/continuous-integration#1060

Signed-off-by: Chris Koch <chrisko@google.com>
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

This is enabled by exposing the dvisvgm binary in the
defined latex texlive toolchan.

dvisvgm is dependent on ghostscript as a dynamic lib,
which is why it has been added.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

ghostscript is built from source using rules_foreign_cc,
which can't be entirely bootstrapped at this point.
(It can't build autoconf)

So it needs that to be installed from e.g. apt.
The bazel docker container did as far as I investigated
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it always
run with a specific version. But sense cirrus.yaml uses latest,
we don't state any version meaning it will always download the
latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

This is enabled by exposing the dvisvgm binary in the
defined latex texlive toolchan.

dvisvgm is dependent on ghostscript as a dynamic lib,
which is why it has been added.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

ghostscript is built from source using rules_foreign_cc,
which can't be entirely bootstrapped at this point.
(It can't build autoconf)

So it needs that to be installed from e.g. apt.
The bazel docker container did as far as I investigated
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it always
run with a specific version. But sense cirrus.yaml uses latest,
we don't state any version meaning it will always download the
latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

This is enabled by exposing the dvisvgm binary in the
defined latex texlive toolchan.

dvisvgm is dependent on ghostscript as a dynamic lib,
which is why it has been added.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

ghostscript is built from source using rules_foreign_cc,
which can't be entirely bootstrapped at this point.
(It can't build autoconf)

So it needs that to be installed from e.g. apt.
The bazel docker container did as far as I investigated
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it always
run with a specific version. But sense cirrus.yaml uses latest,
we don't state any version meaning it will always download the
latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

This is enabled by exposing the dvisvgm binary in the
defined latex texlive toolchan.

dvisvgm is dependent on ghostscript as a dynamic lib,
which is why it has been added.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

ghostscript is built from source using rules_foreign_cc,
which can't be entirely bootstrapped at this point.
(It can't build autoconf)

So it needs that to be installed from e.g. apt.
The bazel docker container did as far as I investigated
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it always
run with a specific version. But sense cirrus.yaml uses latest,
we don't state any version meaning it will always download the
latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

svg generation is enabled by exposing the dvisvgm binary
in the defined latex texlive toolchan.
dvisvgm in turn, is dependent on ghostscript as a dynamic
lib, which is why it has been added.
ghostscript is built from source with rules_foreign_cc.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
This resulted in @platforms, needed by rules_foreign_cc,
not being available.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

rules_foreign_cc can't be entirely bootstrapped at this point.
(It can't build autoconf)

So rules_foreign_cc needs autoconf to be installed from e.g. apt.
The bazel docker container, did as far as I investigated,
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it
to always run with a specific version.
But sense cirrus.yaml uses latest, we don't state any version
meaning it will always download the latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
solsjo added a commit to solsjo/bazel-latex that referenced this issue Sep 2, 2022
This can be a nice feature when a .tex file contains
a tikz figure.

svg generation is enabled by exposing the dvisvgm binary
in the defined latex texlive toolchan.
dvisvgm in turn, is dependent on ghostscript as a dynamic
lib, which is why it has been added.
ghostscript is built from source with rules_foreign_cc.

The previously referenced bazel docker image
in cirrus.yaml was not actively updated by google.
The last supported version was 3.5.
This resulted in @platforms, needed by rules_foreign_cc,
not being available.
So the docker image was changed to the newly
provided image. See:

bazelbuild/continuous-integration#1060
bazelbuild/continuous-integration#1401

rules_foreign_cc can't be entirely bootstrapped at this point.
(It can't build autoconf)

So rules_foreign_cc needs autoconf to be installed from e.g. apt.
The bazel docker container, did as far as I investigated,
not allow to install packages in the container,
I could be wrong though.

Instead I created a github workflow, which depends on bazelisk.
bazelisk is a downloader for bazel. You can configure it
to always run with a specific version.
But sense cirrus.yaml uses latest, we don't state any version
meaning it will always download the latest bazel.

It also enables a bazel cache which "should" speed up execution
in the ci pipeline.
@abhillman
Copy link

Potential workaround is to use the cockroach db bazel images https://hub.docker.com/r/cockroachdb/bazel/tags

@dlorenc
Copy link

dlorenc commented Dec 18, 2022

Hey - we have bazel images published by Chainguard here at cgr.dev/chainguard/bazel! Feel free to try them out.

@meteorcloudy
Copy link
Member

I'm closing this one since bazel docker images are already published to gcr.io/bazel-public/bazel for every new Bazel version

@yogurtearl
Copy link

I'm closing this one since bazel docker images are already published to gcr.io/bazel-public/bazel for every new Bazel version

@meteorcloudy could/should that info be added to the bazel docs? it is not very discoverable.

@meteorcloudy
Copy link
Member

@yogurtearl SGTM, sent bazelbuild/bazel#17113

We also have documentation in our release process: https://github.com/bazelbuild/continuous-integration/blob/master/docs/release-playbook.md#push-new-docker-image

copybara-service bot pushed a commit to bazelbuild/bazel that referenced this issue Feb 23, 2023
Fixes bazelbuild/continuous-integration#1060 (comment)

Closes #17113.

PiperOrigin-RevId: 511666892
Change-Id: Ifbfb8c9b2ba82724719101a0118f1235948f6bab
bushbecky added a commit to bushbecky/bazel_rules_hdl that referenced this issue May 9, 2023
This is kind of a hack to upgrade bazel to 4.2.1. When a new Bazel Docker container is released we should remove this commit, and upgrade the docker container instead.

See bazelbuild/continuous-integration#1060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.