1
0
mirror of https://github.com/google/nomulus synced 2026-02-08 05:50:24 +00:00

Add Cloud java profiler to nomulus docker images (#2919)

* add cloud profiler to dockerfile and start script

* add apt-get update

* change in cb machine type for nomulus

* fix typo

* add max worker limit to gradle tests

* Switch to root before doing apt-get

* correct dockerfile

* jetty/Dockerfile

* profiler service conditional to kubernetes container name
This commit is contained in:
Juan Celhay
2026-01-12 10:19:05 -05:00
committed by GitHub
parent aa12998276
commit 5725eb95e0
2 changed files with 14 additions and 1 deletions

View File

@@ -2,5 +2,16 @@ 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 /
USER root
# 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 && \
chown -R jetty:jetty /opt/cprof
USER jetty
EXPOSE 8080
ENTRYPOINT ["/bin/sh", "/start.sh"]

View File

@@ -21,6 +21,8 @@ cd webapps
find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} +
cd /jetty-base
echo "Running ${env}"
java -Dgoogle.registry.environment=${env} \
# 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