From 29800959ecf10563fd27154497ba8787883474c1 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Sat, 20 Dec 2025 22:47:13 -0500 Subject: [PATCH 1/9] add cloud profiler to dockerfile and start script --- jetty/Dockerfile | 6 ++++++ jetty/start.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jetty/Dockerfile b/jetty/Dockerfile index 610360af527..412589474a2 100644 --- a/jetty/Dockerfile +++ b/jetty/Dockerfile @@ -2,5 +2,11 @@ FROM jetty:12-jdk21 ADD --chown=jetty:jetty build/jetty-base /jetty-base ADD --chown=jetty:jetty start.sh / ADD --chown=jetty:jetty logging.properties / +# Create directory and download/extract Cloud Profiler agent +RUN apt-get install -y wget && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir -p /opt/cprof && \ + wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \ + | tar xzv -C /opt/cprof EXPOSE 8080 ENTRYPOINT ["/bin/sh", "/start.sh"] diff --git a/jetty/start.sh b/jetty/start.sh index c33aec75ac2..2c802d89b66 100755 --- a/jetty/start.sh +++ b/jetty/start.sh @@ -21,6 +21,7 @@ cd webapps find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} + cd /jetty-base echo "Running ${env}" -java -Dgoogle.registry.environment=${env} \ +java -agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=nomulus-frontend,-cprof_enable_heap_sampling=true \ + -Dgoogle.registry.environment=${env} \ -Djava.util.logging.config.file=/logging.properties \ -jar /usr/local/jetty/start.jar From cb36630dfdf6177f2aeb58f18409cf8bd6a9afae Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Sat, 20 Dec 2025 22:51:50 -0500 Subject: [PATCH 2/9] add apt-get update --- jetty/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty/Dockerfile b/jetty/Dockerfile index 412589474a2..c8ded9a4dbd 100644 --- a/jetty/Dockerfile +++ b/jetty/Dockerfile @@ -3,7 +3,7 @@ ADD --chown=jetty:jetty build/jetty-base /jetty-base ADD --chown=jetty:jetty start.sh / ADD --chown=jetty:jetty logging.properties / # Create directory and download/extract Cloud Profiler agent -RUN apt-get install -y wget && \ +RUN apt-get update && apt-get install -y wget && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /opt/cprof && \ wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \ From bdd51815fa12008d5f33cae037831d1e61468f05 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Mon, 22 Dec 2025 17:55:13 -0500 Subject: [PATCH 3/9] change in cb machine type for nomulus --- release/cloudbuild-nomulus.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/cloudbuild-nomulus.yaml b/release/cloudbuild-nomulus.yaml index 723cc8a1b8f..82a6af24a46 100644 --- a/release/cloudbuild-nomulus.yaml +++ b/release/cloudbuild-nomulus.yaml @@ -202,4 +202,4 @@ images: - 'gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}' timeout: 7200s options: - machineType: 'E2_HIGHCPU_32' \ No newline at end of file + machineType: 'E2_STANDARD_32d' \ No newline at end of file From 805674785396530e3a1955ec9b32f893e3534840 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Mon, 22 Dec 2025 17:56:27 -0500 Subject: [PATCH 4/9] fix typo --- release/cloudbuild-nomulus.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/cloudbuild-nomulus.yaml b/release/cloudbuild-nomulus.yaml index 82a6af24a46..f441318a340 100644 --- a/release/cloudbuild-nomulus.yaml +++ b/release/cloudbuild-nomulus.yaml @@ -202,4 +202,4 @@ images: - 'gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}' timeout: 7200s options: - machineType: 'E2_STANDARD_32d' \ No newline at end of file + machineType: 'E2_STANDARD_32' \ No newline at end of file From 913a5c984ce7b9a9b991c1f1bed35ad8cf6488ae Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Mon, 22 Dec 2025 18:39:04 -0500 Subject: [PATCH 5/9] add max worker limit to gradle tests --- release/cloudbuild-nomulus.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/cloudbuild-nomulus.yaml b/release/cloudbuild-nomulus.yaml index f441318a340..723cc8a1b8f 100644 --- a/release/cloudbuild-nomulus.yaml +++ b/release/cloudbuild-nomulus.yaml @@ -202,4 +202,4 @@ images: - 'gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}' timeout: 7200s options: - machineType: 'E2_STANDARD_32' \ No newline at end of file + machineType: 'E2_HIGHCPU_32' \ No newline at end of file From 707b883a42d8e3a459dd3b8c32240a301fa57678 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Mon, 22 Dec 2025 21:42:07 -0500 Subject: [PATCH 6/9] Switch to root before doing apt-get --- jetty/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jetty/Dockerfile b/jetty/Dockerfile index c8ded9a4dbd..4b1852ca8b2 100644 --- a/jetty/Dockerfile +++ b/jetty/Dockerfile @@ -2,11 +2,17 @@ FROM jetty:12-jdk21 ADD --chown=jetty:jetty build/jetty-base /jetty-base ADD --chown=jetty:jetty start.sh / ADD --chown=jetty:jetty logging.properties / -# Create directory and download/extract Cloud Profiler agent +# Switch to root to install the agent +USER root + RUN apt-get update && apt-get install -y wget && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /opt/cprof && \ wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \ | tar xzv -C /opt/cprof + +# Switch back to the jetty user +USER jetty + EXPOSE 8080 ENTRYPOINT ["/bin/sh", "/start.sh"] From ccdd5a053cd1d03acde81442d45e2eb72ceaa355 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Mon, 22 Dec 2025 21:45:24 -0500 Subject: [PATCH 7/9] correct dockerfile --- jetty/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty/Dockerfile b/jetty/Dockerfile index 4b1852ca8b2..ceb7e365872 100644 --- a/jetty/Dockerfile +++ b/jetty/Dockerfile @@ -2,16 +2,19 @@ FROM jetty:12-jdk21 ADD --chown=jetty:jetty build/jetty-base /jetty-base ADD --chown=jetty:jetty start.sh / ADD --chown=jetty:jetty logging.properties / -# Switch to root to install the agent +# 1. Switch to root to perform system-level installation USER root +# 2. Install wget, create the directory, and extract the agent RUN apt-get update && apt-get install -y wget && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /opt/cprof && \ wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \ - | tar xzv -C /opt/cprof + | tar xzv -C /opt/cprof && \ + # 3. Change ownership so the jetty user can access everything + chown -R jetty:jetty /opt/cprof -# Switch back to the jetty user +# 4. Switch back to the non-root user for security USER jetty EXPOSE 8080 From b4b6de0af3363831e78c26121b80d72e7cfa93fd Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Fri, 2 Jan 2026 13:34:12 -0500 Subject: [PATCH 8/9] jetty/Dockerfile --- jetty/Dockerfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/jetty/Dockerfile b/jetty/Dockerfile index ceb7e365872..881027f91e8 100644 --- a/jetty/Dockerfile +++ b/jetty/Dockerfile @@ -2,19 +2,15 @@ FROM jetty:12-jdk21 ADD --chown=jetty:jetty build/jetty-base /jetty-base ADD --chown=jetty:jetty start.sh / ADD --chown=jetty:jetty logging.properties / -# 1. Switch to root to perform system-level installation + USER root -# 2. Install wget, create the directory, and extract the agent -RUN apt-get update && apt-get install -y wget && \ - rm -rf /var/lib/apt/lists/* && \ - mkdir -p /opt/cprof && \ - wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \ +# Create a directory, download and extract the Cloud Profiler agent, version locked to "cloud-profiler-java-agent_20241028_RC00.tar.gz". +RUN mkdir -p /opt/cprof && \ + wget -q -O- https://storage.googleapis.com/cloud-profiler/java/cloud-profiler-java-agent_20241028_RC00.tar.gz\ | tar xzv -C /opt/cprof && \ - # 3. Change ownership so the jetty user can access everything chown -R jetty:jetty /opt/cprof -# 4. Switch back to the non-root user for security USER jetty EXPOSE 8080 From a1035dff7e2ed613008b4b50639ccdaee41e98bd Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Sat, 10 Jan 2026 17:21:49 -0500 Subject: [PATCH 9/9] profiler service conditional to kubernetes container name --- jetty/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty/start.sh b/jetty/start.sh index 2c802d89b66..64a0e21a826 100755 --- a/jetty/start.sh +++ b/jetty/start.sh @@ -21,7 +21,8 @@ cd webapps find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} + cd /jetty-base echo "Running ${env}" -java -agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=nomulus-frontend,-cprof_enable_heap_sampling=true \ +# Use the CONTAINER_NAME variable from Kubernetes YAML to set the profiler service name. +java -agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=${CONTAINER_NAME},-cprof_enable_heap_sampling=true \ -Dgoogle.registry.environment=${env} \ -Djava.util.logging.config.file=/logging.properties \ -jar /usr/local/jetty/start.jar