From 18a33c9c091becb4a9c70a212121b88080e0ed85 Mon Sep 17 00:00:00 2001 From: John Lee Date: Thu, 13 Jul 2023 20:36:04 -0400 Subject: [PATCH] CICD: downgrade ubuntu to 20.04 and ensure ARM64 binaries are built static (#5555) Co-authored-by: algobarb <78746954+algobarb@users.noreply.github.com> --- .circleci/config.yml | 6 +++--- .github/workflows/pr-type-category.yml | 2 +- Dockerfile | 2 +- Makefile | 10 +--------- README.md | 2 +- docker/build/Dockerfile | 2 +- docker/build/Dockerfile-deploy | 2 +- docker/build/aptly.Dockerfile | 2 +- docker/build/cicd.ubuntu.Dockerfile | 2 +- docker/build/docker.ubuntu.Dockerfile | 2 +- docker/build/releases-page.Dockerfile | 2 +- scripts/release/README.md | 2 +- scripts/release/common/docker/setup.Dockerfile | 2 +- 13 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index be618098c1..1929215645 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,14 +5,14 @@ version: 2.1 orbs: - win: circleci/windows@2.3.0 + win: circleci/windows@5.0.0 go: circleci/go@1.7.3 - slack: circleci/slack@4.10.1 + slack: circleci/slack@4.12.5 parameters: ubuntu_image: type: string - default: "ubuntu-2004:202104-01" + default: "ubuntu-2004:2023.04.2" build_dir: type: string default: "/opt/cibuild" diff --git a/.github/workflows/pr-type-category.yml b/.github/workflows/pr-type-category.yml index 478b0b90e4..b496e862af 100644 --- a/.github/workflows/pr-type-category.yml +++ b/.github/workflows/pr-type-category.yml @@ -10,7 +10,7 @@ jobs: name: Check PR Category and Type steps: - name: Checking for correct number of required github pr labels - uses: mheap/github-action-required-labels@v2 + uses: mheap/github-action-required-labels@v5 with: mode: exactly count: 1 diff --git a/Dockerfile b/Dockerfile index c17d5a9e6d..0c6c370c97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 as builder +FROM ubuntu:20.04 as builder ARG GO_VERSION="1.20.5" diff --git a/Makefile b/Makefile index fdafc740f0..0c49744025 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,9 @@ export CPATH=/opt/homebrew/include export LIBRARY_PATH=/opt/homebrew/lib endif endif + ifeq ($(UNAME), Linux) EXTLDFLAGS := -static-libstdc++ -static-libgcc -ifeq ($(ARCH), amd64) # the following predicate is abit misleading; it tests if we're not in centos. ifeq (,$(wildcard /etc/centos-release)) EXTLDFLAGS += -static @@ -59,14 +59,6 @@ endif GOTAGSLIST += osusergo netgo static_build GOBUILDMODE := -buildmode pie endif -ifeq ($(ARCH), arm) -ifneq ("$(wildcard /etc/alpine-release)","") -EXTLDFLAGS += -static -GOTAGSLIST += osusergo netgo static_build -GOBUILDMODE := -buildmode pie -endif -endif -endif ifneq (, $(findstring MINGW,$(UNAME))) EXTLDFLAGS := -static -static-libstdc++ -static-libgcc diff --git a/README.md b/README.md index c8de385b2b..682d884367 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ the [official Go documentation website](https://golang.org/doc/). ### Linux / OSX -We currently strive to support Debian-based distributions with Ubuntu 22.04 +We currently strive to support Debian-based distributions with Ubuntu 20.04 being our official release target. Building on Arch Linux works as well. Our core engineering team uses Linux and OSX, so both environments are well diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index fec3fbdcc3..68591b2b4d 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:20.04 ARG GOLANG_VERSION RUN apt-get update && apt-get install -y git wget sqlite3 autoconf build-essential shellcheck diff --git a/docker/build/Dockerfile-deploy b/docker/build/Dockerfile-deploy index f4eb1709ec..fa927cbae5 100644 --- a/docker/build/Dockerfile-deploy +++ b/docker/build/Dockerfile-deploy @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 ubuntu:22.04 +FROM --platform=linux/amd64 ubuntu:20.04 ARG GOLANG_VERSION RUN apt-get update && apt-get install -y git wget sqlite3 autoconf jq bsdmainutils shellcheck diff --git a/docker/build/aptly.Dockerfile b/docker/build/aptly.Dockerfile index 38e86e92a3..1849d8e5e1 100644 --- a/docker/build/aptly.Dockerfile +++ b/docker/build/aptly.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:20.04 ARG ARCH=amd64 ARG GOLANG_VERSION diff --git a/docker/build/cicd.ubuntu.Dockerfile b/docker/build/cicd.ubuntu.Dockerfile index c6c42ea9bd..c8702743fb 100644 --- a/docker/build/cicd.ubuntu.Dockerfile +++ b/docker/build/cicd.ubuntu.Dockerfile @@ -1,6 +1,6 @@ ARG ARCH="amd64" -FROM ${ARCH}/ubuntu:22.04 +FROM ${ARCH}/ubuntu:20.04 ARG GOLANG_VERSION ARG ARCH="amd64" ARG GOARCH="amd64" diff --git a/docker/build/docker.ubuntu.Dockerfile b/docker/build/docker.ubuntu.Dockerfile index b94f885bf8..5091afefa9 100644 --- a/docker/build/docker.ubuntu.Dockerfile +++ b/docker/build/docker.ubuntu.Dockerfile @@ -1,6 +1,6 @@ ARG ARCH="amd64" -FROM ${ARCH}/ubuntu:22.04 +FROM ${ARCH}/ubuntu:20.04 ARG GOLANG_VERSION ARG ARCH="amd64" RUN apt-get update && apt-get install curl python python3.7 python3-pip build-essential apt-transport-https ca-certificates software-properties-common -y && \ diff --git a/docker/build/releases-page.Dockerfile b/docker/build/releases-page.Dockerfile index 7c3dceda09..c96f332d58 100644 --- a/docker/build/releases-page.Dockerfile +++ b/docker/build/releases-page.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install git python3 python3-pip -y && \ diff --git a/scripts/release/README.md b/scripts/release/README.md index 13d46283d7..f3fa543f13 100644 --- a/scripts/release/README.md +++ b/scripts/release/README.md @@ -52,7 +52,7 @@ This section briefly describes the expected outcomes of the current build pipeli 1. Build (compile) the binaries in a Centos 7 & 8 docker container that will then be used by both `deb` and `rpm` packaging. - 1. Docker containers will package `deb` and `rpm` artifacts inside of Ubuntu 22.04 and Centos 7 & 8, respectively. + 1. Docker containers will package `deb` and `rpm` artifacts inside of Ubuntu 20.04 and Centos 7 & 8, respectively. 1. Jenkins will then pause to wait for [the only manual part of the build/package/test phase], which is to forward the `gpg-agent` that establishes a direct between the local machine that contains the signing keys and the remote ec2 instance. diff --git a/scripts/release/common/docker/setup.Dockerfile b/scripts/release/common/docker/setup.Dockerfile index 514b9be46d..7d2988ca9a 100644 --- a/scripts/release/common/docker/setup.Dockerfile +++ b/scripts/release/common/docker/setup.Dockerfile @@ -9,7 +9,7 @@ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869194 # https://github.com/boto/s3transfer/pull/102 -FROM ubuntu:22.04 +FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y jq git python python-pip python3-boto3 ssh && \ pip install awscli