Skip to content

Commit

Permalink
Update Tomcat to 9.0.91 (#8040)
Browse files Browse the repository at this point in the history
* Get Tomcat version from .env file

* Update Tomcat to 9.0.91
  • Loading branch information
zrhoffman committed Jul 8, 2024
1 parent 0b21b43 commit e4631e5
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 29 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ATS_VERSION=9.1.2
GO_VERSION=1.22.5
TOMCAT_VERSION=9.0.91
6 changes: 4 additions & 2 deletions .github/workflows/codeql.java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ jobs:
STARTUP_SCRIPT_LOC: ../core/src/main/lib/systemd/system
LOGROTATE_SCRIPT_DIR: /etc/logrotate.d
LOGROTATE_SCRIPT_LOC: ../core/src/main/lib/logrotate
TOMCAT_RELEASE: tomcat_release
TOMCAT_VERSION: tomcat_version
#TOMCAT_VERSION: (set from .env)

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Load environment
run: cp .env '${{ github.env }}'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tr.tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ env:
STARTUP_SCRIPT_LOC: ../core/src/main/lib/systemd/system
LOGROTATE_SCRIPT_DIR: /etc/logrotate.d
LOGROTATE_SCRIPT_LOC: ../core/src/main/lib/logrotate
TOMCAT_RELEASE: tomcat_release
TOMCAT_VERSION: tomcat_version
#TOMCAT_VERSION: (set from .env)

on:
push:
Expand All @@ -47,6 +46,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master
- name: Load environment # This loads TOMCAT_VERSION into the environment.
run: cp .env '${{ github.env }}'
- name: Install Java dependencies
run: sudo apt -y install libtcnative-1 maven
- name: Cache local Maven repository
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Updated Go version to 1.22.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.
- [#7990](https://github.com/apache/trafficcontrol/pull/7990) *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.
- [#8009](https://github.com/apache/trafficcontrol/pull/8009) *Traffic Portal v2*: Update NodeJS version to 20.
- [#8040](https://github.com/apache/trafficcontrol/pull/8040) *Traffic Router*: Get the Tomcat version from .env and update Tomcat to 9.0.90.

### Fixed
- [#8008](https://github.com/apache/trafficcontrol/pull/8008) *Traffic Router* Fix czf temp file deletion issue.
Expand Down
3 changes: 2 additions & 1 deletion dev/traffic_router/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# limitations under the License.
#
FROM alpine:latest AS trafficrouter-dev
ARG TOMCAT_VERSION

ENV TC=/go/src/github.com/apache/trafficcontrol
VOLUME "$TC"
Expand All @@ -30,7 +31,7 @@ EXPOSE 3053:53/tcp \

RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb

ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.67/bin/apache-tomcat-9.0.67.tar.gz /opt/tomcat.tgz
ADD https://archive.apache.org/dist/tomcat/tomcat-9/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz /opt/tomcat.tgz

RUN cd /opt && \
tar -xf tomcat.tgz && \
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ services:
trafficrouter:
build:
context: dev/traffic_router
args:
- TOMCAT_VERSION=${TOMCAT_VERSION}

env_file: # makes TOMCAT_VERSION avaiable to the container
- .env
depends_on:
- trafficmonitor
hostname: trafficrouter
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/cdn-in-a-box/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ BUILD_NUMBER := $(shell bash -c ' \
cat $(TC_DIR)/BUILD_NUMBER)
BUILD_ARCH := $(shell docker run --name=ciab-get-$(BASE_IMAGE)-$(RHEL_VERSION)-arch --rm $(BASE_IMAGE):$(RHEL_VERSION) rpm --eval %_arch )
TC_VERSION := $(shell cat "$(TC_DIR)/VERSION")
TOMCAT_VERSION := $(shell grep '^\s*TOMCAT_VERSION=' "$(TC_DIR)/traffic_router/build/build_rpm.sh" | cut -d= -f2)
TOMCAT_RELEASE := $(shell grep '^\s*TOMCAT_RELEASE=' "$(TC_DIR)/traffic_router/build/build_rpm.sh" | cut -d= -f2)
TOMCAT_VERSION := $(shell grep '^\s*TOMCAT_VERSION=' "$(TC_DIR)/.env" | cut -d= -f2)
ATS_VERSION := $(shell $(CIAB_DIR_RELATIVE)bin/ats-version.sh)
ifeq ($(RHEL_VERSION),7)
# The commit hash in `git describe` is only 7 characters in CentOS 7's git 1.8
Expand All @@ -67,7 +66,7 @@ endif

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

ATS_SOURCE := $(wildcard $(TC_DIR)/cache-config/testing/docker/trafficserver/**)
Expand Down
8 changes: 3 additions & 5 deletions traffic_router/build/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ buildRpmTrafficRouter () {
adaptEnvironment() {
echo "Verifying the build configuration environment."
# get traffic_control src path -- relative to build_rpm.sh script
PACKAGE='' TC_VERSION='' RPMBUILD='' DIST='' RPM='' TOMCAT_VERSION='' TOMCAT_RELEASE=''
PACKAGE='' TC_VERSION='' RPMBUILD='' DIST='' RPM=''
PACKAGE="traffic_router"
TC_VERSION=$(getVersion "$TC_DIR")
BUILD_NUMBER=${BUILD_NUMBER:-$(getBuildNumber)}
Expand All @@ -82,15 +82,13 @@ adaptEnvironment() {
DIST="$WORKSPACE/dist"
RPM="${PACKAGE}-${TC_VERSION}-${BUILD_NUMBER}.noarch.rpm"
RPM_TARGET_OS="${RPM_TARGET_OS:-linux}"
TOMCAT_VERSION=9.0
TOMCAT_RELEASE=87
export PACKAGE TC_VERSION BUILD_NUMBER WORKSPACE RPMBUILD DIST RPM RPM_TARGET_OS TOMCAT_VERSION TOMCAT_RELEASE
source "${TC_DIR}/.env" # contains TOMCAT_VERSION
export PACKAGE TC_VERSION BUILD_NUMBER WORKSPACE RPMBUILD DIST RPM RPM_TARGET_OS TOMCAT_VERSION

echo "=================================================="
echo "WORKSPACE: $WORKSPACE"
echo "BUILD_NUMBER: $BUILD_NUMBER"
echo "TOMCAT_VERSION=$TOMCAT_VERSION"
echo "TOMCAT_RELEASE=$TOMCAT_RELEASE"
echo "TC_VERSION: $TC_VERSION"
echo "RPM: $RPM"
echo "--------------------------------------------------"
Expand Down
3 changes: 1 addition & 2 deletions traffic_router/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<requireEnvironmentVariable>
<variableName>BUILD_NUMBER</variableName>
<variableName>TOMCAT_VERSION</variableName>
<variableName>TOMCAT_RELEASE</variableName>
<variableName>RHEL_VERSION</variableName>
<variableName>RPM_TARGET_OS</variableName>
<variableName>STARTUP_SCRIPT_DIR</variableName>
Expand Down Expand Up @@ -271,7 +270,7 @@
<requires>
<require>java-11-openjdk-headless</require>
<require>tzdata-java</require>
<require>tomcat >= ${env.TOMCAT_VERSION}.${env.TOMCAT_RELEASE}</require>
<require>tomcat >= ${tomcat.version}</require>
<require>apr >= 1.4.8</require>
<require>tomcat-native >= 1.2.23</require>
</requires>
Expand Down
4 changes: 2 additions & 2 deletions traffic_router/connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>9.0.87</version>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>9.0.87</version>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions traffic_router/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,19 +359,19 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>9.0.87</version>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>9.0.87</version>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jni</artifactId>
<version>9.0.87</version>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
5 changes: 5 additions & 0 deletions traffic_router/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<commons-compress.version>1.9</commons-compress.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<!-- TOMCAT_VERSION must be set in your environment to a release, like 9.0.90. This should
be the same TOMCAT_VERSION value that .env has:
https://github.com/apache/trafficcontrol/blob/master/.env
-->
<tomcat.version>${env.TOMCAT_VERSION}</tomcat.version>
</properties>

<scm>
Expand Down
14 changes: 6 additions & 8 deletions traffic_router/tomcat-rpm/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ checkEnvironment() {
export DIST="$WORKSPACE/dist"
# Forcing BUILD NUMBER to 1 since this is outside the tree and related to Tomcat Release
export BUILD_NUMBER=1
export RPM="${PACKAGE}-${TOMCAT_VERSION}.${TOMCAT_RELEASE}-${BUILD_NUMBER}.${RHEL_VERSION}.noarch.rpm"
export SRPM="${PACKAGE}-${TOMCAT_VERSION}.${TOMCAT_RELEASE}-${BUILD_NUMBER}.${RHEL_VERSION}.src.rpm"
export RPM="${PACKAGE}-${TOMCAT_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.noarch.rpm"
export SRPM="${PACKAGE}-${TOMCAT_VERSION}-${BUILD_NUMBER}.${RHEL_VERSION}.src.rpm"


echo "=================================================="
echo "WORKSPACE: $WORKSPACE"
echo "TOMCAT_RELEASE: $TOMCAT_RELEASE" #defined in traffic_router
echo "TOMCAT_VERSION: $TOMCAT_VERSION" #defined in traffic_router
echo "BUILD_NUMBER: $BUILD_NUMBER" #defined in traffic_router
echo "RPM: $RPM"
Expand All @@ -61,11 +60,10 @@ initBuildArea() {
cd "$RPMBUILD"
mkdir -p SPECS SOURCES RPMS SRPMS BUILD BUILDROOT) || { echo "Could not create $RPMBUILD: $?"; return 1; }
export VERSION=$TOMCAT_VERSION
export RELEASE=$TOMCAT_RELEASE

echo "Downloading Tomcat $VERSION.$RELEASE..."
curl -fo "${RPMBUILD}/SOURCES/apache-tomcat-${VERSION}.${RELEASE}.tar.gz" "https://archive.apache.org/dist/tomcat/tomcat-${VERSION%.*}/v${VERSION}.${RELEASE}/bin/apache-tomcat-${VERSION}.${RELEASE}.tar.gz" || \
{ echo "Could not download Tomcat $VERSION.$RELEASE: $?"; exit 1; }
echo "Downloading Tomcat $VERSION..."
curl -fo "${RPMBUILD}/SOURCES/apache-tomcat-${VERSION}.tar.gz" "https://archive.apache.org/dist/tomcat/tomcat-${VERSION%%.*}/v${VERSION}/bin/apache-tomcat-${VERSION}.tar.gz" || \
{ echo "Could not download Tomcat $VERSION: $?"; exit 1; }

cp "$TR_DIR/tomcat-rpm/tomcat.service" "$RPMBUILD/SOURCES/" || { echo "Could not copy source files: $?"; exit 1; }
cp "$TR_DIR/tomcat-rpm/tomcat.spec" "$RPMBUILD/SPECS/" || { echo "Could not copy spec files: $?"; exit 1; }
Expand Down Expand Up @@ -93,7 +91,7 @@ buildRpmForEl () {
# build RPM with xz level 2 compression
rpmbuild --define "_topdir $(pwd)" \
--define "build_number $BUILD_NUMBER.$RHEL_VERSION" \
--define "tomcat_version $TOMCAT_VERSION.$TOMCAT_RELEASE" \
--define "tomcat_version $TOMCAT_VERSION" \
--define "_target_os ${RPM_TARGET_OS}" \
--define '%_source_payload w2.xzdio' \
--define '%_binary_payload w2.xzdio' \
Expand Down

0 comments on commit e4631e5

Please sign in to comment.