Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Read command line options from MARATHON_*. #475

Merged
merged 6 commits into from
Oct 10, 2014

Conversation

everpeace
Copy link
Contributor

Read command line options from MARATHON_* environment variables like meos-master/slave.

This could be very useful when you start marathon with docker. If we had a docker container in which marathon was installed and whose Dockerfile contains ENTRYPOINT ["/marathon-0.6.1/bin/start"], we can start marathon like this.

$ docker run \
    -e "MARATHON_master=zk://localhost:2181/mesos" \ 
    -e "MARATHON_zk=zk://localhost:2181/marathon" \
    marathon

However, I'm not a shell script expart, so I would be pleasure to have feedbacks.

@HelloGrayson
Copy link

+1

@HelloGrayson
Copy link

@everpeace it looks like mesos uses all caps for this, aka you should be doing something like so:

$ docker run \
    -e "MARATHON_MASTER=zk://localhost:2181/mesos" \ 
    -e "MARATHON_ZK=zk://localhost:2181/marathon" \
    marathon

@everpeace
Copy link
Contributor Author

@breerly thanks for your feedback. I pushed a commit supporting environment variables with all CAP like MARATHON_ZK.

@everpeace everpeace force-pushed the feature/read_env_var branch 2 times, most recently from fba2f03 to 69c8d79 Compare September 27, 2014 07:09
@ConnorDoyle ConnorDoyle modified the milestones: 0.7.2, 0.7.3 Sep 30, 2014
@ConnorDoyle
Copy link
Contributor

@everpeace Hi Shingo, sorry for the delay on this. I'd love to get this landed for 0.7.4 (scheduled for 10 October). Could you describe this change in the docs as well?

…meos-master/slave.

This could be very useful when you start marathon with docker.  If we had a docker container in which marathon was installed , we can start marathon like this.

```
$ docker run -e "MARATHON_master=zk://localhost:2181/mesos" -e "MARATHON_zk=zk://localhost:2181/marathon" marathon /marathon-0.6.1/bin/start
```
@everpeace
Copy link
Contributor Author

@ConnorDoyle Thanks for reviewing this. I rebased my branch and added

  • supporting env variable also in service script 'marathon-framework', and
  • paved 'command-line-flags.md' for this feature.

@@ -6,6 +6,8 @@ title: Command Line Flags

The following options can influence how Marathon works:

_All options can be also set by environment variable `MARATON_OPTION_NAME` (the option name with a `MARATHON_` prefix added to it), for example`MARATHON_MASTER` for `--master` option._

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also describe which setting takes precedence when both are supplied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should describe this. I will add this.

@everpeace
Copy link
Contributor Author

@ConnorDoyle I forgot pinging you.

@everpeace
Copy link
Contributor Author

@ConnorDoyle Thank you very much for your kind shepherding!

@ConnorDoyle
Copy link
Contributor

Thanks Shingo!

ConnorDoyle added a commit that referenced this pull request Oct 10, 2014
Read command line options from MARATHON_*.
@ConnorDoyle ConnorDoyle merged commit 1ebfdbd into d2iq-archive:master Oct 10, 2014
@everpeace everpeace deleted the feature/read_env_var branch October 11, 2014 01:43
@ConnorDoyle ConnorDoyle modified the milestones: 0.7.7, 0.7.6 Dec 1, 2014
@ConnorDoyle ConnorDoyle removed this from the 0.7.7 milestone Dec 1, 2014
@marcomonaco marcomonaco added the pr label Mar 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants