You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/05/18 15:34:41 UTC

mesos git commit: Updated the outdated network isolator configure flag.

Repository: mesos
Updated Branches:
  refs/heads/master 8c564db51 -> 20dee4190


Updated the outdated network isolator configure flag.

This patch updated the outdated network isolator configure flag to
more descriptive port mapping isolator.

Review: https://reviews.apache.org/r/59193/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/20dee419
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/20dee419
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/20dee419

Branch: refs/heads/master
Commit: 20dee4190838b5bc7eb9cb524af413e3fe3fe082
Parents: 8c564db
Author: Tim Hansen <ti...@verizon.com>
Authored: Wed May 17 14:47:59 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu May 18 08:33:54 2017 -0700

----------------------------------------------------------------------
 configure.ac                                    | 18 +++++++++++-------
 src/Makefile.am                                 |  6 +++---
 src/master/flags.cpp                            |  4 ++--
 src/master/flags.hpp                            |  4 ++--
 src/master/master.cpp                           |  4 ++--
 src/slave/constants.hpp                         |  2 +-
 src/slave/containerizer/mesos/containerizer.cpp |  4 ++--
 src/slave/flags.cpp                             |  4 ++--
 src/slave/flags.hpp                             |  2 +-
 src/tests/environment.cpp                       |  8 ++++----
 src/tests/master_tests.cpp                      |  4 ++--
 src/tests/mesos.cpp                             |  6 +++---
 12 files changed, 35 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 8c17307..d523670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,6 +187,11 @@ AC_ARG_ENABLE([debug],
                               option won't change them]),
               [], [enable_debug=no])
 
+AC_ARG_ENABLE([port-mapping-isolator],
+              AS_HELP_STRING([--enable-port-mapping-isolator],
+                             [enable port mapping isolator]),
+              [], [enable_port_mapping_isolator=yes])
+
 AC_ARG_ENABLE([java],
               AS_HELP_STRING([--disable-java],
                              [don't build Java bindings]),
@@ -334,12 +339,11 @@ AC_ARG_WITH([libprocess],
                            [specify where to locate the libprocess library]),
             [], [])
 
-# TODO(MESOS-4991): Since network-isolator is an optional feature, it should
-# be enabled with --enable-network-isolator.
 AC_ARG_WITH([network-isolator],
             AS_HELP_STRING([--with-network-isolator],
                            [builds the network isolator]),
-            [], [with_network_isolator=no])
+            [AC_MSG_WARN(["--with-network-isolator is being depreciated, please use --enable-port-mapping-isolator instead."])],
+            [enable_port_mapping_isolator=yes])
 
 AC_ARG_WITH([nl],
             AS_HELP_STRING([--with-nl=@<:@DIR@:>@],
@@ -1270,7 +1274,7 @@ AM_CONDITIONAL([WITH_BUNDLED_LIBPROCESS], [test "x$with_bundled_libprocess" = "x
 
 
 # Perform necessary configuration for network isolator.
-if test "x$with_network_isolator" = "xyes"; then
+if test "x$enable_port_mapping_isolator" = "xyes"; then
   if test -n "`echo $with_nl`"; then
     CPPFLAGS="-I${with_nl}/include/libnl3 $CPPFLAGS"
     LDFLAGS="-L${with_nl}/lib $LDFLAGS"
@@ -1342,11 +1346,11 @@ https://github.com/thom311/libnl/releases
 -------------------------------------------------------------------
   ])])
 
-  AC_DEFINE([WITH_NETWORK_ISOLATOR])
+  AC_DEFINE([ENABLE_PORT_MAPPING_ISOLATOR])
 fi
 
-AM_CONDITIONAL([WITH_NETWORK_ISOLATOR],
-               [test "x$with_network_isolator" = "xyes"])
+AM_CONDITIONAL([ENABLE_PORT_MAPPING_ISOLATOR],
+               [test "x$enable_port_mapping_isolator" = "xyes"])
 
 
 # If the user has asked not to include the bundled NVML headers for

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 434a00e..3e71393 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1299,7 +1299,7 @@ else
 EXTRA_DIST += $(MESOS_LINUX_FILES)
 endif
 
-if WITH_NETWORK_ISOLATOR
+if ENABLE_PORT_MAPPING_ISOLATOR
 libmesos_no_3rdparty_la_SOURCES += $(MESOS_NETWORK_ISOLATOR_FILES)
 else
 EXTRA_DIST += $(MESOS_NETWORK_ISOLATOR_FILES)
@@ -1525,7 +1525,7 @@ mesos_io_switchboard_SOURCES =	\
 mesos_io_switchboard_CPPFLAGS = $(MESOS_CPPFLAGS)
 mesos_io_switchboard_LDADD = libmesos.la $(LDADD)
 
-if WITH_NETWORK_ISOLATOR
+if ENABLE_PORT_MAPPING_ISOLATOR
 pkglibexec_PROGRAMS += mesos-network-helper
 mesos_network_helper_SOURCES = slave/containerizer/mesos/isolators/network/helper.cpp
 mesos_network_helper_CPPFLAGS = $(MESOS_CPPFLAGS)
@@ -2407,7 +2407,7 @@ mesos_tests_SOURCES +=						\
   tests/containerizer/volume_image_isolator_tests.cpp
 endif
 
-if WITH_NETWORK_ISOLATOR
+if ENABLE_PORT_MAPPING_ISOLATOR
 mesos_tests_SOURCES +=						\
   tests/containerizer/port_mapping_tests.cpp			\
   tests/containerizer/routing_tests.cpp

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/flags.cpp
----------------------------------------------------------------------
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index b5660e4..b1c0886 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -359,7 +359,7 @@ mesos::internal::master::Flags::Flags()
       "  \"aggregate_default_qps\": 33.3\n"
       "}");
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
   add(&Flags::max_executors_per_agent,
       "max_executors_per_agent",
       flags::DeprecatedName("max_executors_per_slave"),
@@ -367,7 +367,7 @@ mesos::internal::master::Flags::Flags()
       "monitoring/isolation technique imposes an implicit resource\n"
       "acquisition on each executor (# ephemeral ports), as a result\n"
       "one can only run a certain number of executors on each agent.");
