-
Notifications
You must be signed in to change notification settings - Fork 199
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
[discussion] run mvnd in docker #496
Comments
We currently have only a local, file-based daemon registry, so discovering a daemon running on a different host is not possible. Having some general service discovery mechanism sounds interesting. Have you thought of some specific protocol/implementation? |
Also, if the |
The daemon could be inside my build-container (that has other build-tooling i need as part of the mvn build). I just need to: (1) make sure it never shuts down, because it's a daemon |
I think @dcaillia could run both the daemon and the |
There is currently no easy way to start the daemon process directly. But it is not that hard to put together the necessary command. You could e.g. start the daemon via
You could then put a similar command to your dockerfile.
You could perhaps mount your whole home folder or whichever folder containing all your projects? Then you could do something like |
So mvnd has less potential on CI, because can‘t benifit from daemon, more suitable for local build and run proeject again and again, is it right? |
Indeed, mvnd was primarily designed as an interactive tool run by humans. |
On our CI pipelines, on a single build we launch mvn multiple times across jenkins stages, eg: lint, test, integration test, javadocs and so on, so I believe that we would benefit from mvnd on CI even though in that scenario, the definition of long-running daemon might be not so long.
Where container 1-4 calls would reuse the daemon launched by container 0. Would that be possible ? Is there other strategy that we could benefit from mvnd given our 'restriction' of launching mvn plugins on separate containers ? |
The existing network protocol between mvnd client and the daemon would work without any change even if daemon runs on a different host. What is missing is a discovery mechanism for the clients to find daemon(s) running on other hosts. Currently there is only a local file-based deamon registry implementation: the client looks into that file for existing daemons and the daemons write their busy/idle state and port there. So we need some new mechanism. |
Sounds perfect. That was exactly what I was hoping for 👍🏻 |
I have a docker image that contains a regular maven installation, jdk and other build tools.
I use it to run mvn (volume-mounting only my project sources and .m2) both during local development and on the build-server.
I like this because it makes sure my local builds are built exactly like on the build-server (which uses the same "build image"). The Dockerfile of my build image is also important as it completely defines the build environment and tools.
I'm wondering how to get the benefits of mvnd while sticking to that "build image" concept (building in a docker container).
A couple of questions pop up:
So, with mvnd on the host all is awesome - assuming you build (call mvnd) on the host too (and not in some docker container).
I'm wondering if there's a way to have 1 single long-running mvnd container (running all the time), and then when i launch my own build docker container (mounting project x sources), it somehow connects to the long-running mvnd, such that my build container talks to that long-running mvnd to get the mvn job done faster.
The text was updated successfully, but these errors were encountered: