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

[master forward-port] Fixed RPMs using artifacts compiled against a too-new version of glibc #11026

Merged
merged 5 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -1194,7 +1194,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -1335,7 +1335,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -1474,7 +1474,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -1613,12 +1613,12 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
type: kubernetes
name: build-linux-amd64-rpm
name: build-linux-amd64-centos7-rpm
trigger:
event:
include:
Expand All @@ -1634,7 +1634,7 @@ workspace:
clone:
disable: true
depends_on:
- build-linux-amd64
- build-linux-amd64-centos7
steps:
- name: Check out code
image: docker:git
Expand Down Expand Up @@ -1668,9 +1668,9 @@ steps:
- export VERSION=$(cat /go/.version.txt)
- if [[ "${DRONE_TAG}" != "" ]]; then export S3_PATH="tag/$${DRONE_TAG##v}/"; else
export S3_PATH="tag/"; fi
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-v$${VERSION}-linux-amd64-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
/go/artifacts/
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
/go/artifacts/
environment:
AWS_ACCESS_KEY_ID:
Expand All @@ -1683,7 +1683,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
Expand Down Expand Up @@ -1779,12 +1779,12 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
type: kubernetes
name: build-linux-amd64-fips-rpm
name: build-linux-amd64-centos7-fips-rpm
trigger:
event:
include:
Expand All @@ -1800,7 +1800,7 @@ workspace:
clone:
disable: true
depends_on:
- build-linux-amd64-fips
- build-linux-amd64-centos7-fips
steps:
- name: Check out code
image: docker:git
Expand Down Expand Up @@ -1834,7 +1834,7 @@ steps:
- export VERSION=$(cat /go/.version.txt)
- if [[ "${DRONE_TAG}" != "" ]]; then export S3_PATH="tag/$${DRONE_TAG##v}/"; else
export S3_PATH="tag/"; fi
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-fips-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-centos7-fips-bin.tar.gz
/go/artifacts/
environment:
AWS_ACCESS_KEY_ID:
Expand All @@ -1847,7 +1847,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
Expand Down Expand Up @@ -1942,7 +1942,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -2094,7 +2094,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -2243,7 +2243,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -2382,7 +2382,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -2452,7 +2452,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
Expand Down Expand Up @@ -2548,7 +2548,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -3226,7 +3226,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -3365,7 +3365,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -3504,7 +3504,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -3656,7 +3656,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -3808,7 +3808,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -3878,7 +3878,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
Expand Down Expand Up @@ -3974,7 +3974,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################

kind: pipeline
Expand Down Expand Up @@ -4044,7 +4044,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
Expand Down Expand Up @@ -4140,7 +4140,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################

kind: pipeline
Expand Down Expand Up @@ -5084,6 +5084,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
hmac: 8d0b79ebd4a3a0432402abf3b2773f45f8d787c0114d921dcdb5c909f2c338db
hmac: 3f643ea1aa5c364c56c9c61f71a199828e5e8013d9032239cd4d260510fd6fd0

...
11 changes: 8 additions & 3 deletions build.assets/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,19 @@ elif [[ "${ARCH}" == "arm64" ]]; then
TEXT_ARCH="ARMv8/ARM64"
fi

# amd64 RPMs should use CentOS 7 compatible artifacts
if [[ "${PACKAGE_TYPE}" == "rpm" && "${ARCH}" == "x86_64" ]]; then
OPTIONAL_TARBALL_SECTION+="-centos7"
fi

# set optional runtime section for filename
if [[ "${RUNTIME}" == "fips" ]]; then
OPTIONAL_RUNTIME_SECTION="-fips"
OPTIONAL_RUNTIME_SECTION+="-fips"
fi

# set variables appropriately depending on type of package being built
if [[ "${TELEPORT_TYPE}" == "ent" ]]; then
TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}"
TAR_PATH="teleport-ent"
RPM_NAME="teleport-ent"
Expand All @@ -210,7 +215,7 @@ if [[ "${TELEPORT_TYPE}" == "ent" ]]; then
TYPE_DESCRIPTION="[${TEXT_ARCH} Enterprise edition]"
fi
else
TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}"
TAR_PATH="teleport"
RPM_NAME="teleport"
Expand Down
25 changes: 23 additions & 2 deletions dronegen/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main

import (
"fmt"
"strings"
)

const (
Expand Down Expand Up @@ -175,7 +176,11 @@ func tagPipelines() []pipeline {

// RPM/DEB package builds
for _, packageType := range []string{rpmPackage, debPackage} {
ps = append(ps, tagPackagePipeline(packageType, buildType{os: "linux", arch: arch, fips: fips}))
bt := buildType{os: "linux", arch: arch, fips: fips}
if packageType == "rpm" && arch == "amd64" {
bt.centos7 = true
}
ps = append(ps, tagPackagePipeline(packageType, bt))
}
}
}
Expand Down Expand Up @@ -283,6 +288,11 @@ func tagDownloadArtifactCommands(b buildType) []string {
}
artifactOSS := true
artifactType := fmt.Sprintf("%s-%s", b.os, b.arch)

if b.centos7 {
artifactType += "-centos7"
}

if b.fips {
artifactType += "-fips"
artifactOSS = false
Expand Down Expand Up @@ -362,8 +372,19 @@ func tagPackagePipeline(packageType string, b buildType) pipeline {
}

dependentPipeline := fmt.Sprintf("build-%s-%s", b.os, b.arch)

if b.centos7 {
dependentPipeline += "-centos7"
}

apkPackages := []string{"bash", "curl", "gzip", "make", "tar"}
if packageType == rpmPackage {
// Required by `make rpm`
apkPackages = append(apkPackages, "go")
}

packageBuildCommands := []string{
`apk add --no-cache bash curl gzip make tar`,
fmt.Sprintf("apk add --no-cache %s", strings.Join(apkPackages, " ")),
`cd /go/src/github.com/gravitational/teleport`,
`export VERSION=$(cat /go/.version.txt)`,
}
Expand Down