-#endif // WITH_NETWORK_ISOLATOR
+#endif // ENABLE_PORT_MAPPING_ISOLATOR
 
   // TODO(karya): When we have optimistic offers, this will only
   // benefit frameworks that accidentally lose an offer.

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/flags.hpp
----------------------------------------------------------------------
diff --git a/src/master/flags.hpp b/src/master/flags.hpp
index 9336a50..93ca9b9 100644
--- a/src/master/flags.hpp
+++ b/src/master/flags.hpp
@@ -110,9 +110,9 @@ public:
   // If set, its output is expected to be a valid parseable IP string.
   Option<std::string> ip_discovery_command;
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
   Option<size_t> max_executors_per_agent;
-#endif  // WITH_NETWORK_ISOLATOR
+#endif  // ENABLE_PORT_MAPPING_ISOLATOR
 };
 
 } // namespace master {

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 4e7a161..02affe2 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -7203,7 +7203,7 @@ void Master::offer(
         continue;
       }
 
-  #ifdef WITH_NETWORK_ISOLATOR
+  #ifdef ENABLE_PORT_MAPPING_ISOLATOR
       // TODO(dhamon): This flag is required as the static allocation of
       // ephemeral ports leads to a maximum number of containers that can
       // be created on each slave. Once MESOS-1654 is fixed and ephemeral
@@ -7225,7 +7225,7 @@ void Master::offer(
           continue;
         }
       }
