Skip to content

Commit

Permalink
Update Traffic Portal v2 builder and CI to NodeJS 18 (#8005)
Browse files Browse the repository at this point in the history
* Use apache/traffic_portal_v2_builder:master to build Traffic Portal v2

* Update TPv2 in GitHub Actions to use nodejs 18

* Use RHEL_VERSION 8

* changelog entry
  • Loading branch information
zrhoffman committed May 8, 2024
1 parent 3a9c350 commit a23fae3
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 12 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/chromdriver-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:
PROJECTS:

jobs:
chromedriver-updater:
chromedriver-updater-tp:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -48,4 +48,29 @@ jobs:
GIT_AUTHOR_NAME: asf-ci-trafficcontrol
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_GITHUB_TOKEN: ${{ secrets.ASFCI_TOKEN }}
PROJECTS: "traffic_portal/test/integration/,experimental/traffic-portal/"
PROJECTS: "traffic_portal/test/integration/"

chromedriver-updater-tpv2:
runs-on: ubuntu-latest
needs:
- chromedriver-updater-tp
steps:
- name: Checkout repo
uses: actions/checkout@master
id: checkout
- name: Install Python 3.10
uses: actions/setup-python@v2
with: { python-version: '3.10' } # Must be quoted to include the trailing 0
- name: Install Node 16
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install updater Python module and dependencies
run: pip install .github/actions/chromedriver-updater
- name: Run chromedriver-updater
uses: ./.github/actions/chromedriver-updater
env:
GIT_AUTHOR_NAME: asf-ci-trafficcontrol
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_GITHUB_TOKEN: ${{ secrets.ASFCI_TOKEN }}
PROJECTS: "experimental/traffic-portal/"
18 changes: 10 additions & 8 deletions .github/workflows/tpv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ name: Experimental Traffic Portal v2
env:
# alpine:3.13
ALPINE_VERSION: sha256:08d6ca16c60fe7490c03d10dc339d9fd8ea67c6466dea8d558526b1330a85930
NODE_VERSION: 18

on:
push:
Expand Down Expand Up @@ -55,14 +56,14 @@ jobs:
uses: actions/cache@v3
with:
path: ./experimental/traffic-portal/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 18
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ env.NODE_VERSION }}.x

- name: NPM install
if: steps.restore-npm-cache.cache-hit != 'true'
Expand All @@ -87,14 +88,15 @@ jobs:
uses: actions/cache@v3
with:
path: ./experimental/traffic-portal/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}

restore-keys: |
${{ runner.os }}-node-
- name: Node 18
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ env.NODE_VERSION }}.x

- name: NPM install
if: steps.restore-npm-cache.cache-hit != 'true'
Expand All @@ -119,14 +121,14 @@ jobs:
uses: actions/cache@v3
with:
path: ./experimental/traffic-portal/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 18
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ env.NODE_VERSION }}.x

- name: Install latest Chrome
run: sudo apt-get update && sudo apt-get install google-chrome-stable
Expand Down Expand Up @@ -194,7 +196,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./experimental/traffic-portal/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Initialize Traffic Ops Database
Expand Down Expand Up @@ -282,7 +284,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('experimental/traffic-portal/**/package*.json') }}-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('./experimental/traffic-portal/package-lock.json') }}
- name: Build RPM
uses: ./.github/actions/build-rpms
env:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7979](https://github.com/apache/trafficcontrol/pull/7979) *Traffic Router*, *Traffic Monitor*, *Traffic Stats*: Store logs in /var/log
- [#7999](https://github.com/apache/trafficcontrol/pull/7999) *Traffic Router*, *Traffic Monitor*, *Traffic Stats*: Symlink from /opt/<component>/var/log to /var/log/<component>. These symlinks are deprecated with the intent of removing them in ATC 9.0.0.
- [#7872](https://github.com/apache/trafficcontrol/issues/7872) *Traffic Router*: Updated Apache Tomcat from 9.0.43, 9.0.67, 9.0.83, and 9.0.86 to 9.0.87.
- [#7933](https://github.com/apache/trafficcontrol/pull/7933), [#8005](https://github.com/apache/trafficcontrol/pull/8005) *Traffic Portal v2*: Update NodeJS version to 18.

### Fixed
- [#7998](https://github.com/apache/trafficcontrol/pull/7998) *Traffic Portalv2* Fixed (create and update) page titles across every feature
Expand Down
46 changes: 46 additions & 0 deletions infrastructure/docker/build/Dockerfile-traffic_portal_v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
ARG RHEL_VERSION=8
FROM rockylinux:${RHEL_VERSION} as common-dependencies
ARG RHEL_VERSION=8

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-* && \
rpm --import "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${RHEL_VERSION%%.*}" && \
yum -y update ca-certificates && \
yum -y install \
git \
rpm-build \
rsync \
epel-release && \
yum -y clean all && \
# Add skip git's safe.directory check
git config --global --add safe.directory '*'

RUN curl -sL https://rpm.nodesource.com/setup_18.x | bash - && \
yum -y install nodejs

RUN npm -g install make sass
CMD /trafficcontrol/build/clean_build.sh traffic_portal

# vi:syntax=Dockerfile
4 changes: 2 additions & 2 deletions infrastructure/docker/build/docker-compose-opt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ services:
volumes:
- ../../..:/trafficcontrol:z
traffic_portal_v2_build:
image: apache/traffic_portal_builder:master
image: apache/traffic_portal_v2_builder:master
build:
dockerfile: infrastructure/docker/build/Dockerfile-traffic_portal
dockerfile: infrastructure/docker/build/Dockerfile-traffic_portal_v2
context: ../../..
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
Expand Down

0 comments on commit a23fae3

Please sign in to comment.