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

ATC build system: aarch64 support #7176

Merged
merged 3 commits into from
Nov 8, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7032](https://github.com/apache/trafficcontrol/issues/7032) *Cache Config* Add t3c-apply flag to use local ATS version for config generation rather than Server package Parameter, to allow managing the ATS OS package via external tools. See 'man t3c-apply' and 'man t3c-generate' for details.
- [#7097](https://github.com/apache/trafficcontrol/issues/7097) *Traffic Ops, Traffic Portal, t3c* Added the `regional` field to Delivery Services, which affects whether `maxOriginConnections` should be per Cache Group
- [#2388](https://github.com/apache/trafficcontrol/issues/2388) *Trafic Ops, Traffic Portal* Added the `TTLOverride` field to CDNs, which lets you override all TTLs in all Delivery Services of a CDN's snapshot with a single value
- [#7176](https://github.com/apache/trafficcontrol/pull/7176) *ATC Build system* Support building ATC for the `aarch64` CPU architecture

### Changed
- [#2564](https://github.com/apache/trafficcontrol/issues/2564) Renamed RASCAL references to TRAFFIC_MONITOR
Expand Down
6 changes: 4 additions & 2 deletions build/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ buildRpm() {
for package in "$@"; do
local pre="${package}-${TC_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}"
local rpm
rpm="${pre}.$(uname -m).rpm"
local arch
arch="$(rpm --eval %_arch)"
rpm="${pre}.${arch}.rpm"
local srpm="${pre}.src.rpm"
echo "Building the rpm."
{ set +o nounset
Expand Down Expand Up @@ -266,7 +268,7 @@ buildRpm() {
srcRPMDest="${package}.src.rpm";
fi

cp -f "$RPMBUILD/RPMS/$(uname -m)/$rpm" "$DIST/$rpmDest";
cp -f "$RPMBUILD/RPMS/${arch}/$rpm" "$DIST/$rpmDest";
code="$?";
if [[ "$code" -ne 0 ]]; then
echo "Could not copy $rpm to $DIST: $code" >&2;
Expand Down
6 changes: 4 additions & 2 deletions cache-config/testing/docker/trafficserver/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ wq
ED
) || die "Failed to patch in astats_over_http"

arch="$(rpm --eval %_arch)"

# build a trafficserver RPM
rm -f /root/rpmbuild/RPMS/x86_64/trafficserver-*.rpm
rm -f /root/rpmbuild/RPMS/${arch}/trafficserver-*.rpm
cd trafficserver

if [[ ${RUN_ATS_UNIT_TESTS} == true ]]; then
Expand All @@ -127,7 +129,7 @@ if [[ ! -d /trafficcontrol/dist ]]; then
mkdir /trafficcontrol/dist
fi

cp /root/rpmbuild/RPMS/x86_64/trafficserver*.rpm /trafficcontrol/dist ||
cp /root/rpmbuild/RPMS/${arch}/trafficserver*.rpm /trafficcontrol/dist ||
die "Failed to copy the ATS RPM to the dist directory"

echo "trafficserver RPM has been copied"
4 changes: 2 additions & 2 deletions grove/build/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ checkGroveEnvironment() {
BUILD_NUMBER=${BUILD_NUMBER:-$(getBuildNumber)}
RPMBUILD="${GROVE_DIR}/rpmbuild"
DIST="${TC_DIR}/dist"
RPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.x86_64.rpm"
RPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.$(rpm --eval %_arch).rpm"
SRPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.src.rpm"
GOOS="${GOOS:-linux}"
RPM_TARGET_OS="${RPM_TARGET_OS:-$GOOS}"
Expand Down Expand Up @@ -126,7 +126,7 @@ buildRpmGrove() {
# copy build RPM to .
[ -d "$DIST" ] || mkdir -p "$DIST";

cp -f "$RPMBUILD/RPMS/$(uname -m)/${RPM}" "$DIST/$rpmDest";
cp -f "$RPMBUILD/RPMS/$(rpm --eval %_arch)/${RPM}" "$DIST/$rpmDest";
code="$?";
if [[ "$code" -ne 0 ]]; then
echo "Could not copy $rpm to $DIST: $code" >&2;
Expand Down
4 changes: 2 additions & 2 deletions grove/grovetccfg/build/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ checkGroveEnvironment() {
BUILD_NUMBER=${BUILD_NUMBER:-$(getBuildNumber)}
RPMBUILD="${GROVE_DIR}/rpmbuild"
DIST="${TC_DIR}/dist"
RPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.x86_64.rpm"
RPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.$(rpm --eval %_arch).rpm"
SRPM="${PACKAGE}-${GROVE_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.src.rpm"
GOOS="${GOOS:-linux}"
RPM_TARGET_OS="${RPM_TARGET_OS:-$GOOS}"
Expand Down Expand Up @@ -128,7 +128,7 @@ buildRpmGrove() {
# copy build RPM to .
[ -d "$DIST" ] || mkdir -p "$DIST";

cp -f "$RPMBUILD/RPMS/$(uname -m)/${RPM}" "$DIST/$rpmDest";
cp -f "$RPMBUILD/RPMS/$(rpm --eval %_arch)/${RPM}" "$DIST/$rpmDest";
code="$?";
if [[ "$code" -ne 0 ]]; then
echo "Could not copy $rpm to $DIST: $code" >&2;
Expand Down
8 changes: 5 additions & 3 deletions infrastructure/cdn-in-a-box/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ PKG_COMMAND := $(TC_DIR)/pkg
PKG_FLAGS := -v -$(RHEL_VERSION)
BUILD_SUFFIX := _build
BUILD_NUMBER := $(shell git rev-list HEAD 2>/dev/null | wc -l | tr -d '[[:space:]]').$(shell git rev-parse --short=8 HEAD)
BUILD_ARCH := $(shell rpm --eval %_arch)
TC_VERSION := $(shell cat "$(TC_DIR)/VERSION")
TOMCAT_VERSION := $(shell grep '^\s*TOMCAT_VERSION=' "$(TC_DIR)/traffic_router/build/build_rpm.sh" | cut -d= -f2)
TOMCAT_RELEASE := $(shell grep '^\s*TOMCAT_RELEASE=' "$(TC_DIR)/traffic_router/build/build_rpm.sh" | cut -d= -f2)
Expand All @@ -44,9 +45,10 @@ ifeq ($(RHEL_VERSION),7)
ATS_VERSION := $(shell echo "$(ATS_VERSION)" | sed -E 's/^(.*-[0-9]+\.[0-9a-f]{7})[0-9a-f]*/\1/')
endif

SPECIAL_SAUCE := $(TC_VERSION)-$(BUILD_NUMBER).el$(RHEL_VERSION).x86_64.rpm
SPECIAL_SAUCE := $(TC_VERSION)-$(BUILD_NUMBER).el$(RHEL_VERSION).$(BUILD_ARCH).rpm
SPECIAL_SAUCE_NOARCH := $(TC_VERSION)-$(BUILD_NUMBER).el$(RHEL_VERSION).noarch.rpm
SPECIAL_SEASONING := $(TOMCAT_VERSION).$(TOMCAT_RELEASE)-1.el$(RHEL_VERSION).noarch.rpm
SPECIAL_SYRUP := $(ATS_VERSION).el$(RHEL_VERSION).x86_64.rpm
SPECIAL_SYRUP := $(ATS_VERSION).el$(RHEL_VERSION).$(BUILD_ARCH).rpm

ATS_SOURCE := $(wildcard $(TC_DIR)/cache-config/testing/docker/trafficserver/**)
TO_SOURCE := $(wildcard $(TC_DIR)/traffic_ops/**)
Expand Down Expand Up @@ -89,7 +91,7 @@ ATS_DIST_RPM := $(TC_DIR)/dist/trafficserver-$(SPECIAL_SYRUP)
TM_DIST_RPM := $(TC_DIR)/dist/traffic_monitor-$(SPECIAL_SAUCE)
TO_DIST_RPM := $(TC_DIR)/dist/traffic_ops-$(SPECIAL_SAUCE)
TP_DIST_RPM := $(TC_DIR)/dist/traffic_portal-$(SPECIAL_SAUCE)
TR_DIST_RPM := $(TC_DIR)/dist/traffic_router-$(SPECIAL_SAUCE)
TR_DIST_RPM := $(TC_DIR)/dist/traffic_router-$(SPECIAL_SAUCE_NOARCH)
TOMCAT_DIST_RPM := $(TC_DIR)/dist/tomcat-$(SPECIAL_SEASONING)
TS_DIST_RPM := $(TC_DIR)/dist/traffic_stats-$(SPECIAL_SAUCE)
ORT_DIST_RPM := $(TC_DIR)/dist/trafficcontrol-cache-config-$(SPECIAL_SAUCE)
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-cache-config
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \
FROM common-dependencies AS cache-config

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-grove
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS grove

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-grovetccfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS grovetccfg

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-tc-health-client
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \
FROM common-dependencies AS tc-health-client

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ RUN yum -y install \
yum -y clean all

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_ops
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ RUN yum -y install \
yum -y clean all

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_stats
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS traffic-stats

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
32 changes: 32 additions & 0 deletions infrastructure/docker/build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -45,6 +49,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -57,6 +65,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -69,6 +81,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -93,6 +109,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z
- ../../../.npm:/root/.npm:z
Expand All @@ -119,6 +139,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -143,6 +167,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -155,5 +183,9 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z
2 changes: 1 addition & 1 deletion traffic_router/build/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ adaptEnvironment() {
WORKSPACE=${WORKSPACE:-$TC_DIR}
RPMBUILD="$WORKSPACE/rpmbuild"
DIST="$WORKSPACE/dist"
RPM="${PACKAGE}-${TC_VERSION}-${BUILD_NUMBER}.x86_64.rpm"
RPM="${PACKAGE}-${TC_VERSION}-${BUILD_NUMBER}.noarch.rpm"
RPM_TARGET_OS="${RPM_TARGET_OS:-linux}"
TOMCAT_VERSION=9.0
TOMCAT_RELEASE=67
Expand Down
1 change: 0 additions & 1 deletion traffic_router/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<name>${project.parent.artifactId}</name>
<release>${env.BUILD_NUMBER}.${env.RHEL_VERSION}</release>
<license>Apache License, Version 2.0</license>
<needarch>x86_64</needarch>
<targetOS>${env.RPM_TARGET_OS}</targetOS>
<defineStatements>
<defineStatement>_source_payload w2.xzdio</defineStatement>
Expand Down