Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfiles: download opentelemetry-javaagent.jar externally #686

Closed
paullatzelsperger opened this issue Aug 2, 2023 · 0 comments · Fixed by #697
Closed

Dockerfiles: download opentelemetry-javaagent.jar externally #686

paullatzelsperger opened this issue Aug 2, 2023 · 0 comments · Fixed by #697
Assignees
Labels
enhancement New feature or request

Comments

@paullatzelsperger
Copy link
Contributor

paullatzelsperger commented Aug 2, 2023

WHAT

Currently the opentelemetry-javaagent.jar is downloaded inside each docker image. For that, we first must install cUrl from Alpine's apk repository. This should be changed so that the opentelemetry-javaagent.jar is downloaded outside the docker image, and copied into the image upon build.

WHY

Code quality analysis tools force us to use explicit versions of cUrl. The version of cUrl changes quite frequently, and Alpine seems to not keep older versions. This means, whenever there is a version upgrade in Alpine, our build pipeline breaks.

Since cUrl is installed manually inside the image with apk, dependabot doesn't pick it up either. This causes random failures in our deployment test pipelines.
Furthermore, downloading the same JAR multiple time is not necessary anyway.

HOW

Create another gradle task that downloads the opentelemetry-javaagent.jar before the docker task, if it's not already present. For example:

val download = { url: String, destFile: File -> ant.invokeMethod("get", mapOf("src" to url, "dest" to destFile)) }

val agentFile = rootDir.resolve("opentelemetry-javaagent.jar")

if (!agentFile.exists()) {
    logger.lifecycle("Downloading OpenTelemetry Agent")
    download("https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.27.0/opentelemetry-javaagent.jar", agentFile)
}
@paullatzelsperger paullatzelsperger added the enhancement New feature or request label Aug 2, 2023
@github-project-automation github-project-automation bot moved this to Open in EDC Board Aug 2, 2023
@paullatzelsperger paullatzelsperger changed the title Dockerfiles: download opentelemetry-agent.jar externally Dockerfiles: download opentelemetry-javaagent.jar externally Aug 2, 2023
@paullatzelsperger paullatzelsperger self-assigned this Aug 7, 2023
@github-project-automation github-project-automation bot moved this from Open to Done in EDC Board Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant