Skip to content

Add Docker and Docker Compose support for running OpAMP server …#473

Merged
tigrannajaryan merged 5 commits into
open-telemetry:mainfrom
juandemanjon:final_issue_443
Dec 12, 2025
Merged

Add Docker and Docker Compose support for running OpAMP server …#473
tigrannajaryan merged 5 commits into
open-telemetry:mainfrom
juandemanjon:final_issue_443

Conversation

@juandemanjon

Copy link
Copy Markdown
Contributor

Add Docker Support for OpAMP Examples

This PR adds Docker support to make it easier to run and test the OpAMP agent and server examples.

Docker Compose

# Run everything with Docker Compose
make docker-compose-up

# Scale to 50 agents
make docker-compose-scale AGENTS=50
# Stop all services
make docker-compose-down
# View logs
make docker-compose-logs

Docker build and run locally

# Build and run server
make run-docker-server

# Build and run agent (in another terminal)
make run-docker-agent

# Run both together
make run-docker

CI/CD

Images are automatically published to GHCR when version tags are pushed. The workflow can also be triggered manually for testing (main branch).

Relays on secret PACKAGES_TOKEN_GITHUB to publish images to GHCR.


Closes #443

@juandemanjon
juandemanjon requested a review from a team as a code owner December 10, 2025 01:43
@codecov

codecov Bot commented Dec 10, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.52%. Comparing base (2749d19) to head (acc1eaa).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
- Coverage   81.71%   81.52%   -0.19%     
==========================================
  Files          27       27              
  Lines        2122     2122              
==========================================
- Hits         1734     1730       -4     
- Misses        263      267       +4     
  Partials      125      125              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@douglascamata douglascamata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! I think this will be great to support some automated small e2e tests in other related repositories, like the releases one. Thank you!

@tigrannajaryan

tigrannajaryan commented Dec 10, 2025

Copy link
Copy Markdown
Member

Please move all the files to internal/examples directory. We may have a need for docker support in the root directory later and I don't want that to interfere with examples.

@juandemanjon

Copy link
Copy Markdown
Contributor Author

@tigrannajaryan the Dockerfile files are in the root of the project because of the docker build context, allowing us to easily COPY the opamp-go library which is a local reference with replace github.com/open-telemetry/opamp-go => ../../ in the examples' go.mod
if we move the dockerfile to the examples folder, we lost the possibility of building images with our local changes.

It is a trade off. Let's find a work around

@douglascamata

Copy link
Copy Markdown
Member

@juandemanjon: I think it could be fine with the Dockerfiles in an internal/examples folder. You can build them like so: docker build -f internal/examples/Dockerfile.agent .. This should properly build that dockerfile with the $PWD sent as context, which should prevent issues. No?

@juandemanjon

Copy link
Copy Markdown
Contributor Author

I had moved the docker files and temporarily updated the action to build with any commit

branches: # For testing. Remove when the PR is ready

@tigrannajaryan

Copy link
Copy Markdown
Member

We still have .dockerignore, docker-compose.yml and makefile changes at the root. Can you move those to "examples" too? We can have a makefile in "examples" and also move existing targets from the root makefile.

I don't want to add complexity to root directory. Everything about examples should ideally be self-contained in the examples directory.

@juandemanjon

Copy link
Copy Markdown
Contributor Author

Sure, I can do that.

Comment thread internal/examples/makefile
@juandemanjon

Copy link
Copy Markdown
Contributor Author

@tigrannajaryan before merging into main. Please, create the PACKAGES_TOKEN_GITHUB secrets as Classic secret with read, write, & delete package rights

Comment thread .github/workflows/docker-publish.yml Outdated
@tigrannajaryan
tigrannajaryan merged commit 83971df into open-telemetry:main Dec 12, 2025
10 of 11 checks passed
@tigrannajaryan

Copy link
Copy Markdown
Member

@juandemanjon

Copy link
Copy Markdown
Contributor Author

@juandemanjon
juandemanjon deleted the final_issue_443 branch December 12, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Official Docker image for OpAMP server

3 participants