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

Official Docker images #997

Closed
cachedout opened this issue Jan 20, 2020 · 5 comments
Closed

Official Docker images #997

cachedout opened this issue Jan 20, 2020 · 5 comments
Assignees
Labels
automation Tests & automation that help build & maintain the project

Comments

@cachedout
Copy link
Contributor

Credit

This request was originally raised by @eyalkoren and credit for the suggestion goes to him. :)

Overview

There are cases in which it makes sense to have an official Docker image for the APM Java agent. This is a proposal for the creation of such an image and for its deployment as a part of the build and release process for the APM Java Agent.

Use cases

One use case which has been well-outlined by @eyalkoren in a separate document is for a standalone agent container as a part of a K8S cluster. As a pod starts, an agent container can be configured as an init container for the pod. In doing so, the APM agent would start up prior to the application(s) in the pod and be available for instrumentation by application containers through the use of the JAVA_TOOL_OPTIONS environment variable.

I'm sure there are likely other use cases for this or the above case can be expanded upon, but I'll let @eyalkoren extend what I've written above as he sees fit. :)

Current Build Process

Currently, the build process for the Java APM agent is outlined here.

As one can see, there is currently no mention of an official container being built, nor does the repo currently contain a Dockerfile with which to build one.

Proposed Changes

This request is a collection of a few concrete changes:

1. Official Dockerfile

Obviously, the build process will need a Dockerfile in the repository. @eyalkoren has kindly provided a basic sample which could get us started by checking it directly into the root of the repository.

Alternatives

The above is simple enough that I assume we can just check it in directly instead of making it a part of the build process to create it dynamically. However, I'll mention that as an alternative here just in case the team thinks this might be a worthwhile area of exploration.

2. Official Docker image

Right now, there is no observability namespace in our Docker repository, which we would likely want in order to host these images. If we agree that creating Docker images for the APM Java Agent is a worthwhile endeavor, I will reach out to the appropriate folks to make this happen.

3. Build process

Right now, we use an internal CI server as a part of the release process. We propose modifying that pipeline to create an image as an artifact which can be automatically pushed up to Docker Hub once the requirements in step 2 are in place.

Questions

Snapshots?

We could, in theory, create nightly image snapshots as Docker images and make them available as well. My guess is that with a simple Docker file, anybody who wants an image could just clone the repository and build one themselves but if this is something people are interested in, it's worth discussing.

@cachedout cachedout self-assigned this Jan 20, 2020
@cachedout cachedout added automation Tests & automation that help build & maintain the project ci labels Jan 20, 2020
@eyalkoren
Copy link
Contributor

This is great, thanks @cachedout ! Since it seems not too complicated, I'd say it worth it. If any part of this process is expected to take more than minimal efforts, let's think if we want to invest in that.

I'm sure there are likely other use cases for this or the above case can be expanded upon, but I'll let @eyalkoren extend what I've written above as he sees fit. :)

Currently this is the main use case I see for that and it makes sense to have such images public because of the blog post that will tell people how to use it. Otherwise, if people are willing to change their docker images, they might as well do this curl themselves.

@eyalkoren
Copy link
Contributor

@cachedout since the blog post is about to go out soon, let's split this into two parts:

  1. allocating a public Docker registry namespace and manually upload the 1.12.0 Java agent image
  2. adding that to the release cycle

This way, I can make sure I update the post and publish it with the proper reference to an "official" image.

@cachedout
Copy link
Contributor Author

First attempt at getting Maven to build Docker images can be found here.

@eyalkoren Please let me know what you think about this approach! If this works for you, the next step will be building out CI pieces that can take a built image and push it up to a registry.

@cachedout
Copy link
Contributor Author

@eyalkoren As you can see by the issue above, we are waiting on the infra folks to help resolve an issue with authentication to the registry. I'll update this issue when I know more.

@cachedout
Copy link
Contributor Author

We now have official Docker images displayed on the registry web page, thanks to https://github.com/elastic/infra/issues/17508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Tests & automation that help build & maintain the project
Projects
None yet
Development

No branches or pull requests

3 participants