Skip to content

Commit 12e672f

Browse files
jnthntatumcopybara-github
authored andcommitted
Update presubmit docker image.
Use bazelisk to simplify testing bazel upgrades. PiperOrigin-RevId: 924816338
1 parent 83ce6bd commit 12e672f

2 files changed

Lines changed: 31 additions & 18 deletions

File tree

Dockerfile

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
#
1313
# Run the following command from the root of the CEL repository:
1414
#
15-
# gcloud builds submit --region=us -t gcr.io/cel-analysis/gcc9 .
15+
# gcloud builds submit --region=us -t gcr.io/cel-analysis/cel-cpp/ubuntu_floor .
1616
#
1717
# Once complete get the sha256 digest from the output using the following
1818
# command:
1919
#
20-
# gcloud artifacts versions list --package=gcc9 --repository=gcr.io \
20+
# gcloud artifacts versions list --package=cel-cpp/ubuntu_floor --repository=gcr.io \
2121
# --location=us
2222
#
2323
# The cloudbuild.yaml file must be updated to use the new digest like so:
2424
#
25-
# - name: 'gcr.io/cel-analysis/gcc9@<SHA256>'
26-
FROM gcc:9
25+
# - name: 'gcr.io/cel-analysis/cel-cpp/ubuntu_floor@<SHA256>'
26+
FROM gcr.io/cloud-marketplace/google/ubuntu2204:latest
2727

2828
# Install Bazel prerequesites and required tools.
2929
# See https://docs.bazel.build/versions/master/install-ubuntu.html
30-
RUN apt-get update && \
31-
apt-get upgrade -y && \
32-
apt-get install -y --no-install-recommends \
33-
ca-certificates \
30+
RUN apt-get update && apt-get upgrade -y && \
31+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
32+
bash \
33+
ca-certificates \
3434
git \
3535
libssl-dev \
3636
make \
@@ -41,16 +41,29 @@ RUN apt-get update && \
4141
zip \
4242
zlib1g-dev \
4343
default-jdk-headless \
44-
clang-11 && \
45-
apt-get clean
44+
clang-11 \
45+
gcc-9 g++-9 \
46+
tzdata \
47+
&& apt-get clean
4648

47-
# Install Bazel.
48-
# https://github.com/bazelbuild/bazel/releases
49-
ARG BAZEL_VERSION="7.3.2"
50-
ADD https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh /tmp/install_bazel.sh
51-
RUN /bin/bash /tmp/install_bazel.sh && rm /tmp/install_bazel.sh
49+
# Install Bazelisk.
50+
# https://github.com/bazelbuild/bazelisk/releases
51+
ARG BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb"
52+
ARG BAZELISK_CHKSUM="d8b00ea975c823e15263c80200ac42979e17368547fbff4ab177af035badfa83"
53+
ADD ${BAZELISK_URL} /tmp/bazelisk.deb
54+
55+
ENV BAZELISK_CHKSUM=${BAZELISK_CHKSUM}
56+
RUN echo "${BAZELISK_CHKSUM} */tmp/bazelisk.deb" | sha256sum --check
57+
58+
RUN apt-get install /tmp/bazelisk.deb
5259

5360
RUN mkdir -p /workspace
5461
RUN mkdir -p /bazel
5562

56-
ENTRYPOINT ["/usr/local/bin/bazel"]
63+
RUN USE_BAZEL_VERSION=8.7.0 bazelisk help
64+
RUN USE_BAZEL_VERSION=7.3.2 bazelisk help
65+
66+
ENV CC=gcc-9
67+
ENV CXX=g++-9
68+
69+
ENTRYPOINT ["/usr/bin/bazelisk"]

cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
steps:
2-
- name: 'gcr.io/cel-analysis/gcc9@sha256:4d5ff2e55224398807235a44b57e9c5793e922ac46e9ff428536bb8f8e5790ce'
2+
- name: 'gcr.io/cel-analysis/cel-cpp/ubuntu_floor@sha256:211a0c505b361d987b3d8b08a5144a84e62cb95edc3f897fe46d5cd3f556f79d'
33
args:
44
- '--output_base=/bazel' # This is mandatory to avoid steps accidently sharing data.
55
- 'test'
@@ -16,7 +16,7 @@ steps:
1616
- '--google_default_credentials'
1717
id: gcc-9
1818
waitFor: ['-']
19-
- name: 'gcr.io/cel-analysis/gcc9@sha256:4d5ff2e55224398807235a44b57e9c5793e922ac46e9ff428536bb8f8e5790ce'
19+
- name: 'gcr.io/cel-analysis/cel-cpp/ubuntu_floor@sha256:211a0c505b361d987b3d8b08a5144a84e62cb95edc3f897fe46d5cd3f556f79d'
2020
env:
2121
- 'CC=clang-11'
2222
- 'CXX=clang++-11'

0 commit comments

Comments
 (0)