Closed bobrik closed 7 years ago
+1
There are actually all kinds of ports that Marathon can use. See this for a template using a port for HTTP, one for libprocess and one for HTTPS:
https://github.com/mesosphere/universe/blob/version-1.x/repo/packages/M/marathon/3/marathon.json
So its kind of hard to make a general useful image that already maps these environment variables to something useful.
Or am I wrong?
I only care about http port since it's used for service discovery and health checks. Making all of them work is an option as well.
Btw, using cmd
without exec
instead of env variables doesn't look like a good idea.
Hey @bobrik we are using MOM all the time - not exactly sure what is missing. But it would be great if you could provide a PR.
@aquamatthias are your running it on a well known port? We assign random ports and set nginx with zoidberg in front.
@bobrik no well known port. We use a proxy component which reads the framework info from mesos state.json and delegate to that host/port. That is probably the reason we don't see that problem...
It's a good time to remind about reading state.json: https://issues.apache.org/jira/browse/MESOS-3307
Continuing on the topic: can you show me your app config? I don't see how PORT
env variable propagates to --http_port
cli argument of Marathon.
@bobrik: this is the template that DCOS uses to start MOM: https://github.com/mesosphere/universe/blob/version-1.x/repo/packages/M/marathon/4/marathon.json
Ah, I see, you mess with cmd
. I don't want to touch cmd
since it rewrites entrypoint
for no reason and breaks container encapsulation. I want it to work outside of the box when I just rewrite some of env variables like I do now.
In your link you have cmd
line that is 4912 characters long. Instead of doing this, you could have several independent env variables that are much easier to understand. This would be even nicer with yaml, but that's another story (that we solved internally).
To better illustrate what I want, here's my ENTRYPOINT
script for marathon:
#!/bin/sh -e
# Ready to run on Marathon
export MARATHON_HTTP_PORT="${PORT}"
exec /marathon/bin/start
Point of this issue is to use stock marathon image that does the same thing. Does it make sense now?
We have quite a few ways of doing this now... marathon_extra_args, marathoncmd{option} etc. closing out.
@jasongilanfarr can you provide an example?
@jasongilanfarr I don't think we support this yet, see this comment from @bobrik:
Continuing on the topic: can you show me your app config? I don't see how PORT env variable propagates to --http_port cli argument of Marathon.
Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-2898. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8.
Let's pick up
PORT
andHOST
env variables if they are set. This make possible to run marathon on marathon without any wrapper scripts.I can make a PR if this sounds good.