Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
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
12 changes: 6 additions & 6 deletions .github/workflows/ciab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ jobs:
path: ${{ github.workspace }}/dist/
- name: Cache Perl modules
env:
CENTOS_VERSION: 8
RHEL_VERSION: 8
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/infrastructure/cdn-in-a-box/traffic_ops/local
key: ${{ runner.os }}-cpan-centos-${{ env.CENTOS_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-${{ hashFiles('**/perllocal.pod') }}
key: ${{ runner.os }}-cpan-centos-${{ env.RHEL_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-${{ hashFiles('**/perllocal.pod') }}
restore-keys: |
${{ runner.os }}-cpan-centos-${{ env.CENTOS_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-${{ hashFiles('**/perllocal.pod') }}
${{ runner.os }}-cpan-centos-${{ env.CENTOS_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-
${{ runner.os }}-cpan-centos-${{ env.CENTOS_VERSION }}-
${{ runner.os }}-cpan-centos-${{ env.RHEL_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-${{ hashFiles('**/perllocal.pod') }}
${{ runner.os }}-cpan-centos-${{ env.RHEL_VERSION }}-${{ hashFiles('cache/**.tar.gz') }}-
${{ runner.os }}-cpan-centos-${{ env.RHEL_VERSION }}-
- name: Build CDN-in-a-Box images
env:
CENTOS_VERSION: 8
RHEL_VERSION: 8
uses: ./.github/actions/build-ciab
- name: Start CDN-in-a-Box
uses: ./.github/actions/run-ciab
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added locationByDeepCoverageZone to the `crs/stats/ip/{ip}` endpoint in the Traffic Router API
- Traffic Portal: upgraded change log UI table to use more powerful/performant ag-grid component
- Traffic Portal: change log days are now configurable in traffic_portal_properties.json (default is 7 days) and can be overridden by the user in TP

- [#5319](https://github.com/apache/trafficcontrol/issues/5319) - Added support for building RPMs that target CentOS 8

### Fixed
- [#5274](https://github.com/apache/trafficcontrol/issues/5274) - CDN in a Box's Traffic Vault image failed to build due
Expand All @@ -22,10 +22,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#5191](https://github.com/apache/trafficcontrol/issues/5191) - Error from IMS requests to /federations/all

### Changed
- Updated CDN in a Box to CentOS 8 and added `CENTOS_VERSION` Docker build arg so CDN in a Box can be built for CentOS 7, if desired
- Updated CDN in a Box to CentOS 8 and added `RHEL_VERSION` Docker build arg so CDN in a Box can be built for CentOS 7, if desired
- Traffic Ops: removed change log entry created during server update/revalidation unqueue


## [5.0.0] - 2020-10-20
### Added
- Traffic Ops Ort: Disabled ntpd verification (ntpd is deprecated in CentOS)
Expand Down
10 changes: 8 additions & 2 deletions build/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ getVersion() {

# ---------------------------------------
getRhelVersion() {
local releasever
local releasever=${RHEL_VERSION:-}
if [ -n "$releasever" ]; then
echo "el${releasever}"
return
fi

local redhat_release=/etc/redhat-release
local default_version=7
if [ -e $redhat_release ]; then
releasever="$(rpm -q --qf '%{version}' -f $redhat_release)"
releasever="${releasever%%.*}"
else
echo "${redhat_release} not found, defaulting to major release ${default_version}" >/dev/stderr
releasever=${default_version}
Expand Down Expand Up @@ -176,7 +182,7 @@ checkEnvironment() {
return 1
fi

TC_VERSION='' BUILD_NUMBER='' RHEL_VERSION='' RPMBUILD='' DIST=''
TC_VERSION='' BUILD_NUMBER='' RPMBUILD='' DIST=''
TC_VERSION="$(getVersion "$TC_DIR")"
BUILD_NUMBER="$(getBuildNumber)"
GO_VERSION="$(getGoVersion "$TC_DIR")"
Expand Down
6 changes: 4 additions & 2 deletions docs/source/admin/quick_howto/ciab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ These can all be supplied manually via the steps in :ref:`dev-building` (for Tra

.. tip:: When updating CDN-in-a-Box, there is no need to remove old images before building new ones. Docker detects which files are updated and only reuses cached layers that have not changed.

By default, CDN in a Box will be based on CentOS 8. To base CDN in a Box on CentOS 7, set the ``CENTOS_VERSION`` `build arg <https://docs.docker.com/engine/reference/builder/#arg>`_ to ``7`` (it defaults to ``8``):
By default, CDN in a Box will be based on CentOS 8. To base CDN in a Box on CentOS 7, set the ``RHEL_VERSION`` environment variable to ``7`` (for CDN in a Box, it defaults to ``8``):

.. code-block:: shell
:caption: Building CDN in a Box to run CentOS 7 instead of CentOS 8

docker-compose build --parallel --build-arg CENTOS_VERSION=7
export RHEL_VERSION=7
make # Builds RPMs for CentOS 7
docker-compose build --parallel # Builds CentOS 7 CDN in a Box images

The image that takes the takes the longest to build is the ``trafficops-perl`` image. In order to avoid needing to download, build, and test 239 Perl CPAN modules each time you rebuild the image from scratch, you can run the following command while running CDN in a Box in order to skip building the Perl modules next time:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/admin/traffic_portal/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*****************************
Traffic Portal Administration
*****************************
Traffic Portal is only supported on CentOS Linux distributions version 7.x. It runs on `NodeJS <https://nodejs.org/>`_ and requires version 12 or higher.
Traffic Portal is only supported on CentOS Linux distributions version 7.x and 8.x. It runs on `NodeJS <https://nodejs.org/>`_ and requires version 12 or higher.


Installing Traffic Portal
Expand Down
2 changes: 1 addition & 1 deletion docs/source/admin/traffic_router/migrationto2-3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Release Notes v3.0

System Requirements
===================
* Centos 7.2
* Centos 7.9 or CentOS 8.2
* OpenSSL >= 1.0.2 installed
* JDK >= 8.0 installed or available in an accessible :manpage:`yum(8)` repository
* :abbr:`APR (Apache Portable Runtime)` >= 1.4.8-3 installed or available in an accessible :manpage:`yum(8)` repository
Expand Down
20 changes: 15 additions & 5 deletions docs/source/development/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Building Traffic Control
************************
The build steps for Traffic Control components are all pretty much the same, despite that they are written in a variety of different languages and frameworks. This is accomplished by using Docker.

.. note:: Currently, both listed methods of building Traffic Control components will produce ``*.rpm`` files, meaning that the support of these components is limited to RedHat-based distributions - and none of them are currently tested (or guaranteed to work) outside of CentOS7, specifically.
.. note:: Currently, both listed methods of building Traffic Control components will produce ``*.rpm`` files, meaning that the support of these components is limited to RedHat-based distributions - and none of them are currently tested (or guaranteed to work) outside of CentOS 7 and CentOS 8, specifically.

Downloading Traffic Control
===========================
Expand Down Expand Up @@ -48,9 +48,14 @@ Usage

Options

-q Quiet mode. Suppresses output.
-v Verbose mode. Lists all build output.
-l List available projects.
-7 Build RPMs targeting CentOS 7 (default)
-8 Build RPMs targeting CentOS 8
-b Build builder Docker images before building projects
-d Disable compiler optimizations for debugging.
-l List available projects.
-p Pull builder Docker images, do not build them (default)
-q Quiet mode. Supresses output. (default)
-v Verbose mode. Lists all build output.

If present, ``projects`` should be one or more project names. When no specific project or project list is given the default projects will be built. Valid projects:

Expand Down Expand Up @@ -162,7 +167,12 @@ This is the equivalent of running

If any component fails to build, no further component builds will be attempted.

Regardless of which OS the RPMs were built on, they are meant to be installed on CentOS 7. The exception is if the RPMs were built on CentOS 8, in which case the target OS for the RPMs is CentOS 8.
By default, the RPMs will be built targeting CentOS 7. CentOS 8 is also a supported build target. You can choose which CentOS version to build for (7, 8, etc.) by setting the ``RHEL_VERSION`` environment variable:

.. code-block:: shell
:caption: Building RPMs that target CentOS 8 without the build host needing to be CentOS 8

export RHEL_VERSION=8

.. warning:: Although there are no known issues with natively-built RPMs, the official, supported method of building the RPMs is by using :ref:`pkg <pkg>` or :ref:`docker-compose <build-with-dc>`. Use natively-built RPMs at your own risk.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/overview/profiles_and_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Furthermore, for a given value of ``N``, if a Parameter exists on the :term:`cac

package
'''''''
This is a special, reserved Config File that isn't a file at all. When a Parameter's Config File is ``package``, then its name is interpreted as the name of a package. :term:`ORT` on the server using the :ref:`Profile <profiles>` that has this Parameter will attempt to install a package by that name, interpreting the Parameter's Value_ as a version string if it is not empty. The package manager used will be :manpage:`yum(8)`, regardless of system (though the Python version of :term:`ORT` will attempt to use the host system's package manager - :manpage:`yum(8)`, :manpage:`apt(8)` and ``pacman`` are supported) but that shouldn't be a problem because only CentOS 7 is supported.
This is a special, reserved Config File that isn't a file at all. When a Parameter's Config File is ``package``, then its name is interpreted as the name of a package. :term:`ORT` on the server using the :ref:`Profile <profiles>` that has this Parameter will attempt to install a package by that name, interpreting the Parameter's Value_ as a version string if it is not empty. The package manager used will be :manpage:`yum(8)`, regardless of system (though the Python version of :term:`ORT` will attempt to use the host system's package manager - :manpage:`yum(8)`, :manpage:`apt(8)` and ``pacman`` are supported) but that shouldn't be a problem because only CentOS 7 and CentOS 8 are supported.

The current implementation of :term:`ORT` will expect Parameters to exist on a :term:`cache server`'s :ref:`Profile <profiles>` with the :ref:`Names <parameter-name>` ``astats_over_http`` and ``trafficserver`` before being run the first time, as both of these are required for a :term:`cache server` to operate within a Traffic Control CDN. It is possible to install these outside of :term:`ORT` - and indeed even outside of :manpage:`yum(8)` - but such configuration is not officially supported.

Expand Down
36 changes: 29 additions & 7 deletions infrastructure/cdn-in-a-box/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ ifneq ($(PWD),$(makefile_dir))
$(error This makefile MUST be run from within its directory)
endif

ifeq ($(RHEL_VERSION),)
export RHEL_VERSION := 8
else
RHEL_VERSION := $(shell echo $(RHEL_VERSION) | cut -f1 -d.)
endif

PKG_COMMAND := ../../pkg
PKG_FLAGS := -v
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)
TC_VERSION := $(shell cat "../../VERSION")
TOMCAT_VERSION := $(shell grep '^\s*TOMCAT_VERSION=' ../../traffic_router/build/build_rpm.sh | cut -d= -f2)
TOMCAT_RELEASE := $(shell grep '^\s*TOMCAT_RELEASE=' ../../traffic_router/build/build_rpm.sh | cut -d= -f2)

RHEL_VERSION := el7

SPECIAL_SAUCE := $(TC_VERSION)-$(BUILD_NUMBER).$(RHEL_VERSION).x86_64.rpm
SPECIAL_SEASONING := $(TOMCAT_VERSION).$(TOMCAT_RELEASE)-$(BUILD_NUMBER).$(RHEL_VERSION).x86_64.rpm
SPECIAL_SAUCE := $(TC_VERSION)-$(BUILD_NUMBER).el$(RHEL_VERSION).x86_64.rpm
SPECIAL_SEASONING := $(TOMCAT_VERSION).$(TOMCAT_RELEASE)-$(BUILD_NUMBER).el$(RHEL_VERSION).x86_64.rpm

TO_SOURCE := $(wildcard ../../traffic_ops/**/*)
TO_SOURCE += $(wildcard ../../traffic_ops_db/**/*)
Expand All @@ -51,11 +55,21 @@ TP_SOURCE := $(wildcard ../../traffic_portal/**/*)
TR_SOURCE := $(wildcard ../../traffic_router/**/*)
TS_SOURCE := $(wildcard ../../traffic_stats/**/*)

.PHONY: clean very-clean all nearly-all debug native
.PHONY: all build-builders clean debug native nearly-all pull-builders very-clean

# Default target; builds all pre-requisite rpms from source trees
all: cache/traffic_ops_ort.rpm traffic_monitor/traffic_monitor.rpm traffic_portal/traffic_portal.rpm traffic_ops/traffic_ops.rpm traffic_router/traffic_router.rpm traffic_router/tomcat.rpm traffic_stats/traffic_stats.rpm

ifneq ($(filter build-builders,$(MAKECMDGOALS)),)
PKG_FLAGS += -b
ifneq ($(MAKECMDGOALS),build-builders)
MAKECMDGOALS := $(filter-out build-builders,$(MAKECMDGOALS))
build-builders: $(MAKECMDGOALS)
else
build-builders: all
endif
endif

ifneq ($(filter debug,$(MAKECMDGOALS)),)
PKG_FLAGS += -d
export DEBUG_BUILD = true
Expand All @@ -79,7 +93,15 @@ native: all
endif
endif

#.PHONY: native
ifneq ($(filter pull-builders,$(MAKECMDGOALS)),)
PKG_FLAGS += -p
ifneq ($(MAKECMDGOALS),pull-builders)
MAKECMDGOALS := $(filter-out pull-builders,$(MAKECMDGOALS))
pull-builders: $(MAKECMDGOALS)
else
pull-builders: all
endif
endif

# Actual output rpm recipies
traffic_monitor/traffic_monitor.rpm: ../../dist/traffic_monitor-$(SPECIAL_SAUCE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
env_file:
- variables.env
hostname: portal-integration
Expand Down
12 changes: 6 additions & 6 deletions infrastructure/cdn-in-a-box/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ services:
context: .
dockerfile: traffic_ops/Dockerfile-go
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_OPS_RPM: traffic_ops/traffic_ops.rpm
depends_on:
- db
Expand All @@ -81,7 +81,7 @@ services:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_OPS_RPM: infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm
depends_on:
- db
Expand All @@ -106,7 +106,7 @@ services:
context: .
dockerfile: traffic_portal/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_PORTAL_RPM: traffic_portal/traffic_portal.rpm
depends_on:
- enroller
Expand All @@ -124,7 +124,7 @@ services:
context: .
dockerfile: traffic_monitor/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_MONITOR_RPM: traffic_monitor/traffic_monitor.rpm
depends_on:
- enroller
Expand All @@ -142,7 +142,7 @@ services:
context: .
dockerfile: traffic_router/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_ROUTER_RPM: traffic_router/traffic_router.rpm
TOMCAT_RPM: traffic_router/tomcat.rpm
depends_on:
Expand All @@ -160,7 +160,7 @@ services:
context: .
dockerfile: traffic_stats/Dockerfile
args:
CENTOS_VERSION: ${CENTOS_VERSION:-8}
RHEL_VERSION: ${RHEL_VERSION:-8}
image: trafficstats
depends_on:
- enroller
Expand Down
12 changes: 6 additions & 6 deletions infrastructure/cdn-in-a-box/edge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
# Based on CentOS 8
############################################################

ARG CENTOS_VERSION=8
FROM centos:${CENTOS_VERSION} AS common-cache-server-layers
ARG CENTOS_VERSION=8
ARG RHEL_VERSION=8
FROM centos:${RHEL_VERSION} AS common-cache-server-layers
ARG RHEL_VERSION=8

RUN if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \
RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
yum -y install dnf || exit 1; \
fi

EXPOSE 80

RUN dnf -y install epel-release && \
if [[ "${CENTOS_VERSION%%.*}" -ge 8 ]]; then \
if [[ "${RHEL_VERSION%%.*}" -ge 8 ]]; then \
additional_packages='compat-openssl10 pkgconf-pkg-config' || \
exit 1; \
else \
Expand Down Expand Up @@ -81,7 +81,7 @@ RUN dnf -y install epel-release && \
perl-URI \
tcl \
$additional_packages && \
if [[ "${CENTOS_VERSION%%.*}" -eq 8 ]]; then \
if [[ "${RHEL_VERSION%%.*}" -eq 8 ]]; then \
set -- \
# Pretend that we have the right library versions.
# TODO: Use a proper CentOS 7 or 8 RPM once trafficserver
Expand Down
12 changes: 6 additions & 6 deletions infrastructure/cdn-in-a-box/mid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
# Based on CentOS 8
############################################################

ARG CENTOS_VERSION=8
FROM centos:${CENTOS_VERSION} AS common-cache-server-layers
ARG CENTOS_VERSION=8
ARG RHEL_VERSION=8
FROM centos:${RHEL_VERSION} AS common-cache-server-layers
ARG RHEL_VERSION=8

RUN if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \
RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
yum -y install dnf || exit 1; \
fi

EXPOSE 80

RUN dnf -y install epel-release && \
if [[ "${CENTOS_VERSION%%.*}" -ge 8 ]]; then \
if [[ "${RHEL_VERSION%%.*}" -ge 8 ]]; then \
additional_packages='compat-openssl10 pkgconf-pkg-config' || \
exit 1; \
else \
Expand Down Expand Up @@ -81,7 +81,7 @@ RUN dnf -y install epel-release && \
perl-URI \
tcl \
$additional_packages && \
if [[ "${CENTOS_VERSION%%.*}" -eq 8 ]]; then \
if [[ "${RHEL_VERSION%%.*}" -eq 8 ]]; then \
set -- \
# Pretend that we have the right library versions.
# TODO: Use a proper CentOS 7 or 8 RPM once trafficserver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ services:
context: .
dockerfile: optional/socksproxy/Dockerfile
args:
CENTOS_VERSION: 8
RHEL_VERSION: 8
hostname: socksproxy
domainname: infra.ciab.test
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
context: .
dockerfile: optional/vnc/Dockerfile
args:
CENTOS_VERSION: 8
RHEL_VERSION: 8
VNC_BUILD_USER: "ciabuser"
depends_on:
- dns
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# Dockerfile to build optional CiaB Socks Proxy
# Based on CentOS 8
############################################################
ARG CENTOS_VERSION=8
FROM centos:${CENTOS_VERSION}
ARG CENTOS_VERSION=8
ARG RHEL_VERSION=8
FROM centos:${RHEL_VERSION}
ARG RHEL_VERSION=8

RUN if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \
RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
yum -y install dnf || exit 1; \
fi

Expand Down
Loading