-  #endif // WITH_NETWORK_ISOLATOR
+  #endif // ENABLE_PORT_MAPPING_ISOLATOR
 
       // TODO(vinod): Split regular and revocable resources into
       // separate offers, so that rescinding offers with revocable

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/constants.hpp
----------------------------------------------------------------------
diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
index ef978d6..9c1d724 100644
--- a/src/slave/constants.hpp
+++ b/src/slave/constants.hpp
@@ -95,7 +95,7 @@ constexpr double DEFAULT_EXECUTOR_CPUS = 0.1;
 // Default memory resource given to a command executor.
 constexpr Bytes DEFAULT_EXECUTOR_MEM = Megabytes(32);
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 // Default number of ephemeral ports allocated to a container by the
 // network isolator.
 constexpr uint16_t DEFAULT_EPHEMERAL_PORTS_PER_CONTAINER = 1024;

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 97837c8..50a63b5 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -93,7 +93,7 @@
 #include "slave/containerizer/mesos/isolators/volume/image.hpp"
 #endif // __linux__
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 #include "slave/containerizer/mesos/isolators/network/port_mapping.hpp"
 #endif
 
@@ -347,7 +347,7 @@ Try<MesosContainerizer*> MesosContainerizer::create(
     {"network/cni", &NetworkCniIsolatorProcess::create},
 #endif // __linux__
     // NOTE: Network isolation is currently not supported on Windows builds.
-#if !defined(__WINDOWS__) && defined(WITH_NETWORK_ISOLATOR)
+#if !defined(__WINDOWS__) && defined(ENABLE_PORT_MAPPING_ISOLATOR)
     {"network/port_mapping", &PortMappingIsolatorProcess::create},
 #endif
   };

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index bc63a6a..e172aa5 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -738,7 +738,7 @@ mesos::internal::slave::Flags::Flags()
       "policy instead.",
       Seconds(0));
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
   add(&Flags::ephemeral_ports_per_container,
       "ephemeral_ports_per_container",
       "Number of ephemeral ports allocated to a container by the network\n"
@@ -802,7 +802,7 @@ mesos::internal::slave::Flags::Flags()
       "isolator.",
       false);
 
