You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 10:49:24 UTC

svn commit: r1132136 - in /incubator/mesos/trunk/src: Makefile.in conf/deploy-env.sh.template deploy/mesos-env.sh

Author: benh
Date: Sun Jun  5 08:49:24 2011
New Revision: 1132136

URL: http://svn.apache.org/viewvc?rev=1132136&view=rev
Log:
Added a deploy-env.sh file in the conf directory for setting up any
environment variables to be used by the deploy scripts. The previous
model was to have users edit the deploy/mesos-env.sh file, but this is
troublesome because this file gets overwritten with the contents of
src/deploy/mesos-env.sh whenevery you build Mesos. With the current
change, the deploy directory contains only "executables" that should not
be changed by the user, and all configuration can be done through the
conf directory (where make will not overwrite existing files).

Added:
    incubator/mesos/trunk/src/conf/deploy-env.sh.template   (with props)
Modified:
    incubator/mesos/trunk/src/Makefile.in
    incubator/mesos/trunk/src/deploy/mesos-env.sh

Modified: incubator/mesos/trunk/src/Makefile.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/Makefile.in?rev=1132136&r1=1132135&r2=1132136&view=diff
==============================================================================
--- incubator/mesos/trunk/src/Makefile.in (original)
+++ incubator/mesos/trunk/src/Makefile.in Sun Jun  5 08:49:24 2011
@@ -213,7 +213,7 @@ WEBUI_FILES = $(BINDIR)/webui/bottle-0.8
               $(BINDIR)/webui/static/stylesheet.css
 
 # We copy template config files into the conf directory.
-CONF_FILES = $(CONFDIR)/mesos.conf
+CONF_FILES = $(CONFDIR)/mesos.conf $(CONFDIR)/deploy-env.sh
 
 # We copy all the deploy scripts into the bin directory.
 DEPLOY_FILES = $(DEPLOYDIR)/deploy-to-slaves             \
@@ -346,6 +346,9 @@ $(DEPLOY_FILES): $(DEPLOYDIR)/%: @srcdir
 $(CONFDIR)/mesos.conf: | @srcdir@/conf/mesos.conf.template $(CONFDIR)
 	cp -r @srcdir@/conf/mesos.conf.template $@
 
+$(CONFDIR)/deploy-env.sh: | ./conf/deploy-env.sh.template $(CONFDIR)
+	cp -r ./conf/deploy-env.sh.template $@
+
 test: all
 	$(MAKE) -C tests test
 

Added: incubator/mesos/trunk/src/conf/deploy-env.sh.template
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/conf/deploy-env.sh.template?rev=1132136&view=auto
==============================================================================
--- incubator/mesos/trunk/src/conf/deploy-env.sh.template (added)
+++ incubator/mesos/trunk/src/conf/deploy-env.sh.template Sun Jun  5 08:49:24 2011
@@ -0,0 +1,14 @@
+#!/bin/bash
+# This file contains environment variables that should be set when starting a Mesos
+# daemon (master or slave) with the deploy scripts. It can be used to configure SSH
+# options or set which IP addresses the daemons should bind to, for example.
+
+# Options for SSH
+SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=2"
+
+# Set LIBPROCESS_IP to change the address to which the master and slaves bind
+# if the default address chosen by the system is not the right one. We include
+# two examples below that try to resolve the IP from the node's hostname.
+#LIBPROCESS_IP="hostname -i" #works on older versions of hostname, not on OS X
+#FULL_IP="hostname --all-ip-addresses" # newer versions of hostname only
+#export LIBPROCESS_IP=`echo $FULL_IP|sed 's/\([^ ]*\) .*/\1/'`

Propchange: incubator/mesos/trunk/src/conf/deploy-env.sh.template
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/mesos/trunk/src/deploy/mesos-env.sh
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-env.sh?rev=1132136&r1=1132135&r2=1132136&view=diff
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-env.sh (original)
+++ incubator/mesos/trunk/src/deploy/mesos-env.sh Sun Jun  5 08:49:24 2011
@@ -35,12 +35,8 @@ fi
 # slave daemons as sudo.
 DEPLOY_WITH_SUDO=`$MESOS_HOME/bin/mesos-getconf deploy_with_sudo`
 
-# Options for SSH
-SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=2"
-
-# Set LIBPROCESS_IP to change the address to which the master and slaves bind
-# if the default address chosen by the system is not the right one. We include
-# two examples below that try to resolve the IP from the node's hostname.
-#LIBPROCESS_IP="hostname -i" #works on older versions of hostname, not on OS X
-#FULL_IP="hostname --all-ip-addresses" # newer versions of hostname only
-#export LIBPROCESS_IP=`echo $FULL_IP|sed 's/\([^ ]*\) .*/\1/'`
+# Read any user-configurable environment variables set in the deploy-env.sh file
+# in MESOS_HOME/conf, such as SSH options.
+if [ -e $MESOS_HOME/conf/deploy-env.sh ]; then
+  . $MESOS_HOME/conf/deploy-env.sh
+fi