Skip to content

Commit 06d3237

Browse files
committed
Remove Tomcat support from UAA Release
- Only support the Spring Boot runtime. - Eliminated all configurations, templates, tests, and spec files related to Tomcat usage. Simplified scripts to only Spring Boot. Removed relevant Tomcat dependencies and tarballs. - Added explicit dir for bouncycastle libs - Need to remove the Tomcat update job before merge
1 parent e1715c8 commit 06d3237

13 files changed

Lines changed: 28 additions & 555 deletions

File tree

config/blobs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
apache-tomcat-10.1.49.tar.gz:
2-
size: 14129174
3-
object_id: 2bcc158e-35eb-45a9-5459-8cfd83914714
4-
sha: sha256:d1f5969fbaf7ade296fb8acf7b13a1ef1305d27f2caa3a4c5124e8d4c8aa2b88
51
bellsoft-21.0.9+15.tar.gz:
62
size: 231042429
73
object_id: 02cb0a18-6116-4eed-7fc4-193eafb4ab7d

jobs/uaa/spec

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ templates:
1818
config/messages.properties.erb: config/messages.properties
1919
config/uaa.crt.erb: config/uaa.crt
2020
config/boot/application.yml.erb: config/boot/application.yml
21-
config/tomcat/tomcat.logging.properties: config/tomcat/logging.properties
22-
config/tomcat/tomcat.server.xml.erb: config/tomcat/server.xml
23-
config/tomcat/tomcat.context.xml.erb: config/tomcat/context.xml
2421

2522
bbr/pre-backup-lock.sh.erb: bin/bbr/pre-backup-lock
2623
bbr/pre-restore-lock.sh.erb: bin/bbr/pre-restore-lock
@@ -51,12 +48,6 @@ packages:
5148
- uaa
5249

5350
properties:
54-
runtime.tomcat.enabled:
55-
description: |
56-
Deprecated. Set to true to force UAA to run within a Apache Tomcat container.
57-
Set to false, to use a Spring Boot runtime with an embedded Apache Tomcat container.
58-
This property will be removed when Apache Tomcat as a runtime is removed.
59-
default: true
6051
uaa.rate_limiter:
6152
config:
6253
loggingOption:
@@ -149,7 +140,7 @@ properties:
149140

150141
# General server properties
151142
uaa.catalina_opts:
152-
description: "The options used to configure Tomcat"
143+
description: "The options used to configure the UAA Server"
153144
default: -Xmx768m -XX:MaxMetaspaceSize=256m
154145
uaa.localhost_http_port:
155146
description: |
@@ -187,7 +178,7 @@ properties:
187178
description: "Array of the router IPs acting as the first group of HTTP/TCP backends. These will be added to the proxy_ips_regex as exact matches."
188179
default: []
189180
uaa.keepalive_timeout:
190-
description: Timeout value in milliseconds for the connection keepalive of the tomcat server
181+
description: Timeout value in milliseconds for the connection keepalive of the UAA server
191182
default: 120000
192183

193184
env.http_proxy:

jobs/uaa/templates/bin/pre-start.erb

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,29 +149,21 @@ function insert_ssl_cert {
149149
log "Installed Server SSL certificate"
150150
}
151151

152-
function configure_tomcat {
153-
# When run with bpm, the vcap user does not have permissions to read
154-
# files in the jobs and packages directories. Consequently, we move
155-
# our tomcat installation into a directory where we have full permissions.
156-
rm -rf /var/vcap/data/uaa/tomcat
157-
mkdir -p /var/vcap/data/uaa/
158-
cp -a /var/vcap/packages/uaa/tomcat /var/vcap/data/uaa/
159-
cp -a /var/vcap/jobs/uaa/config/tomcat/* /var/vcap/data/uaa/tomcat/conf/
160-
chown -R vcap:vcap /var/vcap/data/uaa/
161-
}
162-
163152
function configure_spring_boot {
153+
log "Configure Spring Boot directories"
154+
164155
# When run with bpm, the vcap user does not have permissions to read
165156
# files in the jobs and packages directories. Consequently, we move
166157
# our spring boot installation into a directory where we have full permissions.
167158
rm -rf /var/vcap/data/uaa/boot
168-
mkdir -p /var/vcap/data/uaa
169-
mkdir -p /var/vcap/data/sys/run/uaa/exec-tmp
170-
cp -a /var/vcap/packages/uaa/boot /var/vcap/data/uaa/
171-
cp -a /var/vcap/jobs/uaa/config/boot/* /var/vcap/data/uaa/boot/
172159
mkdir -p /var/vcap/data/uaa/boot/webapps
173160
mkdir -p /var/vcap/data/uaa/boot/work
174-
chown -R vcap:vcap /var/vcap/data/uaa/boot
161+
cp -a /var/vcap/packages/uaa/boot /var/vcap/data/uaa/
162+
cp -a /var/vcap/jobs/uaa/config/boot/* /var/vcap/data/uaa/boot/
163+
chown -R vcap:vcap /var/vcap/data/uaa
164+
165+
# Bouncy Castle FIPS needs a tmp dir with exec permissions
166+
mkdir -p /var/vcap/data/sys/run/uaa/exec-tmp
175167
chown -R vcap:vcap /var/vcap/data/sys/run/uaa/exec-tmp
176168
chmod 0755 /var/vcap/data/sys/run/uaa/exec-tmp
177169
}
@@ -191,11 +183,8 @@ PERSISTENT_UAA_CA_CERTS_FILE=$PERSISTENT_CERTS_DIR/uaa-ca-certs-cache.txt
191183
LDAP_CERTS_FILE=/var/vcap/jobs/uaa/config/ldap.crt
192184
PERSISTENT_LDAP_CERTS_FILE=$PERSISTENT_CERTS_DIR/ldap-certs-cache.txt
193185

194-
process_certs
195-
196-
configure_tomcat
197-
198186
configure_spring_boot
187+
process_certs
199188

200189
rm -rf $TMP_DIR
201190

jobs/uaa/templates/bin/uaa

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ JAVA_OPTS="$JAVA_OPTS -Dnetworkaddress.cache.ttl=0 $HTTP_PROXY_JAVA_OPTIONS $KEY
3232
JAVA_OPTS="$JAVA_OPTS -Dlog4j.configurationFile=/var/vcap/jobs/uaa/config/log4j2.properties"
3333
JAVA_OPTS="$JAVA_OPTS -Dlog4j2.formatMsgNoLookups=true"
3434
JAVA_OPTS="$JAVA_OPTS -Djava.io.tmpdir=/var/vcap/data/sys/run/uaa/exec-tmp"
35+
JAVA_OPTS="$JAVA_OPTS -Dorg.bouncycastle.native.loader.install_dir=/var/vcap/data/sys/run/uaa/exec-tmp"
3536
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
3637
JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=${uaa_log_dir}"
3738
export PATH
3839
export JAVA_OPTS
3940

40-
BOOT_RUN_LOCATION=/var/vcap/data/uaa/boot
41+
boot_run_location=/var/vcap/data/uaa/boot
4142
BOOT_OPTS="${JAVA_OPTS}"
4243
### TODO what is the difference between -Dlog4j.configurationFile and -Dlogging.config?
4344
BOOT_OPTS="${BOOT_OPTS} -Dlogging.config=/var/vcap/jobs/uaa/config/log4j2.properties"
@@ -46,27 +47,17 @@ BOOT_OPTS="${BOOT_OPTS} -Dmetrics.perRequestMetrics=true"
4647
BOOT_OPTS="${BOOT_OPTS} -Dserver.servlet.context-path=/"
4748
BOOT_OPTS="${BOOT_OPTS} -Dstatsd.enabled=true"
4849
BOOT_OPTS="${BOOT_OPTS} <%= p("uaa.catalina_opts") %>"
49-
BOOT_FILE=${BOOT_RUN_LOCATION}/uaa-boot.war
50-
51-
TOMCAT_ENABLED=<%= p("runtime.tomcat.enabled") %>
52-
if [[ "${TOMCAT_ENABLED}" == "true" ]]; then
53-
export CATALINA_TMPDIR=/var/vcap/data/sys/run/uaa/exec-tmp
54-
log "Calling Tomcat start up command"
55-
/var/vcap/packages/uaa/tomcat/bin/catalina.sh run &
56-
CATALINA_PID=$!
57-
log "uaa/tomcat started in background. Waiting for signals."
58-
wait "${CATALINA_PID}"
59-
EXIT_STATUS=$?
60-
log "uaa/tomcat job exiting"
61-
exit $EXIT_STATUS
62-
else
63-
# location of application.yml
64-
cd ${BOOT_RUN_LOCATION}
65-
java ${BOOT_OPTS} -jar ${BOOT_FILE} &
66-
BOOT_PID=$!
67-
log "uaa/boot started in background. Waiting for signals."
68-
wait "${BOOT_PID}"
69-
EXIT_STATUS=$?
70-
log "uaa/boot job exiting"
71-
exit $EXIT_STATUS
72-
fi
50+
BOOT_FILE=${boot_run_location}/uaa-boot.war
51+
52+
# location of application.yml
53+
cd ${boot_run_location}
54+
java ${BOOT_OPTS} -jar ${BOOT_FILE} > ${uaa_log_dir}/boot.log 2>&1 &
55+
boot_pid=$!
56+
mkdir -p /var/vcap/sys/run/bpm/uaa
57+
echo "${boot_pid}" > /var/vcap/sys/run/bpm/uaa/uaa.pid
58+
sleep 1
59+
log "uaa/boot(pid=${boot_pid}) started in background. Waiting for signals."
60+
wait "${boot_pid}"
61+
exit_status=$?
62+
log "uaa/boot(pid=${boot_pid}) job exiting, with status: ${exit_status}"
63+
exit ${exit_status}

jobs/uaa/templates/config/bpm.yml.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ processes:
22
- name: uaa
33
executable: /var/vcap/jobs/uaa/bin/uaa
44
env:
5-
CATALINA_BASE: /var/vcap/data/uaa/tomcat
6-
CATALINA_HOME: /var/vcap/data/uaa/tomcat
75
CLOUDFOUNDRY_CONFIG_PATH: /var/vcap/jobs/uaa/config
86
CLOUDFOUNDRY_LOG_PATH: /var/vcap/sys/log/uaa
97
CATALINA_OPTS: "<%= p('uaa.catalina_opts') %>"

jobs/uaa/templates/config/tomcat/tomcat.context.xml.erb

Lines changed: 0 additions & 22 deletions
This file was deleted.

jobs/uaa/templates/config/tomcat/tomcat.logging.properties

Lines changed: 0 additions & 49 deletions
This file was deleted.

jobs/uaa/templates/config/tomcat/tomcat.server.xml.erb

Lines changed: 0 additions & 110 deletions
This file was deleted.

packages/uaa/packaging

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@ fi
1414
# Ensure correct permissions
1515
chmod -R a+r jdk
1616

17-
tomcat_tar_file=$(find "${BOSH_COMPILE_TARGET}" -name "apache-tomcat-*.tar.gz" | sort --version-sort| tail -n1)
18-
mkdir tomcat
19-
tar zxvf "${tomcat_tar_file}" -C tomcat --strip 1
20-
if [[ $? != 0 ]] ; then
21-
echo "Cannot unpack Tomcat"
22-
exit 1
23-
fi
24-
25-
cd tomcat
26-
rm -rf webapps/*
27-
cp -a "${BOSH_COMPILE_TARGET}"/wars/cloudfoundry-identity-uaa.war webapps/ROOT.war
28-
cp -a "${BOSH_COMPILE_TARGET}"/wars/cloudfoundry-identity-statsd.war webapps/statsd.war
29-
cp -a "${BOSH_COMPILE_TARGET}"/wars/tomcat-listener.jar lib/tomcat-listener.jar
30-
31-
chmod 0755 bin/
32-
chmod 0755 bin/*.sh
33-
3417
# setup a spring boot directory
3518
cd ${BOSH_INSTALL_TARGET}
3619
mkdir boot

packages/uaa/pre_packaging

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ fi
2222

2323
#setup Java path
2424
export PATH=$JAVA_HOME/bin:$PATH
25-
2625
mkdir wars
2726

2827
#build cloud foundry UAA war
2928
cd "${BUILD_DIR}"/uaa
3029
GIT_DIR=$(find "${RELEASE_DIR}" -path "*/modules/src/uaa") ./gradlew clean assemble --max-workers=4 -Pversion="${UAA_VERSION}"
3130
cp uaa/build/libs/"cloudfoundry-identity-uaa-${UAA_VERSION}.war" "${BUILD_DIR}"/wars/cloudfoundry-identity-uaa.war
32-
cp statsd/build/libs/"cloudfoundry-identity-statsd-${UAA_VERSION}.war" "${BUILD_DIR}"/wars/cloudfoundry-identity-statsd.war
33-
cp server/build/libs/"tomcat-listener-${UAA_VERSION}.jar" "${BUILD_DIR}"/wars/tomcat-listener.jar
34-
3531
ls -la "${BUILD_DIR}"/wars
3632

3733
#clean build UAA data and build tools (java)

0 commit comments

Comments
 (0)