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

Add a standalone, containerized agent #91

Merged
merged 3 commits into from
Jan 21, 2022
Merged

Add a standalone, containerized agent #91

merged 3 commits into from
Jan 21, 2022

Conversation

npepinpe
Copy link
Contributor

@npepinpe npepinpe commented Jan 20, 2022

Description

This PR adds a standalone agent which can be containerized and run as:

docker run -p 26500:26500 ghcr.io/camunda-community-hub/eze:0.7.1-SNAPSHOT

You can then use zbctl to interact with the engine as you would a normal Zeebe gateway (almost).

This is done by adding a new module, agent, which simply wraps a ZeebeEngine in a picocli wrapper. Nothing fancy was added (like configuration or dynamic versions). There's a docker profile in the agent module which will use jib to produce a Docker image based on azul/zulu-openjdk-alpine:17-jre-headless, as this is the smallest Java 17 image available. We can always switch to something more standard if we want.

By default, you can build the Docker image by running:

mvn -DskipTests -Pdocker package

This will only trigger a local build of the image. To push the image, you'd run:

mvn -DskipTests -Pdocker -DdockerGoal=build package

This will build and push the image to GHCR. The configuration assumes whoever runs this is already authenticated to GHCR. You can change the version/tag of the image by using the property dockerImageTag.

The last commit of the PR updates the pipeline to also push the image on releases, and will set the tag property to the release tag. One caveat is that the actual version in the manifest in the image will probably be the snapshot version and not the tag, I think, but I haven't tested it.

Feel free to reject, modify, ridicule, praise, whatever you want this PR 😄

Related issues

closes #44

Adds a new agent module which wraps EZE into a standalone command line
executable. The new module comes with a docker profile which will
produce a Docker image that will expose the 26500 port by default and
can be used to run EZE standalone.

Tests are minimal - testing the Docker image would require an additional
integration/QA module as the build pipeline relies on Jib and not on a
standard Dockerfile, which means we can't use Testcontainers to build
the agent on the fly in the tests.
Adds a new step to the release pipeline to push the Docker image. This
is triggered only on releases and will not push a SNAPSHOT image.

Keep in mind that it will use the code in the repo as is, so technically
the MANIFEST would still contain the wrong version of the executable,
but the Docker image tag will be correctly overridden with the release
tag.

This is untested, and I'm happy to drop this commit for the initial PR.
Copy link
Collaborator

@ChrisKujawa ChrisKujawa left a comment

Choose a reason for hiding this comment

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

Love it thanks @npepinpe ❤️ 😍

I think we can iterate over it if we see something missing. I will merge it and try it out. The GHCR token is something I have to create in my account right?

Thanks again 🙇

@npepinpe
Copy link
Contributor Author

npepinpe commented Jan 21, 2022

There were some improvements I would've liked to see, but it made the PR considerably bigger: adding the EZE version and Zeebe version when logging startup, being able to configure the bind address of the server as well as its transport (so, for example, using Unix domain socket instead of an IP address to completely avoid port collisions), producing a standalone executable JAR, adding a QA module to actually test the image, etc. Would be cool to have one day. Additionally, since this embeds eze, it uses the module's log4j2 dependency as SLF4J implementation - not sure that's the right thing, but probably fine for now.

Anyhow, I guess I'll let one of you merge this? Not sure what the process is now 🙃

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.

Provide docker image for non-java usage
2 participants