From 035c4232045a1f0b18c9145cdf17ff12908e8f75 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Fri, 20 Nov 2020 10:33:20 -0700 Subject: [PATCH 01/12] CENTOS_VERSION -> RHEL_VERSION --- .github/workflows/ciab.yaml | 12 ++++++------ CHANGELOG.md | 3 +-- docs/source/admin/quick_howto/ciab.rst | 4 ++-- .../docker-compose.traffic-portal-test.yml | 2 +- infrastructure/cdn-in-a-box/docker-compose.yml | 12 ++++++------ infrastructure/cdn-in-a-box/edge/Dockerfile | 12 ++++++------ infrastructure/cdn-in-a-box/mid/Dockerfile | 12 ++++++------ .../optional/docker-compose.socksproxy.yml | 2 +- .../optional/docker-compose.vnc.yml | 2 +- .../optional/socksproxy/Dockerfile | 8 ++++---- .../cdn-in-a-box/optional/vnc/Dockerfile | 8 ++++---- .../cdn-in-a-box/traffic_monitor/Dockerfile | 8 ++++---- .../traffic_monitor/Dockerfile-debug | 8 ++++---- .../cdn-in-a-box/traffic_ops/Dockerfile | 18 +++++++++--------- .../cdn-in-a-box/traffic_ops/Dockerfile-go | 12 ++++++------ .../traffic_ops/Dockerfile-go-debug | 8 ++++---- .../cdn-in-a-box/traffic_portal/Dockerfile | 8 ++++---- .../traffic_portal_integration_test/Dockerfile | 10 +++++----- .../cdn-in-a-box/traffic_router/Dockerfile | 8 ++++---- .../cdn-in-a-box/traffic_stats/Dockerfile | 8 ++++---- .../traffic_stats/Dockerfile-debug | 8 ++++---- 21 files changed, 86 insertions(+), 87 deletions(-) diff --git a/.github/workflows/ciab.yaml b/.github/workflows/ciab.yaml index aab60b3cf2..0edb483e05 100644 --- a/.github/workflows/ciab.yaml +++ b/.github/workflows/ciab.yaml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d25492339..a5a12a03e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/source/admin/quick_howto/ciab.rst b/docs/source/admin/quick_howto/ciab.rst index 6a100d26b8..b1b2b4e690 100644 --- a/docs/source/admin/quick_howto/ciab.rst +++ b/docs/source/admin/quick_howto/ciab.rst @@ -44,12 +44,12 @@ 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 `_ 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`` `build arg `_ to ``7`` (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 + docker-compose build --parallel --build-arg RHEL_VERSION=7 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: diff --git a/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml b/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml index 59ad76bb8a..0b9cc4c24c 100644 --- a/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml +++ b/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml @@ -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 diff --git a/infrastructure/cdn-in-a-box/docker-compose.yml b/infrastructure/cdn-in-a-box/docker-compose.yml index 943ee4ae46..878e363a14 100644 --- a/infrastructure/cdn-in-a-box/docker-compose.yml +++ b/infrastructure/cdn-in-a-box/docker-compose.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/infrastructure/cdn-in-a-box/edge/Dockerfile b/infrastructure/cdn-in-a-box/edge/Dockerfile index 9ab0579327..f4e50cbf59 100644 --- a/infrastructure/cdn-in-a-box/edge/Dockerfile +++ b/infrastructure/cdn-in-a-box/edge/Dockerfile @@ -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 \ @@ -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 diff --git a/infrastructure/cdn-in-a-box/mid/Dockerfile b/infrastructure/cdn-in-a-box/mid/Dockerfile index d72f5ad7c1..591a3eb94d 100644 --- a/infrastructure/cdn-in-a-box/mid/Dockerfile +++ b/infrastructure/cdn-in-a-box/mid/Dockerfile @@ -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 \ @@ -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 diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml index 11d15de35a..b45783d8ff 100644 --- a/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml +++ b/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml @@ -45,7 +45,7 @@ services: context: . dockerfile: optional/socksproxy/Dockerfile args: - CENTOS_VERSION: 8 + RHEL_VERSION: 8 hostname: socksproxy domainname: infra.ciab.test volumes: diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml index 0b26682d40..0cbf84c14e 100644 --- a/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml +++ b/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml @@ -48,7 +48,7 @@ services: context: . dockerfile: optional/vnc/Dockerfile args: - CENTOS_VERSION: 8 + RHEL_VERSION: 8 VNC_BUILD_USER: "ciabuser" depends_on: - dns diff --git a/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile b/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile index 01e21d4421..1fe7d75613 100644 --- a/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile +++ b/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile @@ -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 diff --git a/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile b/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile index a446a8b7c7..d002090069 100644 --- a/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile +++ b/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile @@ -15,11 +15,11 @@ # specific language governing permissions and limitations # under the License. -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 diff --git a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile index 8f37220c79..ffa9ab285b 100644 --- a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile @@ -19,11 +19,11 @@ # Based on CentOS ############################################################ -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 diff --git a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile-debug b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile-debug index 948c174b60..4a8a4fe35a 100644 --- a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile-debug +++ b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile-debug @@ -20,11 +20,11 @@ # Based on CentOS ############################################################ -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as get-delve -ARG CENTOS_VERSION=8 +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as get-delve +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 diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile index a675f4ccd0..5b3e42d75e 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile @@ -23,24 +23,24 @@ # Keep the trafficops-common-deps in Dockerfile the same as # trafficops-common-deps in Dockerfile-go to cache the same # layer. -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as trafficops-common-deps -ARG CENTOS_VERSION=8 -# Makes CENTOS_VERSION available in later layers without needing to specify it again -ENV CENTOS_VERSION=$CENTOS_VERSION +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as trafficops-common-deps +ARG RHEL_VERSION=8 +# Makes RHEL_VERSION available in later layers without needing to specify it again +ENV RHEL_VERSION=$RHEL_VERSION -RUN if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \ +RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \ yum -y install dnf || exit 1; \ fi RUN set -o nounset -o errexit && \ mkdir -p /etc/cron.d; \ - if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \ + if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \ use_repo=''; \ else \ use_repo='--repo=pgdg96'; \ fi; \ - dnf -y install "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${CENTOS_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"; \ + dnf -y install "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"; \ dnf -y $use_repo -- install postgresql96; \ dnf -y install epel-release; \ dnf -y install \ @@ -62,7 +62,7 @@ FROM trafficops-common-deps as trafficops-perl-deps EXPOSE 443 ENV MOJO_MODE production -RUN if [[ "${CENTOS_VERSION%%.*}" -ge 8 ]]; then \ +RUN if [[ "${RHEL_VERSION%%.*}" -ge 8 ]]; then \ enable_repo='--enablerepo=PowerTools' || exit 1; \ fi && \ dnf -y --allowerasing $enable_repo install \ diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go index 2101902790..3e949fd346 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go @@ -23,22 +23,22 @@ # Keep the trafficops-common-deps in Dockerfile-go the same # as trafficops-common-deps in Dockerfile to cache the same # layer. -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as trafficops-common-deps -ARG CENTOS_VERSION=8 +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as trafficops-common-deps +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 RUN set -o nounset -o errexit && \ mkdir -p /etc/cron.d; \ - if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \ + if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \ include_repo=''; \ else \ include_repo='--repo=pgdg96'; \ fi; \ - dnf -y install "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${CENTOS_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"; \ + dnf -y install "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"; \ dnf -y $include_repo -- install postgresql96; \ dnf -y install epel-release; \ dnf -y install \ diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go-debug b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go-debug index be661d0f61..be6c30d028 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go-debug +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go-debug @@ -20,11 +20,11 @@ # Based on CentOS 8 ############################################################ -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as get-delve -ARG CENTOS_VERSION=8 +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as get-delve +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 diff --git a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile index 07a9c52b4d..4441d916f7 100644 --- a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile @@ -20,11 +20,11 @@ # 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 diff --git a/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile index 39c1cde118..be2dae121c 100644 --- a/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile @@ -15,18 +15,18 @@ # specific language governing permissions and limitations # under the License. -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as os-dependencies -ARG CENTOS_VERSION=8 +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as os-dependencies +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 # Installs the Google Chrome dnf repo COPY infrastructure/cdn-in-a-box/traffic_portal_integration_test/etc etc -RUN if [[ "${CENTOS_VERSION%%.*}" -eq 7 ]]; then \ +RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \ utils_package=yum-utils; \ else \ utils_package=dnf-utils; \ diff --git a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile index 6d8bca7818..d3029154c4 100644 --- a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile @@ -19,11 +19,11 @@ # 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 diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile index a9d6c06f52..1f09127d51 100644 --- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile @@ -19,11 +19,11 @@ # Based on CentOS ############################################################ -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 diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-debug b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-debug index 9c49f6f0d9..976e0c45d0 100644 --- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-debug +++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-debug @@ -20,11 +20,11 @@ # Based on CentOS ############################################################ -ARG CENTOS_VERSION=8 -FROM centos:${CENTOS_VERSION} as get-delve -ARG CENTOS_VERSION=8 +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as get-delve +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 From 4a9f1001f57ef690f6d2176a2229ef1c88769b85 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 19:52:12 -0700 Subject: [PATCH 02/12] Put help text in a here document --- pkg | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg b/pkg index 2187592f0d..e3f0ca1753 100755 --- a/pkg +++ b/pkg @@ -87,16 +87,18 @@ verbose=0 while getopts :qvld? opt; do case $opt in \?) - PROJECTS=`$SELF -l | sed "s/^/ - /"` - echo "Usage: $SELF [options] [projects]" - echo " -q Quiet mode. Supresses output." - echo " -v Verbose mode. Lists all build output." - echo " -l List available projects." - echo " -d Disable compiler optimizations for debugging." - echo - echo " If no projects are listed, all projects will be packaged." - echo " Valid projects:" - cat <<< "$PROJECTS" + PROJECTS=`$SELF -l | sed "s/^/ - /"` + <<-HELP_TEXT cat + Usage: $SELF [options] [projects] + -q Quiet mode. Supresses output. + -v Verbose mode. Lists all build output. + -l List available projects. + -d Disable compiler optimizations for debugging. + + If no projects are listed, all projects will be packaged. + Valid projects: + $PROJECTS + HELP_TEXT exit 0 ;; q) From 82e530c1600162676836bc40a2e394a240e47480 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 20:02:42 -0700 Subject: [PATCH 03/12] Sort flags --- docs/source/development/building.rst | 7 ++++--- pkg | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/source/development/building.rst b/docs/source/development/building.rst index 58d11ad2ca..8f6599bc69 100644 --- a/docs/source/development/building.rst +++ b/docs/source/development/building.rst @@ -48,9 +48,10 @@ Usage Options --q Quiet mode. Suppresses output. --v Verbose mode. Lists all build output. --l List available projects. +-d Disable compiler optimizations for debugging. +-l List available projects. +-q Quiet mode. Supresses output. +-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: diff --git a/pkg b/pkg index e3f0ca1753..d1f422ac0f 100755 --- a/pkg +++ b/pkg @@ -84,16 +84,16 @@ fi # Parse command line arguments verbose=0 -while getopts :qvld? opt; do +while getopts :?dlqv opt; do case $opt in \?) PROJECTS=`$SELF -l | sed "s/^/ - /"` <<-HELP_TEXT cat Usage: $SELF [options] [projects] + -d Disable compiler optimizations for debugging. + -l List available projects. -q Quiet mode. Supresses output. -v Verbose mode. Lists all build output. - -l List available projects. - -d Disable compiler optimizations for debugging. If no projects are listed, all projects will be packaged. Valid projects: @@ -101,22 +101,22 @@ while getopts :qvld? opt; do HELP_TEXT exit 0 ;; - q) - exec >/dev/null 2>&1 - ;; - v) - verbose=1 - ;; - l) - "${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services - exit $? - ;; d) echo '-d is set! Disabling all compiler optimizations for debugging...'; # If DEBUG_BUILD is true, then Golang binaries will remain unoptimized and # RPM packaging will not strip binaries. RUN_OPTIONS+=(-e 'DEBUG_BUILD=true'); ;; + l) + "${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services + exit $? + ;; + q) + exec >/dev/null 2>&1 + ;; + v) + verbose=1 + ;; esac done From aa12699dfdd7b7df9910dc8469de0b9e45d3601a Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 20:14:45 -0700 Subject: [PATCH 04/12] Optionally build or pull Docker builder images --- docs/source/development/building.rst | 4 +++- infrastructure/cdn-in-a-box/Makefile | 22 +++++++++++++++++++++- pkg | 19 +++++++++++++++---- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/docs/source/development/building.rst b/docs/source/development/building.rst index 8f6599bc69..ddeaf22c0f 100644 --- a/docs/source/development/building.rst +++ b/docs/source/development/building.rst @@ -48,9 +48,11 @@ Usage Options +-b Build builder Docker images before building projects -d Disable compiler optimizations for debugging. -l List available projects. --q Quiet mode. Supresses output. +-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: diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile index 94d3a8c47f..a126b8bea2 100644 --- a/infrastructure/cdn-in-a-box/Makefile +++ b/infrastructure/cdn-in-a-box/Makefile @@ -51,11 +51,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 @@ -79,6 +89,16 @@ native: all endif endif +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 + #.PHONY: native # Actual output rpm recipies diff --git a/pkg b/pkg index d1f422ac0f..d3e5d86d40 100755 --- a/pkg +++ b/pkg @@ -84,15 +84,17 @@ fi # Parse command line arguments verbose=0 -while getopts :?dlqv opt; do +while getopts :?bdlpqv opt; do case $opt in \?) PROJECTS=`$SELF -l | sed "s/^/ - /"` <<-HELP_TEXT cat Usage: $SELF [options] [projects] + -b Build builder Docker images before building projects -d Disable compiler optimizations for debugging. -l List available projects. - -q Quiet mode. Supresses output. + -p Pull builder Docker images, do not build them (default) + -q Quiet mode. Supresses output. (default) -v Verbose mode. Lists all build output. If no projects are listed, all projects will be packaged. @@ -101,6 +103,9 @@ while getopts :?dlqv opt; do HELP_TEXT exit 0 ;; + b) + build_images=1 + ;; d) echo '-d is set! Disabling all compiler optimizations for debugging...'; # If DEBUG_BUILD is true, then Golang binaries will remain unoptimized and @@ -111,6 +116,9 @@ while getopts :?dlqv opt; do "${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services exit $? ;; + p) + build_images=0 + ;; q) exec >/dev/null 2>&1 ;; @@ -136,8 +144,11 @@ while (( "$#" )); do if (( "$verbose" == 0 )); then exec >/dev/null 2>&1 fi - "${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1 - "${COMPOSECMD[@]}" -f $COMPOSE_FILE build --pull $1 || exit 1 + if [[ $build_images -eq 1 ]]; then + "${COMPOSECMD[@]}" -f $COMPOSE_FILE build $1 || exit 1 + else + "${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1 + fi "${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1 ) || { # Don't totally bail out, but make note of the failures. From ff6b43bbdc77e60c9f66c94b3826b914c31abbb2 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 15:36:12 -0700 Subject: [PATCH 05/12] - Support building RPMs that target CentOS 8 - Make CentOS 7 the default build target - Make CentOS 8 the default build target for CDN in a Box --- CHANGELOG.md | 2 +- build/functions.sh | 10 ++++++++-- docs/source/admin/quick_howto/ciab.rst | 6 ++++-- docs/source/admin/traffic_portal/installation.rst | 2 +- .../source/admin/traffic_router/migrationto2-3.rst | 2 +- docs/source/development/building.rst | 11 +++++++++-- docs/source/overview/profiles_and_parameters.rst | 2 +- infrastructure/cdn-in-a-box/Makefile | 14 +++++++++----- pkg | 14 +++++++++++++- traffic_ops_ort/build/traffic_ops_ort.spec | 1 + 10 files changed, 48 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5a12a03e3..3c7d6bc1e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/build/functions.sh b/build/functions.sh index 7c6bde1e71..cf0adbabb1 100755 --- a/build/functions.sh +++ b/build/functions.sh @@ -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} @@ -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")" diff --git a/docs/source/admin/quick_howto/ciab.rst b/docs/source/admin/quick_howto/ciab.rst index b1b2b4e690..7a474ce1c6 100644 --- a/docs/source/admin/quick_howto/ciab.rst +++ b/docs/source/admin/quick_howto/ciab.rst @@ -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 ``RHEL_VERSION`` `build 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 RHEL_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: diff --git a/docs/source/admin/traffic_portal/installation.rst b/docs/source/admin/traffic_portal/installation.rst index 5e4b3c5f98..077dd4ecec 100644 --- a/docs/source/admin/traffic_portal/installation.rst +++ b/docs/source/admin/traffic_portal/installation.rst @@ -16,7 +16,7 @@ ***************************** Traffic Portal Administration ***************************** -Traffic Portal is only supported on CentOS Linux distributions version 7.x. It runs on `NodeJS `_ 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 `_ and requires version 12 or higher. Installing Traffic Portal diff --git a/docs/source/admin/traffic_router/migrationto2-3.rst b/docs/source/admin/traffic_router/migrationto2-3.rst index bb8889ca3f..31607485dc 100644 --- a/docs/source/admin/traffic_router/migrationto2-3.rst +++ b/docs/source/admin/traffic_router/migrationto2-3.rst @@ -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 diff --git a/docs/source/development/building.rst b/docs/source/development/building.rst index ddeaf22c0f..43f850dfd9 100644 --- a/docs/source/development/building.rst +++ b/docs/source/development/building.rst @@ -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 =========================== @@ -48,6 +48,8 @@ Usage Options +-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. @@ -165,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 ` or :ref:`docker-compose `. Use natively-built RPMs at your own risk. diff --git a/docs/source/overview/profiles_and_parameters.rst b/docs/source/overview/profiles_and_parameters.rst index 49ba61b067..ea60872509 100644 --- a/docs/source/overview/profiles_and_parameters.rst +++ b/docs/source/overview/profiles_and_parameters.rst @@ -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 ` 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 ` 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 ` with the :ref:`Names ` ``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. diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile index a126b8bea2..2406cfe940 100644 --- a/infrastructure/cdn-in-a-box/Makefile +++ b/infrastructure/cdn-in-a-box/Makefile @@ -29,18 +29,22 @@ ifneq ($(PWD),$(makefile_dir)) $(error This makefile MUST be run from within its directory) endif +ifeq ($(RHEL_VERSION),) + 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/**/*) diff --git a/pkg b/pkg index d3e5d86d40..fab4b7ef74 100755 --- a/pkg +++ b/pkg @@ -82,14 +82,20 @@ if [ ${#COMPOSECMD[@]} -eq 0 ]; then COMPOSECMD=(docker run --rm "${DOCKER_ADDR[@]}" $COMPOSE_OPTIONS "${VOLUMES[@]}" -w "$(pwd)" $IMAGE) fi +# Mark RHEL_VERSION for export, although it is not set yet +export RHEL_VERSION +RUN_OPTIONS=(-e RHEL_VERSION) + # Parse command line arguments verbose=0 -while getopts :?bdlpqv opt; do +while getopts :?78bdlpqv opt; do case $opt in \?) PROJECTS=`$SELF -l | sed "s/^/ - /"` <<-HELP_TEXT cat Usage: $SELF [options] [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. @@ -103,6 +109,12 @@ while getopts :?bdlpqv opt; do HELP_TEXT exit 0 ;; + 7) + RHEL_VERSION=7 + ;; + 8) + RHEL_VERSION=8 + ;; b) build_images=1 ;; diff --git a/traffic_ops_ort/build/traffic_ops_ort.spec b/traffic_ops_ort/build/traffic_ops_ort.spec index b5a5c567b0..1d3e33cf28 100644 --- a/traffic_ops_ort/build/traffic_ops_ort.spec +++ b/traffic_ops_ort/build/traffic_ops_ort.spec @@ -28,6 +28,7 @@ Vendor: Apache Software Foundation Packager: dev at trafficcontrol dot Apache dot org %{?el6:Requires: perl-JSON, perl-libwww-perl, perl-Crypt-SSLeay, perl-Digest-SHA} %{?el7:Requires: perl-JSON, perl-libwww-perl, perl-Crypt-SSLeay, perl-LWP-Protocol-https, perl-Digest-SHA} +%{?el8:Requires: perl-JSON, perl-libwww-perl, perl-Net-SSLeay, perl-LWP-Protocol-https, perl-Digest-SHA} %description From 38fcc2f5b3657cd4f6331c01f62e8ba80079ce29 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 10:09:17 -0700 Subject: [PATCH 06/12] Uncomment build section --- .../docker/build/docker-compose.yml | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/infrastructure/docker/build/docker-compose.yml b/infrastructure/docker/build/docker-compose.yml index e2fb397183..7e816d15ae 100644 --- a/infrastructure/docker/build/docker-compose.yml +++ b/infrastructure/docker/build/docker-compose.yml @@ -20,74 +20,74 @@ version: '2' services: source: image: apache/traffic_source_tarballer:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-source - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-source + context: ../../.. volumes: - ../../..:/trafficcontrol:z traffic_monitor_build: image: apache/traffic_monitor_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_monitor - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_monitor + context: ../../.. volumes: - ../../..:/trafficcontrol:z traffic_ops_build: image: apache/traffic_ops_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops + context: ../../.. volumes: - ../../..:/trafficcontrol:z traffic_ops_ort_build: image: apache/traffic_ops_ort_builder:master - # build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops_ort - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops_ort + context: ../../.. volumes: - ../../..:/trafficcontrol:z traffic_portal_build: image: apache/traffic_portal_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_portal - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_portal + context: ../../.. volumes: - ../../..:/trafficcontrol:z traffic_router_build: image: apache/traffic_router_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_router - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_router + context: ../../.. volumes: - ../../..:/trafficcontrol:z - ../../../.m2:/root/.m2:z traffic_stats_build: image: apache/traffic_stats_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-traffic_stats - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-traffic_stats + context: ../../.. volumes: - ../../..:/trafficcontrol:z grove_build: image: apache/traffic_grove_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-grove - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-grove + context: ../../.. volumes: - ../../..:/trafficcontrol:z grovetccfg_build: image: apache/traffic_grovetccfg_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-grovetccfg - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-grovetccfg + context: ../../.. volumes: - ../../..:/trafficcontrol:z @@ -99,8 +99,8 @@ services: docs: image: apache/traffic_docs_builder:master - #build: - # dockerfile: infrastructure/docker/build/Dockerfile-docs - # context: ../../.. + build: + dockerfile: infrastructure/docker/build/Dockerfile-docs + context: ../../.. volumes: - ../../..:/trafficcontrol:z From f708619400d5093d53ae58b3a316b81d0a5001e4 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 14:10:37 -0700 Subject: [PATCH 07/12] Install common dependencies in common-dependencies build stage --- infrastructure/docker/build/Dockerfile-docs | 4 +++- infrastructure/docker/build/Dockerfile-grove | 4 +++- infrastructure/docker/build/Dockerfile-grovetccfg | 4 +++- infrastructure/docker/build/Dockerfile-source | 5 +++-- .../docker/build/Dockerfile-traffic_monitor | 4 +++- infrastructure/docker/build/Dockerfile-traffic_ops | 4 +++- .../docker/build/Dockerfile-traffic_ops_ort | 14 +++++++++++++- .../docker/build/Dockerfile-traffic_portal | 6 ++++-- .../docker/build/Dockerfile-traffic_router | 4 +++- .../docker/build/Dockerfile-traffic_stats | 4 +++- 10 files changed, 41 insertions(+), 12 deletions(-) diff --git a/infrastructure/docker/build/Dockerfile-docs b/infrastructure/docker/build/Dockerfile-docs index a37079a0c8..b89edd2c7f 100644 --- a/infrastructure/docker/build/Dockerfile-docs +++ b/infrastructure/docker/build/Dockerfile-docs @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### docs specific requirements +FROM common-dependencies AS docs + ADD docs/source/requirements.txt /docs.requirements.txt RUN yum -y install \ python36 \ diff --git a/infrastructure/docker/build/Dockerfile-grove b/infrastructure/docker/build/Dockerfile-grove index 9996ed21dd..8382fca5b2 100644 --- a/infrastructure/docker/build/Dockerfile-grove +++ b/infrastructure/docker/build/Dockerfile-grove @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### grove specific requirements +FROM common-dependencies AS grove + RUN yum -y install \ git \ rpm-build && \ diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg b/infrastructure/docker/build/Dockerfile-grovetccfg index 34679d9a34..c6c796308d 100644 --- a/infrastructure/docker/build/Dockerfile-grovetccfg +++ b/infrastructure/docker/build/Dockerfile-grovetccfg @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### grovetccfg specific requirements +FROM common-dependencies AS grovetccfg + RUN yum -y install \ git \ rpm-build && \ diff --git a/infrastructure/docker/build/Dockerfile-source b/infrastructure/docker/build/Dockerfile-source index 9de6c3c6ee..bae289febd 100644 --- a/infrastructure/docker/build/Dockerfile-source +++ b/infrastructure/docker/build/Dockerfile-source @@ -14,11 +14,10 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org -### # top level of trafficcontrol directory must be mounted as a volume: # docker run --volume /trafficcontrol:$(pwd) ... VOLUME /trafficcontrol @@ -32,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### source specific requirements +FROM common-dependencies AS source + RUN yum -y install \ git && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor b/infrastructure/docker/build/Dockerfile-traffic_monitor index 74a906654b..c2566d084d 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_monitor +++ b/infrastructure/docker/build/Dockerfile-traffic_monitor @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### traffic_monitor specific requirements +FROM common-dependencies AS traffic-monitor + RUN yum -y install \ # gcc is necessary in case -gcflags 'all=-N -l' is passed to go build gcc \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops b/infrastructure/docker/build/Dockerfile-traffic_ops index 3f4ab376a5..457a2ae14a 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops +++ b/infrastructure/docker/build/Dockerfile-traffic_ops @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### traffic_ops specific requirements +FROM common-dependencies AS traffic-ops + RUN yum -y install \ expat-devel \ gcc \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops_ort b/infrastructure/docker/build/Dockerfile-traffic_ops_ort index 550ab95d30..be01caac63 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops_ort +++ b/infrastructure/docker/build/Dockerfile-traffic_ops_ort @@ -14,13 +14,25 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies + +MAINTAINER dev@trafficcontrol.apache.org # top level of trafficcontrol directory must be mounted as a volume: # docker run --volume /trafficcontrol:$(pwd) ... VOLUME /trafficcontrol ### Common for all sub-component builds +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ + rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ + yum -y update ca-certificates && \ + yum -y install \ + epel-release && \ + yum -y clean all + +### traffic_ops_ort specific requirements +FROM common-dependencies AS traffic-ops-ort + RUN yum -y install \ git \ rpm-build && \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal b/infrastructure/docker/build/Dockerfile-traffic_portal index 8d516bc36e..ab08ebdbd6 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_portal +++ b/infrastructure/docker/build/Dockerfile-traffic_portal @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -30,7 +30,9 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ epel-release && \ yum -y clean all -# traffic_portal specific +### traffic_portal specific +FROM common-dependencies AS traffic-portal + RUN yum -y install \ gcc \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_router b/infrastructure/docker/build/Dockerfile-traffic_router index 263a811d76..0e795b46f4 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_router +++ b/infrastructure/docker/build/Dockerfile-traffic_router @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### traffic_router specific requirements +FROM common-dependencies AS traffic-router + RUN yum -y install \ which \ curl \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats b/infrastructure/docker/build/Dockerfile-traffic_stats index 3901b89e1c..a86acb7549 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_stats +++ b/infrastructure/docker/build/Dockerfile-traffic_stats @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 +FROM centos:7 AS common-dependencies MAINTAINER dev@trafficcontrol.apache.org @@ -31,6 +31,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y clean all ### traffic_stats specific requirements +FROM common-dependencies AS traffic-stats + RUN yum -y install \ git \ rpm-build && \ From fa3ed69efee837bf5f84b04fde92cc132de31973 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 19 Nov 2020 14:31:06 -0700 Subject: [PATCH 08/12] Install git and rpm-build as common dependencies --- infrastructure/docker/build/Dockerfile-docs | 4 ++-- infrastructure/docker/build/Dockerfile-grove | 7 ++----- infrastructure/docker/build/Dockerfile-grovetccfg | 7 ++----- infrastructure/docker/build/Dockerfile-source | 6 ++---- infrastructure/docker/build/Dockerfile-traffic_monitor | 6 +++--- infrastructure/docker/build/Dockerfile-traffic_ops | 4 ++-- infrastructure/docker/build/Dockerfile-traffic_ops_ort | 7 ++----- infrastructure/docker/build/Dockerfile-traffic_portal | 4 ++-- infrastructure/docker/build/Dockerfile-traffic_router | 10 +++++----- infrastructure/docker/build/Dockerfile-traffic_stats | 7 ++----- 10 files changed, 24 insertions(+), 38 deletions(-) diff --git a/infrastructure/docker/build/Dockerfile-docs b/infrastructure/docker/build/Dockerfile-docs index b89edd2c7f..5576151a97 100644 --- a/infrastructure/docker/build/Dockerfile-docs +++ b/infrastructure/docker/build/Dockerfile-docs @@ -27,6 +27,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all @@ -38,8 +40,6 @@ RUN yum -y install \ python36 \ python36-pip \ python36-psutil \ - git \ - rpm-build \ make && \ yum -y clean all RUN python3 -m pip install --upgrade setuptools && \ diff --git a/infrastructure/docker/build/Dockerfile-grove b/infrastructure/docker/build/Dockerfile-grove index 8382fca5b2..57c25ea632 100644 --- a/infrastructure/docker/build/Dockerfile-grove +++ b/infrastructure/docker/build/Dockerfile-grove @@ -27,17 +27,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all ### grove specific requirements FROM common-dependencies AS grove -RUN yum -y install \ - git \ - rpm-build && \ - 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 && \ diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg b/infrastructure/docker/build/Dockerfile-grovetccfg index c6c796308d..dd319bc9bb 100644 --- a/infrastructure/docker/build/Dockerfile-grovetccfg +++ b/infrastructure/docker/build/Dockerfile-grovetccfg @@ -27,17 +27,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all ### grovetccfg specific requirements FROM common-dependencies AS grovetccfg -RUN yum -y install \ - git \ - rpm-build && \ - 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 && \ diff --git a/infrastructure/docker/build/Dockerfile-source b/infrastructure/docker/build/Dockerfile-source index bae289febd..61bf0e5254 100644 --- a/infrastructure/docker/build/Dockerfile-source +++ b/infrastructure/docker/build/Dockerfile-source @@ -27,16 +27,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all ### source specific requirements FROM common-dependencies AS source -RUN yum -y install \ - git && \ - yum -y clean all - WORKDIR /trafficcontrol CMD build/clean_build.sh tarball diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor b/infrastructure/docker/build/Dockerfile-traffic_monitor index c2566d084d..b6ed73e2eb 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_monitor +++ b/infrastructure/docker/build/Dockerfile-traffic_monitor @@ -27,6 +27,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all @@ -35,9 +37,7 @@ FROM common-dependencies AS traffic-monitor RUN yum -y install \ # gcc is necessary in case -gcflags 'all=-N -l' is passed to go build - gcc \ - git \ - rpm-build && \ + gcc && \ yum -y clean all COPY GO_VERSION / diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops b/infrastructure/docker/build/Dockerfile-traffic_ops index 457a2ae14a..4100bed6ee 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops +++ b/infrastructure/docker/build/Dockerfile-traffic_ops @@ -27,6 +27,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all @@ -36,12 +38,10 @@ FROM common-dependencies AS traffic-ops RUN yum -y install \ expat-devel \ gcc \ - git \ libcurl-devel \ make \ openssl-devel \ perl-ExtUtils-MakeMaker \ - rpm-build \ tar && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops_ort b/infrastructure/docker/build/Dockerfile-traffic_ops_ort index be01caac63..34014afe50 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops_ort +++ b/infrastructure/docker/build/Dockerfile-traffic_ops_ort @@ -27,17 +27,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all ### traffic_ops_ort specific requirements FROM common-dependencies AS traffic-ops-ort -RUN yum -y install \ - git \ - rpm-build && \ - 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 && \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal b/infrastructure/docker/build/Dockerfile-traffic_portal index ab08ebdbd6..aad9313e95 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_portal +++ b/infrastructure/docker/build/Dockerfile-traffic_portal @@ -27,6 +27,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all @@ -35,12 +37,10 @@ FROM common-dependencies AS traffic-portal RUN yum -y install \ gcc \ - git \ libffi-devel \ make \ nodejs \ npm \ - rpm-build \ ruby-devel \ rubygems diff --git a/infrastructure/docker/build/Dockerfile-traffic_router b/infrastructure/docker/build/Dockerfile-traffic_router index 0e795b46f4..7dd3a34bcb 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_router +++ b/infrastructure/docker/build/Dockerfile-traffic_router @@ -27,6 +27,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all @@ -35,11 +37,9 @@ FROM common-dependencies AS traffic-router RUN yum -y install \ which \ - curl \ - git \ - java-1.8.0-openjdk \ - java-1.8.0-openjdk-devel \ - rpm-build && \ + curl \ + java-1.8.0-openjdk \ + java-1.8.0-openjdk-devel && \ yum -y clean all ENV JAVA_HOME=/usr/lib/jvm/java diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats b/infrastructure/docker/build/Dockerfile-traffic_stats index a86acb7549..29003f421f 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_stats +++ b/infrastructure/docker/build/Dockerfile-traffic_stats @@ -27,17 +27,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ yum -y update ca-certificates && \ yum -y install \ + git \ + rpm-build \ epel-release && \ yum -y clean all ### traffic_stats specific requirements FROM common-dependencies AS traffic-stats -RUN yum -y install \ - git \ - rpm-build && \ - 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 && \ From cbba62154b3a2cfd58638dd1d43fb9f2f938e785 Mon Sep 17 00:00:00 2001 From: Hank Beatty Date: Thu, 19 Nov 2020 14:40:11 -0700 Subject: [PATCH 09/12] Explicitly install rsync, as CentOS 7 makes rsync a git dependency but CentOS 8 does not --- infrastructure/docker/build/Dockerfile-docs | 1 + infrastructure/docker/build/Dockerfile-grove | 1 + infrastructure/docker/build/Dockerfile-grovetccfg | 1 + infrastructure/docker/build/Dockerfile-source | 1 + infrastructure/docker/build/Dockerfile-traffic_monitor | 1 + infrastructure/docker/build/Dockerfile-traffic_ops | 1 + infrastructure/docker/build/Dockerfile-traffic_ops_ort | 1 + infrastructure/docker/build/Dockerfile-traffic_portal | 1 + infrastructure/docker/build/Dockerfile-traffic_router | 1 + infrastructure/docker/build/Dockerfile-traffic_stats | 1 + 10 files changed, 10 insertions(+) diff --git a/infrastructure/docker/build/Dockerfile-docs b/infrastructure/docker/build/Dockerfile-docs index 5576151a97..b2883c7b23 100644 --- a/infrastructure/docker/build/Dockerfile-docs +++ b/infrastructure/docker/build/Dockerfile-docs @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-grove b/infrastructure/docker/build/Dockerfile-grove index 57c25ea632..1c9091328a 100644 --- a/infrastructure/docker/build/Dockerfile-grove +++ b/infrastructure/docker/build/Dockerfile-grove @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg b/infrastructure/docker/build/Dockerfile-grovetccfg index dd319bc9bb..ca72b0bf26 100644 --- a/infrastructure/docker/build/Dockerfile-grovetccfg +++ b/infrastructure/docker/build/Dockerfile-grovetccfg @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-source b/infrastructure/docker/build/Dockerfile-source index 61bf0e5254..050ee4e7ef 100644 --- a/infrastructure/docker/build/Dockerfile-source +++ b/infrastructure/docker/build/Dockerfile-source @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor b/infrastructure/docker/build/Dockerfile-traffic_monitor index b6ed73e2eb..b065720760 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_monitor +++ b/infrastructure/docker/build/Dockerfile-traffic_monitor @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops b/infrastructure/docker/build/Dockerfile-traffic_ops index 4100bed6ee..a5c231b1d6 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops +++ b/infrastructure/docker/build/Dockerfile-traffic_ops @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops_ort b/infrastructure/docker/build/Dockerfile-traffic_ops_ort index 34014afe50..c09e8bf60a 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops_ort +++ b/infrastructure/docker/build/Dockerfile-traffic_ops_ort @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal b/infrastructure/docker/build/Dockerfile-traffic_portal index aad9313e95..5cf2016e86 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_portal +++ b/infrastructure/docker/build/Dockerfile-traffic_portal @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_router b/infrastructure/docker/build/Dockerfile-traffic_router index 7dd3a34bcb..cd9417dc2b 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_router +++ b/infrastructure/docker/build/Dockerfile-traffic_router @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats b/infrastructure/docker/build/Dockerfile-traffic_stats index 29003f421f..3c191f52fa 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_stats +++ b/infrastructure/docker/build/Dockerfile-traffic_stats @@ -29,6 +29,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ yum -y install \ git \ rpm-build \ + rsync \ epel-release && \ yum -y clean all From 42f03290a5740d5f53bd0524cd54db8e1e3a23c8 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Fri, 20 Nov 2020 15:28:07 -0700 Subject: [PATCH 10/12] Upgrade builder images to CentOS 8 --- infrastructure/docker/build/Dockerfile-docs | 19 ++++++++++----- infrastructure/docker/build/Dockerfile-grove | 13 +++++++--- .../docker/build/Dockerfile-grovetccfg | 13 +++++++--- infrastructure/docker/build/Dockerfile-source | 13 +++++++--- .../docker/build/Dockerfile-traffic_monitor | 13 +++++++--- .../docker/build/Dockerfile-traffic_ops | 13 +++++++--- .../docker/build/Dockerfile-traffic_ops_ort | 13 +++++++--- .../docker/build/Dockerfile-traffic_portal | 13 +++++++--- .../docker/build/Dockerfile-traffic_router | 13 +++++++--- .../docker/build/Dockerfile-traffic_stats | 13 +++++++--- .../docker/build/docker-compose.yml | 24 +++++++++++++++++-- 11 files changed, 125 insertions(+), 35 deletions(-) diff --git a/infrastructure/docker/build/Dockerfile-docs b/infrastructure/docker/build/Dockerfile-docs index b2883c7b23..28fee6d7d3 100644 --- a/infrastructure/docker/build/Dockerfile-docs +++ b/infrastructure/docker/build/Dockerfile-docs @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ @@ -38,9 +45,9 @@ FROM common-dependencies AS docs ADD docs/source/requirements.txt /docs.requirements.txt RUN yum -y install \ - python36 \ - python36-pip \ - python36-psutil \ + python3 \ + python3-pip \ + python3-psutil \ make && \ yum -y clean all RUN python3 -m pip install --upgrade setuptools && \ diff --git a/infrastructure/docker/build/Dockerfile-grove b/infrastructure/docker/build/Dockerfile-grove index 1c9091328a..2111773101 100644 --- a/infrastructure/docker/build/Dockerfile-grove +++ b/infrastructure/docker/build/Dockerfile-grove @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg b/infrastructure/docker/build/Dockerfile-grovetccfg index ca72b0bf26..658b647de8 100644 --- a/infrastructure/docker/build/Dockerfile-grovetccfg +++ b/infrastructure/docker/build/Dockerfile-grovetccfg @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-source b/infrastructure/docker/build/Dockerfile-source index 050ee4e7ef..3b8e1cc9b4 100644 --- a/infrastructure/docker/build/Dockerfile-source +++ b/infrastructure/docker/build/Dockerfile-source @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor b/infrastructure/docker/build/Dockerfile-traffic_monitor index b065720760..a84e68a2c1 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_monitor +++ b/infrastructure/docker/build/Dockerfile-traffic_monitor @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops b/infrastructure/docker/build/Dockerfile-traffic_ops index a5c231b1d6..a49d91fb50 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops +++ b/infrastructure/docker/build/Dockerfile-traffic_ops @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops_ort b/infrastructure/docker/build/Dockerfile-traffic_ops_ort index c09e8bf60a..1aa3661343 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_ops_ort +++ b/infrastructure/docker/build/Dockerfile-traffic_ops_ort @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal b/infrastructure/docker/build/Dockerfile-traffic_portal index 5cf2016e86..3aef174e3e 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_portal +++ b/infrastructure/docker/build/Dockerfile-traffic_portal @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_router b/infrastructure/docker/build/Dockerfile-traffic_router index cd9417dc2b..e91982a9b8 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_router +++ b/infrastructure/docker/build/Dockerfile-traffic_router @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats b/infrastructure/docker/build/Dockerfile-traffic_stats index 3c191f52fa..b791b7f95b 100644 --- a/infrastructure/docker/build/Dockerfile-traffic_stats +++ b/infrastructure/docker/build/Dockerfile-traffic_stats @@ -14,7 +14,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FROM centos:7 AS common-dependencies +ARG RHEL_VERSION=8 +FROM centos:${RHEL_VERSION} as common-dependencies +ARG RHEL_VERSION=8 MAINTAINER dev@trafficcontrol.apache.org @@ -23,8 +25,13 @@ MAINTAINER dev@trafficcontrol.apache.org VOLUME /trafficcontrol ### Common for all sub-component builds -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \ +RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \ + rpm_gpg_key=RPM-GPG-KEY-centosofficial; \ + else \ + rpm_gpg_key="RPM-GPG-KEY-CentOS-${RHEL_VERSION%%.*}"; \ + fi && \ + rpm --import "/etc/pki/rpm-gpg/${rpm_gpg_key}" && \ + rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \ yum -y update ca-certificates && \ yum -y install \ git \ diff --git a/infrastructure/docker/build/docker-compose.yml b/infrastructure/docker/build/docker-compose.yml index 7e816d15ae..f301949c4c 100644 --- a/infrastructure/docker/build/docker-compose.yml +++ b/infrastructure/docker/build/docker-compose.yml @@ -23,6 +23,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-source context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -31,6 +33,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-traffic_monitor context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -39,14 +43,18 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z traffic_ops_ort_build: image: apache/traffic_ops_ort_builder:master build: - dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops_ort - context: ../../.. + dockerfile: infrastructure/docker/build/Dockerfile-traffic_ops_ort + context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -55,6 +63,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-traffic_portal context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -63,6 +73,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-traffic_router context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z - ../../../.m2:/root/.m2:z @@ -72,6 +84,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-traffic_stats context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -80,6 +94,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-grove context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -88,6 +104,8 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-grovetccfg context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z @@ -102,5 +120,7 @@ services: build: dockerfile: infrastructure/docker/build/Dockerfile-docs context: ../../.. + args: + RHEL_VERSION: ${RHEL_VERSION:-8} volumes: - ../../..:/trafficcontrol:z From 0d0ddb9502766b7f0773ec5ee4359c88a8430fb0 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Sat, 21 Nov 2020 13:18:06 -0700 Subject: [PATCH 11/12] Mark RHEL_VERSION for export if it is undefined --- infrastructure/cdn-in-a-box/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile index 2406cfe940..ea17f500ee 100644 --- a/infrastructure/cdn-in-a-box/Makefile +++ b/infrastructure/cdn-in-a-box/Makefile @@ -30,7 +30,7 @@ $(error This makefile MUST be run from within its directory) endif ifeq ($(RHEL_VERSION),) - RHEL_VERSION := 8 + export RHEL_VERSION := 8 else RHEL_VERSION := $(shell echo $(RHEL_VERSION) | cut -f1 -d.) endif From 899e3f1cded88efdf4144aee72ba145630e70f67 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Tue, 1 Dec 2020 11:44:33 -0700 Subject: [PATCH 12/12] Remove commented out line --- infrastructure/cdn-in-a-box/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile index ea17f500ee..3c4abece03 100644 --- a/infrastructure/cdn-in-a-box/Makefile +++ b/infrastructure/cdn-in-a-box/Makefile @@ -103,8 +103,6 @@ pull-builders: all endif endif -#.PHONY: native - # Actual output rpm recipies traffic_monitor/traffic_monitor.rpm: ../../dist/traffic_monitor-$(SPECIAL_SAUCE) cp -f $? $@