ContainerSolutions / minimesos

The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
https://www.minimesos.org
Apache License 2.0
429 stars 61 forks source link

Start marathon with different command line arguments #509

Closed mannickutd closed 7 years ago

mannickutd commented 7 years ago

How do I configure marathon to start with different arguments?

eg. ./bin/start --master --event_subscriber http_callback

mdirkse commented 7 years ago

With difficulty :)

There's no way to do it via the miniMesos file, unfortunately (the configuration for the Marathon piece is done here, as you can see there is no option for different arguments).

What I ended up doing was the following:

First, create a new Marathon docker image that has the arguments that you need worked into the entrypoint. I used this Dockerfile:

FROM mesosphere/marathon:v0.15.3
ENTRYPOINT ["./bin/start", "--event_subscriber", "http_callback"]

and built it with docker build --rm -t marathonwithcallback:v0.15.3 .
Then use the miniMesos configuration file to make minimesos use the image you've just created. Like so:

...
    marathon {
        imageName = "marathonwithcallback"
        imageTag = "v0.15.3"

        app {
            marathonJson = "https://raw.githubusercontent.com/ContainerSolutions/minimesos/e2a43362f4581122762c80d8780d09b567783f1a/apps/weave-scope.json"
        }
    }
...

This will make minimesos start the cluster with your new Marathon image that includes the arguments. It works, but it isn't as portable. Anyone else who wants to use this miniMesos file would have to have the same custom image installed locally. Of course you could solve this by pushing that image to the docker hub/in-house repo or something. But it'd be much easier if the Marathon block in the miniMesos file included an "arguments" option.

frankscholten commented 7 years ago

@mannickutd @mdirkse Good to know you are interested in this feature.

It's not that difficult to add new configuration to the marathon block. See the MesosMasterConfig groovy class. It's a matter of adding fields + setters and making sure that config gets applied to the MarathonContainer class.

Are you up for a PR?