From 37e4607c910f287f6267bcf241f62c8ed16991f7 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Tue, 5 Mar 2024 16:30:23 -0500 Subject: [PATCH 1/2] Temporarily revert builder to Java 17 (#2351) Debian 11 repo does not have Java 21. Revert to Java 17 for now so we can build the builder image, which is needed for release. --- release/builder/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/builder/build.sh b/release/builder/build.sh index 12ea4801ad..f031e70a9e 100755 --- a/release/builder/build.sh +++ b/release/builder/build.sh @@ -22,7 +22,7 @@ apt-get upgrade -y # Install GPG2 (in case it was not included) apt-get install gnupg2 -y # Install Java -apt-get install openjdk-21-jdk-headless -y +apt-get install openjdk-17-jdk-headless -y # Install Python apt-get install python3 -y # As of March 2021 python3 is at v3.6. Get pip then install dataclasses From 742481932e6ecd1c34ed362b7530bc0a2a4a354c Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Tue, 5 Mar 2024 18:17:13 -0500 Subject: [PATCH 2/2] Upgrade builder base image (#2352) This allows us to install Java 21 in the image. --- release/builder/Dockerfile | 2 +- release/builder/build.sh | 55 ++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/release/builder/Dockerfile b/release/builder/Dockerfile index b052f6c2b1..fbef2f4826 100644 --- a/release/builder/Dockerfile +++ b/release/builder/Dockerfile @@ -28,7 +28,7 @@ COPY go.sum ./ COPY go.mod ./ RUN go build -o /deployCloudSchedulerAndQueue -FROM marketplace.gcr.io/google/debian11 +FROM marketplace.gcr.io/google/ubuntu2204 ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8 # Add script for cloud scheduler and cloud tasks deployment COPY --from=deployCloudSchedulerAndQueueBuilder /deployCloudSchedulerAndQueue /usr/local/bin/deployCloudSchedulerAndQueue diff --git a/release/builder/build.sh b/release/builder/build.sh index f031e70a9e..af8f362a14 100755 --- a/release/builder/build.sh +++ b/release/builder/build.sh @@ -15,60 +15,75 @@ set -e apt-get update -y +apt-get upgrade -y + apt-get install locales -y locale-gen en_US.UTF-8 -apt-get install apt-utils gnupg -y -apt-get upgrade -y +apt-get install apt-utils gnupg curl lsb-release -y + +# Set up Google Cloud SDK repo +# Cribbed from https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu +apt-get install apt-transport-https ca-certificates -y +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg +echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list + +# Set up PostgreSQL repo. We need pg_dump v11 (same as current server version). +# This needs to be downloaded from postgresql's own repo, because ubuntu2204 +# only provides v14. +curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - +echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list + +apt-get update -y + # Install GPG2 (in case it was not included) apt-get install gnupg2 -y + # Install Java -apt-get install openjdk-17-jdk-headless -y +apt-get install openjdk-21-jdk-headless -y + # Install Python apt-get install python3 -y # As of March 2021 python3 is at v3.6. Get pip then install dataclasses # (introduced in 3.7) for nom_build apt-get install python3-pip -y python3 -m pip install dataclasses -# Install curl. -apt-get install curl -y + # Install Node apt-get install npm -y npm cache clean -f npm install -g n -# Retrying because fails are possible for node.js intallation. See - +# Retrying because fails are possible for node.js intallation. See # https://github.com/nodejs/build/issues/1993 for i in {1..5}; do n 20.10.0 && break || sleep 15; done -# Install gcloud -# Cribbed from https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu -apt-get install lsb-release -y -export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" -echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" \ - | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - -# Install pg_dump v11 (same as current server version). This needs to be -# downloaded from postgresql's own repo, because ubuntu1804 is too old. With a -# newer image 'apt-get install postgresql-client-11' may be sufficient. -curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \ - > /etc/apt/sources.list.d/pgdg.list' -apt-get update -y + +# Install gp_dump apt-get install postgresql-client-11 procps -y +# Install gcloud +apt-get install google-cloud-cli -y apt-get install google-cloud-sdk-app-engine-java -y + # Install git apt-get install git -y + # Install docker apt-get install docker.io -y + # Install Chrome apt-get install wget -y wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb apt install ./google-chrome-stable_current_amd64.deb -y + # Install libxss1 (needed by Karma) apt install libxss1 + # Use unzip to extract files from jars. apt-get install zip -y + # Get netstat, used for checking Cloud SQL proxy readiness. apt-get install net-tools + +# Clean up apt-get remove apt-utils locales -y apt-get autoclean -y apt-get autoremove -y