-#endif // WITH_NETWORK_ISOLATOR
+#endif // ENABLE_PORT_MAPPING_ISOLATOR
 
   add(&Flags::network_cni_plugins_dir,
       "network_cni_plugins_dir",

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/flags.hpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.hpp b/src/slave/flags.hpp
index e5784ef..28f6482 100644
--- a/src/slave/flags.hpp
+++ b/src/slave/flags.hpp
@@ -127,7 +127,7 @@ public:
   std::string docker_socket;
   Option<JSON::Object> docker_config;
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
   uint16_t ephemeral_ports_per_container;
   Option<std::string> eth0_name;
   Option<std::string> lo_name;

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index 047798c..280b2ca 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -57,7 +57,7 @@
 #include "linux/perf.hpp"
 #endif
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 #include "linux/routing/utils.hpp"
 #endif
 
@@ -67,7 +67,7 @@
 #include "tests/flags.hpp"
 #include "tests/utils.hpp"
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 using namespace routing;
 #endif
 
@@ -434,7 +434,7 @@ class NetworkIsolatorTestFilter : public TestFilter
 public:
   NetworkIsolatorTestFilter()
   {
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
     Try<Nothing> check = routing::check();
     if (check.isError()) {
       std::cerr
@@ -452,7 +452,7 @@ public:
   {
     if (matches(test, "PortMappingIsolatorTest") ||
         matches(test, "PortMappingMesosTest")) {
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
       return !portMappingError.isNone();
 #else
       return true;

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 37a5413..97d8283 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -3545,7 +3545,7 @@ TEST_F(MasterTest, IgnoreEphemeralPortsResource)
 }
 
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 TEST_F(MasterTest, MaxExecutorsPerSlave)
 {
   master::Flags flags = CreateMasterFlags();
@@ -3583,7 +3583,7 @@ TEST_F(MasterTest, MaxExecutorsPerSlave)
   driver.stop();
   driver.join();
 }
-#endif  // WITH_NETWORK_ISOLATOR
+#endif  // ENABLE_PORT_MAPPING_ISOLATOR
 
 
 // This test verifies that when the Framework has not responded to

http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index a79ec62..714a520 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -35,7 +35,7 @@
 #include "linux/cgroups.hpp"
 #endif
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 #include "linux/routing/utils.hpp"
 #endif
 
@@ -62,7 +62,7 @@ using testing::Invoke;
 
 using namespace process;
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
 using namespace routing;
 #endif
 
@@ -611,7 +611,7 @@ slave::Flags ContainerizerTest<slave::MesosContainerizer>::CreateSlaveFlags()
   flags.isolation = "posix/cpu,posix/mem";
 #endif
 
-#ifdef WITH_NETWORK_ISOLATOR
+#ifdef ENABLE_PORT_MAPPING_ISOLATOR
   if (user.get() == "root" && routing::check().isSome()) {
     flags.isolation = strings::join(
         ",",


Re: mesos git commit: Updated the outdated network isolator configure flag.

Posted by Neil Conway <ne...@gmail.com>.
This commit enables the port mapping isolator by default. Was that
intended? Among other things, it breaks the build on OSX:

$ ../mesos/configure --disable-java --disable-python
[...]
configure: error: cannot build network isolator
-------------------------------------------------------------------
Network isolator is only supported on Linux!
-------------------------------------------------------------------

Neil

On Thu, May 18, 2017 at 8:34 AM,  <ji...@apache.org> wrote:
> Repository: mesos
> Updated Branches:
>   refs/heads/master 8c564db51 -> 20dee4190
>
>
> Updated the outdated network isolator configure flag.
>
> This patch updated the outdated network isolator configure flag to
> more descriptive port mapping isolator.
>
> Review: https://reviews.apache.org/r/59193/
>
>
> Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
> Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/20dee419
> Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/20dee419
> Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/20dee419
>
> Branch: refs/heads/master
> Commit: 20dee4190838b5bc7eb9cb524af413e3fe3fe082
> Parents: 8c564db
> Author: Tim Hansen <ti...@verizon.com>
> Authored: Wed May 17 14:47:59 2017 -0700
> Committer: Jie Yu <yu...@gmail.com>
> Committed: Thu May 18 08:33:54 2017 -0700
>
> ----------------------------------------------------------------------
>  configure.ac                                    | 18 +++++++++++-------
>  src/Makefile.am                                 |  6 +++---
>  src/master/flags.cpp                            |  4 ++--
>  src/master/flags.hpp                            |  4 ++--
>  src/master/master.cpp                           |  4 ++--
>  src/slave/constants.hpp                         |  2 +-
>  src/slave/containerizer/mesos/containerizer.cpp |  4 ++--
>  src/slave/flags.cpp                             |  4 ++--
>  src/slave/flags.hpp                             |  2 +-
>  src/tests/environment.cpp                       |  8 ++++----
>  src/tests/master_tests.cpp                      |  4 ++--
>  src/tests/mesos.cpp                             |  6 +++---
>  12 files changed, 35 insertions(+), 31 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/configure.ac
> ----------------------------------------------------------------------
> diff --git a/configure.ac b/configure.ac
> index 8c17307..d523670 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -187,6 +187,11 @@ AC_ARG_ENABLE([debug],
>                                option won't change them]),
>                [], [enable_debug=no])
>
> +AC_ARG_ENABLE([port-mapping-isolator],
> +              AS_HELP_STRING([--enable-port-mapping-isolator],
> +                             [enable port mapping isolator]),
> +              [], [enable_port_mapping_isolator=yes])
> +
>  AC_ARG_ENABLE([java],
>                AS_HELP_STRING([--disable-java],
>                               [don't build Java bindings]),
> @@ -334,12 +339,11 @@ AC_ARG_WITH([libprocess],
>                             [specify where to locate the libprocess library]),
>              [], [])
>
> -# TODO(MESOS-4991): Since network-isolator is an optional feature, it should
> -# be enabled with --enable-network-isolator.
>  AC_ARG_WITH([network-isolator],
>              AS_HELP_STRING([--with-network-isolator],
>                             [builds the network isolator]),
> -            [], [with_network_isolator=no])
> +            [AC_MSG_WARN(["--with-network-isolator is being depreciated, please use --enable-port-mapping-isolator instead."])],
> +            [enable_port_mapping_isolator=yes])
>
>  AC_ARG_WITH([nl],
>              AS_HELP_STRING([--with-nl=@<:@DIR@:>@],
> @@ -1270,7 +1274,7 @@ AM_CONDITIONAL([WITH_BUNDLED_LIBPROCESS], [test "x$with_bundled_libprocess" = "x
>
>
>  # Perform necessary configuration for network isolator.
> -if test "x$with_network_isolator" = "xyes"; then
> +if test "x$enable_port_mapping_isolator" = "xyes"; then
>    if test -n "`echo $with_nl`"; then
>      CPPFLAGS="-I${with_nl}/include/libnl3 $CPPFLAGS"
>      LDFLAGS="-L${with_nl}/lib $LDFLAGS"
> @@ -1342,11 +1346,11 @@ https://github.com/thom311/libnl/releases
>  -------------------------------------------------------------------
>    ])])
>
> -  AC_DEFINE([WITH_NETWORK_ISOLATOR])
> +  AC_DEFINE([ENABLE_PORT_MAPPING_ISOLATOR])
>  fi
>
> -AM_CONDITIONAL([WITH_NETWORK_ISOLATOR],
> -               [test "x$with_network_isolator" = "xyes"])
> +AM_CONDITIONAL([ENABLE_PORT_MAPPING_ISOLATOR],
> +               [test "x$enable_port_mapping_isolator" = "xyes"])
>
>
>  # If the user has asked not to include the bundled NVML headers for
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/Makefile.am
> ----------------------------------------------------------------------
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 434a00e..3e71393 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1299,7 +1299,7 @@ else
>  EXTRA_DIST += $(MESOS_LINUX_FILES)
>  endif
>
> -if WITH_NETWORK_ISOLATOR
> +if ENABLE_PORT_MAPPING_ISOLATOR
>  libmesos_no_3rdparty_la_SOURCES += $(MESOS_NETWORK_ISOLATOR_FILES)
>  else
>  EXTRA_DIST += $(MESOS_NETWORK_ISOLATOR_FILES)
> @@ -1525,7 +1525,7 @@ mesos_io_switchboard_SOURCES =    \
>  mesos_io_switchboard_CPPFLAGS = $(MESOS_CPPFLAGS)
>  mesos_io_switchboard_LDADD = libmesos.la $(LDADD)
>
> -if WITH_NETWORK_ISOLATOR
> +if ENABLE_PORT_MAPPING_ISOLATOR
>  pkglibexec_PROGRAMS += mesos-network-helper
>  mesos_network_helper_SOURCES = slave/containerizer/mesos/isolators/network/helper.cpp
>  mesos_network_helper_CPPFLAGS = $(MESOS_CPPFLAGS)
> @@ -2407,7 +2407,7 @@ mesos_tests_SOURCES +=                                            \
>    tests/containerizer/volume_image_isolator_tests.cpp
>  endif
>
> -if WITH_NETWORK_ISOLATOR
> +if ENABLE_PORT_MAPPING_ISOLATOR
>  mesos_tests_SOURCES +=                                         \
>    tests/containerizer/port_mapping_tests.cpp                   \
>    tests/containerizer/routing_tests.cpp
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/flags.cpp
> ----------------------------------------------------------------------
> diff --git a/src/master/flags.cpp b/src/master/flags.cpp
> index b5660e4..b1c0886 100644
> --- a/src/master/flags.cpp
> +++ b/src/master/flags.cpp
> @@ -359,7 +359,7 @@ mesos::internal::master::Flags::Flags()
>        "  \"aggregate_default_qps\": 33.3\n"
>        "}");
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>    add(&Flags::max_executors_per_agent,
>        "max_executors_per_agent",
>        flags::DeprecatedName("max_executors_per_slave"),
> @@ -367,7 +367,7 @@ mesos::internal::master::Flags::Flags()
>        "monitoring/isolation technique imposes an implicit resource\n"
>        "acquisition on each executor (# ephemeral ports), as a result\n"
>        "one can only run a certain number of executors on each agent.");
> -#endif // WITH_NETWORK_ISOLATOR
> +#endif // ENABLE_PORT_MAPPING_ISOLATOR
>
>    // TODO(karya): When we have optimistic offers, this will only
>    // benefit frameworks that accidentally lose an offer.
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/flags.hpp
> ----------------------------------------------------------------------
> diff --git a/src/master/flags.hpp b/src/master/flags.hpp
> index 9336a50..93ca9b9 100644
> --- a/src/master/flags.hpp
> +++ b/src/master/flags.hpp
> @@ -110,9 +110,9 @@ public:
>    // If set, its output is expected to be a valid parseable IP string.
>    Option<std::string> ip_discovery_command;
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>    Option<size_t> max_executors_per_agent;
> -#endif  // WITH_NETWORK_ISOLATOR
> +#endif  // ENABLE_PORT_MAPPING_ISOLATOR
>  };
>
>  } // namespace master {
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/master/master.cpp
> ----------------------------------------------------------------------
> diff --git a/src/master/master.cpp b/src/master/master.cpp
> index 4e7a161..02affe2 100644
> --- a/src/master/master.cpp
> +++ b/src/master/master.cpp
> @@ -7203,7 +7203,7 @@ void Master::offer(
>          continue;
>        }
>
> -  #ifdef WITH_NETWORK_ISOLATOR
> +  #ifdef ENABLE_PORT_MAPPING_ISOLATOR
>        // TODO(dhamon): This flag is required as the static allocation of
>        // ephemeral ports leads to a maximum number of containers that can
>        // be created on each slave. Once MESOS-1654 is fixed and ephemeral
> @@ -7225,7 +7225,7 @@ void Master::offer(
>            continue;
>          }
>        }
> -  #endif // WITH_NETWORK_ISOLATOR
> +  #endif // ENABLE_PORT_MAPPING_ISOLATOR
>
>        // TODO(vinod): Split regular and revocable resources into
>        // separate offers, so that rescinding offers with revocable
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/constants.hpp
> ----------------------------------------------------------------------
> diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
> index ef978d6..9c1d724 100644
> --- a/src/slave/constants.hpp
> +++ b/src/slave/constants.hpp
> @@ -95,7 +95,7 @@ constexpr double DEFAULT_EXECUTOR_CPUS = 0.1;
>  // Default memory resource given to a command executor.
>  constexpr Bytes DEFAULT_EXECUTOR_MEM = Megabytes(32);
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  // Default number of ephemeral ports allocated to a container by the
>  // network isolator.
>  constexpr uint16_t DEFAULT_EPHEMERAL_PORTS_PER_CONTAINER = 1024;
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/containerizer/mesos/containerizer.cpp
> ----------------------------------------------------------------------
> diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
> index 97837c8..50a63b5 100644
> --- a/src/slave/containerizer/mesos/containerizer.cpp
> +++ b/src/slave/containerizer/mesos/containerizer.cpp
> @@ -93,7 +93,7 @@
>  #include "slave/containerizer/mesos/isolators/volume/image.hpp"
>  #endif // __linux__
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  #include "slave/containerizer/mesos/isolators/network/port_mapping.hpp"
>  #endif
>
> @@ -347,7 +347,7 @@ Try<MesosContainerizer*> MesosContainerizer::create(
>      {"network/cni", &NetworkCniIsolatorProcess::create},
>  #endif // __linux__
>      // NOTE: Network isolation is currently not supported on Windows builds.
> -#if !defined(__WINDOWS__) && defined(WITH_NETWORK_ISOLATOR)
> +#if !defined(__WINDOWS__) && defined(ENABLE_PORT_MAPPING_ISOLATOR)
>      {"network/port_mapping", &PortMappingIsolatorProcess::create},
>  #endif
>    };
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/flags.cpp
> ----------------------------------------------------------------------
> diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
> index bc63a6a..e172aa5 100644
> --- a/src/slave/flags.cpp
> +++ b/src/slave/flags.cpp
> @@ -738,7 +738,7 @@ mesos::internal::slave::Flags::Flags()
>        "policy instead.",
>        Seconds(0));
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>    add(&Flags::ephemeral_ports_per_container,
>        "ephemeral_ports_per_container",
>        "Number of ephemeral ports allocated to a container by the network\n"
> @@ -802,7 +802,7 @@ mesos::internal::slave::Flags::Flags()
>        "isolator.",
>        false);
>
> -#endif // WITH_NETWORK_ISOLATOR
> +#endif // ENABLE_PORT_MAPPING_ISOLATOR
>
>    add(&Flags::network_cni_plugins_dir,
>        "network_cni_plugins_dir",
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/slave/flags.hpp
> ----------------------------------------------------------------------
> diff --git a/src/slave/flags.hpp b/src/slave/flags.hpp
> index e5784ef..28f6482 100644
> --- a/src/slave/flags.hpp
> +++ b/src/slave/flags.hpp
> @@ -127,7 +127,7 @@ public:
>    std::string docker_socket;
>    Option<JSON::Object> docker_config;
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>    uint16_t ephemeral_ports_per_container;
>    Option<std::string> eth0_name;
>    Option<std::string> lo_name;
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/environment.cpp
> ----------------------------------------------------------------------
> diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
> index 047798c..280b2ca 100644
> --- a/src/tests/environment.cpp
> +++ b/src/tests/environment.cpp
> @@ -57,7 +57,7 @@
>  #include "linux/perf.hpp"
>  #endif
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  #include "linux/routing/utils.hpp"
>  #endif
>
> @@ -67,7 +67,7 @@
>  #include "tests/flags.hpp"
>  #include "tests/utils.hpp"
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  using namespace routing;
>  #endif
>
> @@ -434,7 +434,7 @@ class NetworkIsolatorTestFilter : public TestFilter
>  public:
>    NetworkIsolatorTestFilter()
>    {
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>      Try<Nothing> check = routing::check();
>      if (check.isError()) {
>        std::cerr
> @@ -452,7 +452,7 @@ public:
>    {
>      if (matches(test, "PortMappingIsolatorTest") ||
>          matches(test, "PortMappingMesosTest")) {
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>        return !portMappingError.isNone();
>  #else
>        return true;
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/master_tests.cpp
> ----------------------------------------------------------------------
> diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
> index 37a5413..97d8283 100644
> --- a/src/tests/master_tests.cpp
> +++ b/src/tests/master_tests.cpp
> @@ -3545,7 +3545,7 @@ TEST_F(MasterTest, IgnoreEphemeralPortsResource)
>  }
>
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  TEST_F(MasterTest, MaxExecutorsPerSlave)
>  {
>    master::Flags flags = CreateMasterFlags();
> @@ -3583,7 +3583,7 @@ TEST_F(MasterTest, MaxExecutorsPerSlave)
>    driver.stop();
>    driver.join();
>  }
> -#endif  // WITH_NETWORK_ISOLATOR
> +#endif  // ENABLE_PORT_MAPPING_ISOLATOR
>
>
>  // This test verifies that when the Framework has not responded to
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/20dee419/src/tests/mesos.cpp
> ----------------------------------------------------------------------
> diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
> index a79ec62..714a520 100644
> --- a/src/tests/mesos.cpp
> +++ b/src/tests/mesos.cpp
> @@ -35,7 +35,7 @@
>  #include "linux/cgroups.hpp"
>  #endif
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  #include "linux/routing/utils.hpp"
>  #endif
>
> @@ -62,7 +62,7 @@ using testing::Invoke;
>
>  using namespace process;
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>  using namespace routing;
>  #endif
>
> @@ -611,7 +611,7 @@ slave::Flags ContainerizerTest<slave::MesosContainerizer>::CreateSlaveFlags()
>    flags.isolation = "posix/cpu,posix/mem";
>  #endif
>
> -#ifdef WITH_NETWORK_ISOLATOR
> +#ifdef ENABLE_PORT_MAPPING_ISOLATOR
>    if (user.get() == "root" && routing::check().isSome()) {
>      flags.isolation = strings::join(
>          ",",
>