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 2016/08/22 20:46:36 UTC
[07/12] mesos git commit: Renamed containerizer::Termination to
ContainerTermination.
Renamed containerizer::Termination to ContainerTermination.
`containerizer::Termination` is a legacy protobuf for external
containerizer. Since we already removed the external containerizer, this
patch renamed it to `ContainerTermination` and moved the definition to
`containerizer.proto`. This patch also moved all definitions in
`isolator.proto` to `containerizer.proto` to be more consistent.
Review: https://reviews.apache.org/r/51263/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c28846fb
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c28846fb
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c28846fb
Branch: refs/heads/master
Commit: c28846fbf12e1fcbe947c2ae2b9372015727e084
Parents: c4ce258
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Aug 22 13:00:25 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Aug 22 13:00:25 2016 -0700
----------------------------------------------------------------------
include/mesos/containerizer/containerizer.hpp | 23 ---
include/mesos/containerizer/containerizer.proto | 38 -----
include/mesos/slave/containerizer.hpp | 23 +++
include/mesos/slave/containerizer.proto | 159 +++++++++++++++++++
include/mesos/slave/isolator.hpp | 3 +-
include/mesos/slave/isolator.proto | 143 -----------------
src/CMakeLists.txt | 4 +-
src/Makefile.am | 41 +----
src/slave/containerizer/composing.cpp | 10 +-
src/slave/containerizer/composing.hpp | 6 +-
src/slave/containerizer/containerizer.hpp | 13 +-
src/slave/containerizer/docker.cpp | 36 +++--
src/slave/containerizer/docker.hpp | 6 +-
src/slave/containerizer/mesos/containerizer.cpp | 16 +-
src/slave/containerizer/mesos/containerizer.hpp | 6 +-
src/slave/slave.cpp | 19 +--
src/slave/slave.hpp | 6 +-
src/tests/cluster.cpp | 4 +-
src/tests/containerizer.cpp | 13 +-
src/tests/containerizer.hpp | 8 +-
.../composing_containerizer_tests.cpp | 4 +-
.../docker_containerizer_tests.cpp | 27 ++--
.../containerizer/filesystem_isolator_tests.cpp | 54 ++-----
src/tests/containerizer/isolator_tests.cpp | 6 +-
.../containerizer/mesos_containerizer_tests.cpp | 41 ++---
src/tests/containerizer/port_mapping_tests.cpp | 4 +-
src/tests/health_check_tests.cpp | 5 +-
src/tests/hook_tests.cpp | 8 +-
src/tests/slave_recovery_tests.cpp | 16 +-
29 files changed, 333 insertions(+), 409 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/containerizer/containerizer.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/containerizer/containerizer.hpp b/include/mesos/containerizer/containerizer.hpp
deleted file mode 100644
index 01b1bfa..0000000
--- a/include/mesos/containerizer/containerizer.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __CONTAINERIZER_PROTO_HPP__
-#define __CONTAINERIZER_PROTO_HPP__
-
-// ONLY USEFUL AFTER RUNNING PROTOC.
-#include <mesos/containerizer/containerizer.pb.h>
-
-#endif // __CONTAINERIZER_PROTO_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/containerizer/containerizer.proto
----------------------------------------------------------------------
diff --git a/include/mesos/containerizer/containerizer.proto b/include/mesos/containerizer/containerizer.proto
deleted file mode 100644
index 7c35ef3..0000000
--- a/include/mesos/containerizer/containerizer.proto
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import "mesos/mesos.proto";
-
-package mesos.containerizer;
-
-option java_package = "org.apache.mesos.containerizer";
-option java_outer_classname = "Protos";
-
-
-/**
- * Information about a container termination, returned by the
- * containerizer to the slave.
- */
-message Termination {
- // Exit status of the process.
- optional int32 status = 3;
-
- // The 'state', 'reasons' and 'message' of a status update for
- // non-terminal tasks when the executor is terminated.
- optional TaskState state = 4;
- repeated TaskStatus.Reason reasons = 5;
- optional string message = 2;
-}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/slave/containerizer.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/slave/containerizer.hpp b/include/mesos/slave/containerizer.hpp
new file mode 100644
index 0000000..d0096b9
--- /dev/null
+++ b/include/mesos/slave/containerizer.hpp
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __MESOS_SLAVE_CONTAINERIZER_HPP__
+#define __MESOS_SLAVE_CONTAINERIZER_HPP__
+
+// ONLY USEFUL AFTER RUNNING PROTOC.
+#include <mesos/slave/containerizer.pb.h>
+
+#endif // __MESOS_SLAVE_CONTAINERIZER_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/slave/containerizer.proto
----------------------------------------------------------------------
diff --git a/include/mesos/slave/containerizer.proto b/include/mesos/slave/containerizer.proto
new file mode 100644
index 0000000..16dd3a1
--- /dev/null
+++ b/include/mesos/slave/containerizer.proto
@@ -0,0 +1,159 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mesos.slave;
+
+import "mesos/mesos.proto";
+
+import "mesos/appc/spec.proto";
+
+import "mesos/docker/v1.proto";
+
+/**
+ * Information when an executor is impacted by a resource limitation
+ * and should be terminated. Intended to support resources like memory
+ * where the Linux kernel may invoke the OOM killer, killing some/all
+ * of a container's processes.
+ */
+message ContainerLimitation {
+ // Resources that triggered the limitation.
+ // NOTE: 'Resources' is used here because the resource may span
+ // multiple roles (e.g. `"mem(*):1;mem(role):2"`).
+ repeated Resource resources = 1;
+
+ // Description of the limitation.
+ optional string message = 2;
+
+ // The container will be terminated when a resource limitation is
+ // reached. This field specifies the 'reason' that will be sent in
+ // the status update for any remaining non-terminal tasks when the
+ // container is terminated.
+ optional TaskStatus.Reason reason = 3;
+}
+
+
+/**
+ * This message is derived from slave::state::RunState. It contains
+ * only those fields that are needed by Isolators for recovering the
+ * containers. The reason for not using RunState instead is to avoid
+ * any dependency on RunState and in turn on internal protobufs.
+ */
+message ContainerState {
+ required ExecutorInfo executor_info = 1;
+
+ // Container id of the last executor run.
+ required ContainerID container_id = 2;
+
+ required uint64 pid = 3; // Executor pid.
+ required string directory = 4; // Executor work directory.
+}
+
+
+/**
+ * The container configuration that will be passed to each isolator
+ * during `prepare`.
+ */
+message ContainerConfig {
+ // The executor associated with this container.
+ required ExecutorInfo executor_info = 8;
+
+ // The task (optional) associated with this container.
+ optional TaskInfo task_info = 9;
+
+ // The command used to launch the container.
+ required CommandInfo command_info = 11;
+
+ // The information about the container.
+ optional ContainerInfo container_info = 12;
+
+ // Resources associated with the container during launch.
+ repeated Resource resources = 13;
+
+ // The work directory for the container in the host filesystem.
+ required string directory = 3;
+
+ // The user the task will be run as.
+ optional string user = 4;
+
+ // NOTE: 'rootfs' and 'docker' below are for the executor in custom
+ // executor case, and they are for the task in command task case.
+
+ // The root filesystem for the container.
+ optional string rootfs = 5;
+
+ // Docker v1 image manifest.
+ message Docker {
+ optional docker.spec.v1.ImageManifest manifest = 1;
+ }
+
+ optional Docker docker = 7;
+
+ message Appc {
+ optional appc.spec.ImageManifest manifest = 1;
+ }
+
+ optional Appc appc = 10;
+}
+
+
+/**
+ * Protobuf returned by Isolator::prepare(). The command is executed
+ * by the Launcher in the containerized context.
+ * Note: Currently, any URIs or Environment in the CommandInfo will be
+ * ignored; only the command value is used. Further, we only accept
+ * shell commands for the preparation commands.
+ */
+message ContainerLaunchInfo {
+ // The additional preparation commands to execute before
+ // executing the command.
+ repeated CommandInfo pre_exec_commands = 1;
+ optional Environment environment = 2;
+
+ // The root filesystem for the container.
+ //
+ // This field is not used since 0.28, and it is deprecated
+ // since 1.0.1.
+ optional string rootfs = 3 [deprecated = true]; // Since 1.0.1.
+
+ // (Linux only) The namespaces required for the container.
+ // The namespaces are created while launching the executor.
+ optional uint32 namespaces = 4 [default = 0];
+
+ // If specified, it'll become the launch command for the custom
+ // executor, or the launch command for the user task in the case of
+ // a command task.
+ optional CommandInfo command = 5;
+
+ // The working directory for the container.
+ // NOTE: This is different than Mesos sandbox.
+ optional string working_directory = 6;
+}
+
+
+/**
+ * Information about a container termination, returned by the
+ * containerizer to the slave.
+ */
+message ContainerTermination {
+ // Exit status of the process.
+ optional int32 status = 3;
+
+ // The 'state', 'reasons' and 'message' of a status update for
+ // non-terminal tasks when the executor is terminated.
+ optional TaskState state = 4;
+ repeated TaskStatus.Reason reasons = 5;
+ optional string message = 2;
+}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/slave/isolator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/slave/isolator.hpp b/include/mesos/slave/isolator.hpp
index ea1fa4f..d5880ee 100644
--- a/include/mesos/slave/isolator.hpp
+++ b/include/mesos/slave/isolator.hpp
@@ -22,8 +22,7 @@
#include <mesos/resources.hpp>
-// ONLY USEFUL AFTER RUNNING PROTOC.
-#include <mesos/slave/isolator.pb.h>
+#include <mesos/slave/containerizer.hpp>
#include <process/dispatch.hpp>
#include <process/future.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/include/mesos/slave/isolator.proto
----------------------------------------------------------------------
diff --git a/include/mesos/slave/isolator.proto b/include/mesos/slave/isolator.proto
deleted file mode 100644
index 83c748d..0000000
--- a/include/mesos/slave/isolator.proto
+++ /dev/null
@@ -1,143 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package mesos.slave;
-
-import "mesos/mesos.proto";
-
-import "mesos/appc/spec.proto";
-
-import "mesos/docker/v1.proto";
-
-/**
- * Information when an executor is impacted by a resource limitation
- * and should be terminated. Intended to support resources like memory
- * where the Linux kernel may invoke the OOM killer, killing some/all
- * of a container's processes.
- */
-message ContainerLimitation {
- // Resources that triggered the limitation.
- // NOTE: 'Resources' is used here because the resource may span
- // multiple roles (e.g. `"mem(*):1;mem(role):2"`).
- repeated Resource resources = 1;
-
- // Description of the limitation.
- optional string message = 2;
-
- // The container will be terminated when a resource limitation is
- // reached. This field specifies the 'reason' that will be sent in
- // the status update for any remaining non-terminal tasks when the
- // container is terminated.
- optional TaskStatus.Reason reason = 3;
-}
-
-
-/**
- * This message is derived from slave::state::RunState. It contains
- * only those fields that are needed by Isolators for recovering the
- * containers. The reason for not using RunState instead is to avoid
- * any dependency on RunState and in turn on internal protobufs.
- */
-message ContainerState {
- required ExecutorInfo executor_info = 1;
-
- // Container id of the last executor run.
- required ContainerID container_id = 2;
-
- required uint64 pid = 3; // Executor pid.
- required string directory = 4; // Executor work directory.
-}
-
-
-/**
- * The container configuration that will be passed to each isolator
- * during `prepare`.
- */
-message ContainerConfig {
- // The executor associated with this container.
- required ExecutorInfo executor_info = 8;
-
- // The task (optional) associated with this container.
- optional TaskInfo task_info = 9;
-
- // The command used to launch the container.
- required CommandInfo command_info = 11;
-
- // The information about the container.
- optional ContainerInfo container_info = 12;
-
- // Resources associated with the container during launch.
- repeated Resource resources = 13;
-
- // The work directory for the container in the host filesystem.
- required string directory = 3;
-
- // The user the task will be run as.
- optional string user = 4;
-
- // NOTE: 'rootfs' and 'docker' below are for the executor in custom
- // executor case, and they are for the task in command task case.
-
- // The root filesystem for the container.
- optional string rootfs = 5;
-
- // Docker v1 image manifest.
- message Docker {
- optional docker.spec.v1.ImageManifest manifest = 1;
- }
-
- optional Docker docker = 7;
-
- message Appc {
- optional appc.spec.ImageManifest manifest = 1;
- }
-
- optional Appc appc = 10;
-}
-
-
-/**
- * Protobuf returned by Isolator::prepare(). The command is executed
- * by the Launcher in the containerized context.
- * Note: Currently, any URIs or Environment in the CommandInfo will be
- * ignored; only the command value is used. Further, we only accept
- * shell commands for the preparation commands.
- */
-message ContainerLaunchInfo {
- // The additional preparation commands to execute before
- // executing the command.
- repeated CommandInfo pre_exec_commands = 1;
- optional Environment environment = 2;
-
- // The root filesystem for the container.
- //
- // This field is not used since 0.28, and it is deprecated
- // since 1.0.1.
- optional string rootfs = 3 [deprecated = true]; // Since 1.0.1.
-
- // (Linux only) The namespaces required for the container.
- // The namespaces are created while launching the executor.
- optional uint32 namespaces = 4 [default = 0];
-
- // If specified, it'll become the launch command for the custom
- // executor, or the launch command for the user task in the case of
- // a command task.
- optional CommandInfo command = 5;
-
- // The working directory for the container.
- // NOTE: This is different than Mesos sandbox.
- optional string working_directory = 6;
-}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7ffe377..9668fcf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -25,13 +25,12 @@ PROTOC_TO_INCLUDE_DIR(ALLOCATOR mesos/allocator/allocator)
PROTOC_TO_INCLUDE_DIR(APPC_SPEC mesos/appc/spec)
PROTOC_TO_INCLUDE_DIR(AUTHENTICATION mesos/authentication/authentication)
PROTOC_TO_INCLUDE_DIR(AUTHORIZATION mesos/authorizer/authorizer)
-PROTOC_TO_INCLUDE_DIR(CONTAINERIZER mesos/containerizer/containerizer)
+PROTOC_TO_INCLUDE_DIR(CONTAINERIZER mesos/slave/containerizer)
PROTOC_TO_INCLUDE_DIR(DOCKER_SPEC mesos/docker/spec)
PROTOC_TO_INCLUDE_DIR(DOCKER_V1 mesos/docker/v1)
PROTOC_TO_INCLUDE_DIR(DOCKER_V2 mesos/docker/v2)
PROTOC_TO_INCLUDE_DIR(EXECUTOR mesos/executor/executor)
PROTOC_TO_INCLUDE_DIR(FETCHER mesos/fetcher/fetcher)
-PROTOC_TO_INCLUDE_DIR(ISOLATOR mesos/slave/isolator)
PROTOC_TO_INCLUDE_DIR(MAINTENANCE mesos/maintenance/maintenance)
PROTOC_TO_INCLUDE_DIR(MASTER mesos/master/master)
PROTOC_TO_INCLUDE_DIR(MESOS mesos/mesos)
@@ -76,7 +75,6 @@ set(MESOS_PROTOBUF_SRC
${INTERNAL_LOG_PROTO_CC}
${INTERNAL_MESSAGES_PROTO_CC}
${INTERNAL_STATE_PROTO_CC}
- ${ISOLATOR_PROTO_CC}
${ISOLATOR_CNI_SPEC_PROTO_CC}
${ISOLATOR_DOCKER_VOLUME_STATE_PROTO_CC}
${MAINTENANCE_PROTO_CC}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 9734460..dd24f53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -216,7 +216,7 @@ ALLOCATOR_PROTO = $(top_srcdir)/include/mesos/allocator/allocator.proto
APPC_SPEC_PROTO = $(top_srcdir)/include/mesos/appc/spec.proto
AUTHENTICATION_PROTO = $(top_srcdir)/include/mesos/authentication/authentication.proto
AUTHORIZATION_PROTO = $(top_srcdir)/include/mesos/authorizer/authorizer.proto
-CONTAINERIZER_PROTO = $(top_srcdir)/include/mesos/containerizer/containerizer.proto
+CONTAINERIZER_PROTO = $(top_srcdir)/include/mesos/slave/containerizer.proto
DOCKER_SPEC_PROTO = $(top_srcdir)/include/mesos/docker/spec.proto
DOCKER_V1_PROTO = $(top_srcdir)/include/mesos/docker/v1.proto
DOCKER_V2_PROTO = $(top_srcdir)/include/mesos/docker/v2.proto
@@ -229,7 +229,6 @@ MODULE_PROTO = $(top_srcdir)/include/mesos/module/module.proto
QUOTA_PROTO = $(top_srcdir)/include/mesos/quota/quota.proto
SCHEDULER_PROTO = $(top_srcdir)/include/mesos/scheduler/scheduler.proto
STATE_PROTO = $(top_srcdir)/include/mesos/state/state.proto
-ISOLATOR_PROTO = $(top_srcdir)/include/mesos/slave/isolator.proto
OVERSUBSCRIPTION_PROTO = $(top_srcdir)/include/mesos/slave/oversubscription.proto
URI_PROTO = $(top_srcdir)/include/mesos/uri/uri.proto
V1_AGENT_PROTO = $(top_srcdir)/include/mesos/v1/agent/agent.proto
@@ -257,8 +256,6 @@ CXX_PROTOS = \
../include/mesos/authorizer/acls.pb.h \
../include/mesos/authorizer/authorizer.pb.cc \
../include/mesos/authorizer/authorizer.pb.h \
- ../include/mesos/containerizer/containerizer.pb.cc \
- ../include/mesos/containerizer/containerizer.pb.h \
../include/mesos/docker/spec.pb.cc \
../include/mesos/docker/spec.pb.h \
../include/mesos/docker/v1.pb.cc \
@@ -279,8 +276,8 @@ CXX_PROTOS = \
../include/mesos/quota/quota.pb.h \
../include/mesos/scheduler/scheduler.pb.cc \
../include/mesos/scheduler/scheduler.pb.h \
- ../include/mesos/slave/isolator.pb.cc \
- ../include/mesos/slave/isolator.pb.h \
+ ../include/mesos/slave/containerizer.pb.cc \
+ ../include/mesos/slave/containerizer.pb.h \
../include/mesos/slave/oversubscription.pb.cc \
../include/mesos/slave/oversubscription.pb.h \
../include/mesos/state/state.pb.cc \
@@ -328,13 +325,11 @@ CXX_STATE_PROTOS = \
JAVA_PROTOS = \
java/generated/org/apache/mesos/Protos.java \
- java/generated/org/apache/mesos/containerizer/Protos.java \
java/generated/org/apache/mesos/executor/Protos.java \
java/generated/org/apache/mesos/scheduler/Protos.java
PYTHON_PROTOS = \
- python/interface/src/mesos/interface/mesos_pb2.py \
- python/interface/src/mesos/interface/containerizer_pb2.py
+ python/interface/src/mesos/interface/mesos_pb2.py
V1_JAVA_PROTOS = \
java/generated/org/apache/mesos/v1/Protos.java \
@@ -374,10 +369,6 @@ CLEANFILES += \
# Targets for generating Java protocol buffer code.
-java/generated/org/apache/mesos/containerizer/Protos.java: $(CONTAINERIZER_PROTO)
- $(MKDIR_P) $(@D)
- $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^
-
java/generated/org/apache/mesos/executor/Protos.java: $(EXECUTOR_PROTO)
$(MKDIR_P) $(@D)
$(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^
@@ -412,12 +403,6 @@ java/generated/org/apache/mesos/v1/scheduler/Protos.java: $(V1_SCHEDULER_PROTO)
# has to get patched using sed, removing the leading 'mesos.'
# namespace qualifier due to the flat hierachy in the resulting
# mesos.interface egg. See MESOS-1750 for more.
-python/interface/src/mesos/interface/containerizer_pb2.py: $(CONTAINERIZER_PROTO)
- $(MKDIR_P) $(@D)
- $(PROTOC) -I$(top_srcdir)/include/mesos/containerizer $(PROTOCFLAGS) \
- --python_out=python/interface/src/mesos/interface $^
- $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak
-
python/interface/src/mesos/interface/executor_pb2.py: $(EXECUTOR_PROTO)
$(MKDIR_P) $(@D)
$(PROTOC) -I$(top_srcdir)/include/mesos/executor $(PROTOCFLAGS) \
@@ -513,15 +498,6 @@ nodist_authorizer_HEADERS = \
../include/mesos/authorizer/acls.pb.h \
../include/mesos/authorizer/authorizer.pb.h
-containerizerdir = $(pkgincludedir)/containerizer
-
-containerizer_HEADERS = \
- $(top_srcdir)/include/mesos/containerizer/containerizer.hpp \
- $(top_srcdir)/include/mesos/containerizer/containerizer.proto
-
-nodist_containerizer_HEADERS = \
- ../include/mesos/containerizer/containerizer.pb.h
-
dockerdir = $(pkgincludedir)/docker
docker_HEADERS = \
@@ -624,10 +600,9 @@ agentdir = $(pkgincludedir)/agent
agent_HEADERS = \
$(top_srcdir)/include/mesos/agent/agent.hpp \
- $(top_srcdir)/include/mesos/agent/agent.proto \
+ $(top_srcdir)/include/mesos/agent/agent.proto \
$(top_srcdir)/include/mesos/slave/container_logger.hpp \
$(top_srcdir)/include/mesos/slave/isolator.hpp \
- $(top_srcdir)/include/mesos/slave/isolator.proto \
$(top_srcdir)/include/mesos/slave/oversubscription.hpp \
$(top_srcdir)/include/mesos/slave/oversubscription.proto \
$(top_srcdir)/include/mesos/slave/qos_controller.hpp \
@@ -635,7 +610,7 @@ agent_HEADERS = \
nodist_agent_HEADERS = \
../include/mesos/agent/agent.pb.h \
- ../include/mesos/slave/isolator.pb.h \
+ ../include/mesos/slave/containerizer.pb.h \
../include/mesos/slave/oversubscription.pb.h
statedir = $(pkgincludedir)/state
@@ -1274,7 +1249,7 @@ lib_LTLIBRARIES += libmesos.la
# Include as part of the distribution.
libmesos_la_SOURCES = \
$(ACLS_PROTO) \
- $(AGENT_PROTO) \
+ $(AGENT_PROTO) \
$(ALLOCATOR_PROTO) \
$(APPC_SPEC_PROTO) \
$(AUTHENTICATION_PROTO) \
@@ -1285,7 +1260,6 @@ libmesos_la_SOURCES = \
$(DOCKER_V1_PROTO) \
$(DOCKER_V2_PROTO) \
$(FETCHER_PROTO) \
- $(ISOLATOR_PROTO) \
$(MAINTENANCE_PROTO) \
$(MASTER_PROTO) \
$(MESOS_PROTO) \
@@ -1590,7 +1564,6 @@ libjava_la_CPPFLAGS += $(JAVA_CPPFLAGS)
libjava_la_CPPFLAGS += -I$(srcdir)/java/jni -Ijava/jni
libjava_la_DEPENDENCIES = \
- $(CONTAINERIZER_PROTO) \
$(MESOS_PROTO) \
$(V1_EXECUTOR_PROTO) \
$(V1_MESOS_PROTO) \
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/composing.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp
index c51cb4b..5ff3e65 100644
--- a/src/slave/containerizer/composing.cpp
+++ b/src/slave/containerizer/composing.cpp
@@ -32,12 +32,14 @@
#include "slave/containerizer/containerizer.hpp"
#include "slave/containerizer/composing.hpp"
+using namespace process;
+
using std::list;
using std::map;
using std::string;
using std::vector;
-using namespace process;
+using mesos::slave::ContainerTermination;
namespace mesos {
namespace internal {
@@ -78,7 +80,7 @@ public:
Future<ContainerStatus> status(
const ContainerID& containerId);
- Future<containerizer::Termination> wait(
+ Future<ContainerTermination> wait(
const ContainerID& containerId);
void destroy(const ContainerID& containerId);
@@ -204,7 +206,7 @@ Future<ContainerStatus> ComposingContainerizer::status(
}
-Future<containerizer::Termination> ComposingContainerizer::wait(
+Future<ContainerTermination> ComposingContainerizer::wait(
const ContainerID& containerId)
{
return dispatch(process, &ComposingContainerizerProcess::wait, containerId);
@@ -434,7 +436,7 @@ Future<ContainerStatus> ComposingContainerizerProcess::status(
}
-Future<containerizer::Termination> ComposingContainerizerProcess::wait(
+Future<ContainerTermination> ComposingContainerizerProcess::wait(
const ContainerID& containerId)
{
if (!containers_.contains(containerId)) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/composing.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/composing.hpp b/src/slave/containerizer/composing.hpp
index 406015a..ef3c2ee 100644
--- a/src/slave/containerizer/composing.hpp
+++ b/src/slave/containerizer/composing.hpp
@@ -22,8 +22,6 @@
#include <mesos/mesos.hpp>
#include <mesos/resources.hpp>
-#include <mesos/containerizer/containerizer.hpp>
-
#include <process/future.hpp>
#include <process/process.hpp>
@@ -32,7 +30,6 @@
#include <stout/option.hpp>
#include <stout/try.hpp>
-
namespace mesos {
namespace internal {
namespace slave {
@@ -40,6 +37,7 @@ namespace slave {
// Forward declaration.
class ComposingContainerizerProcess;
+
class ComposingContainerizer : public Containerizer
{
public:
@@ -74,7 +72,7 @@ public:
virtual process::Future<ContainerStatus> status(
const ContainerID& containerId);
- virtual process::Future<containerizer::Termination> wait(
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId);
virtual void destroy(const ContainerID& containerId);
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/containerizer.hpp b/src/slave/containerizer/containerizer.hpp
index bf39aaa..f13669d 100644
--- a/src/slave/containerizer/containerizer.hpp
+++ b/src/slave/containerizer/containerizer.hpp
@@ -22,7 +22,7 @@
#include <mesos/mesos.hpp>
#include <mesos/resources.hpp>
-#include <mesos/containerizer/containerizer.hpp>
+#include <mesos/slave/containerizer.hpp>
#include <process/future.hpp>
#include <process/owned.hpp>
@@ -120,12 +120,11 @@ public:
return ContainerStatus();
}
- // Wait on the container's 'Termination'. If the executor
- // terminates, the containerizer should also destroy the
- // containerized context. The future may be failed if an error
- // occurs during termination of the executor or destruction of the
- // container.
- virtual process::Future<containerizer::Termination> wait(
+ // Wait on the 'ContainerTermination'. If the executor terminates,
+ // the containerizer should also destroy the containerized context.
+ // The future may be failed if an error occurs during termination of
+ // the executor or destruction of the container.
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId) = 0;
// Destroy a running container, killing all processes and releasing
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index e447c58..8ecd773 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -60,35 +60,37 @@
#include "usage/usage.hpp"
+using namespace process;
using std::list;
using std::map;
using std::string;
using std::vector;
-using namespace process;
-
using mesos::slave::ContainerLogger;
+using mesos::slave::ContainerTermination;
+
+using mesos::internal::slave::state::SlaveState;
+using mesos::internal::slave::state::FrameworkState;
+using mesos::internal::slave::state::ExecutorState;
+using mesos::internal::slave::state::RunState;
namespace mesos {
namespace internal {
namespace slave {
-using state::SlaveState;
-using state::FrameworkState;
-using state::ExecutorState;
-using state::RunState;
-
-
// Declared in header, see explanation there.
const string DOCKER_NAME_PREFIX = "mesos-";
+
// Declared in header, see explanation there.
const string DOCKER_NAME_SEPERATOR = ".";
+
// Declared in header, see explanation there.
const string DOCKER_SYMLINK_DIRECTORY = "docker/links";
+
// Parse the ContainerID from a Docker container and return None if
// the container was not launched from Mesos.
Option<ContainerID> parse(const Docker::Container& container)
@@ -712,7 +714,7 @@ Future<ResourceStatistics> DockerContainerizer::usage(
}
-Future<containerizer::Termination> DockerContainerizer::wait(
+Future<ContainerTermination> DockerContainerizer::wait(
const ContainerID& containerId)
{
return dispatch(
@@ -809,8 +811,8 @@ Future<Nothing> DockerContainerizerProcess::_recover(
// We need the pid so the reaper can monitor the executor so
// skip this executor if it's not present. This is not an
// error because the slave will try to wait on the container
- // which will return a failed Termination and everything will
- // get cleaned up.
+ // which will return a failed 'ContainerTermination' and
+ // everything will get cleaned up.
if (!run.get().forkedPid.isSome()) {
continue;
}
@@ -1779,7 +1781,7 @@ Try<ResourceStatistics> DockerContainerizerProcess::cgroupsStatistics(
}
-Future<containerizer::Termination> DockerContainerizerProcess::wait(
+Future<ContainerTermination> DockerContainerizerProcess::wait(
const ContainerID& containerId)
{
CHECK(!containerId.has_parent());
@@ -1814,7 +1816,7 @@ void DockerContainerizerProcess::destroy(
// NOTE: The launch error message will be retrieved by the slave
// and properly set in the corresponding status update.
- container->termination.set(containerizer::Termination());
+ container->termination.set(ContainerTermination());
containers_.erase(containerId);
delete container;
@@ -1856,7 +1858,7 @@ void DockerContainerizerProcess::destroy(
fetcher->kill(containerId);
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_message("Container destroyed while fetching");
container->termination.set(termination);
@@ -1875,7 +1877,7 @@ void DockerContainerizerProcess::destroy(
container->pull.discard();
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_message("Container destroyed while pulling image");
container->termination.set(termination);
@@ -1898,7 +1900,7 @@ void DockerContainerizerProcess::destroy(
<< unmount.error();
}
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_message("Container destroyed while mounting volumes");
container->termination.set(termination);
@@ -2037,7 +2039,7 @@ void DockerContainerizerProcess::___destroy(
Container* container = containers_[containerId];
- containerizer::Termination termination;
+ ContainerTermination termination;
if (status.isReady() && status.get().isSome()) {
termination.set_status(status.get().get());
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/docker.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.hpp b/src/slave/containerizer/docker.hpp
index 6597d86..b172a8e 100644
--- a/src/slave/containerizer/docker.hpp
+++ b/src/slave/containerizer/docker.hpp
@@ -96,7 +96,7 @@ public:
virtual process::Future<ResourceStatistics> usage(
const ContainerID& containerId);
- virtual process::Future<containerizer::Termination> wait(
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId);
virtual void destroy(const ContainerID& containerId);
@@ -146,7 +146,7 @@ public:
virtual process::Future<ResourceStatistics> usage(
const ContainerID& containerId);
- virtual process::Future<containerizer::Termination> wait(
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId);
virtual void destroy(
@@ -438,7 +438,7 @@ private:
const Flags flags;
// Promise for future returned from wait().
- process::Promise<containerizer::Termination> termination;
+ process::Promise<mesos::slave::ContainerTermination> termination;
// Exit status of executor or container (depending on whether or
// not we used the command executor). Represented as a promise so
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 687d9bb..808fc83 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -133,6 +133,7 @@ using mesos::slave::ContainerLaunchInfo;
using mesos::slave::ContainerLimitation;
using mesos::slave::ContainerLogger;
using mesos::slave::ContainerState;
+using mesos::slave::ContainerTermination;
using mesos::slave::Isolator;
using state::SlaveState;
@@ -510,7 +511,7 @@ Future<ContainerStatus> MesosContainerizer::status(
}
-Future<containerizer::Termination> MesosContainerizer::wait(
+Future<ContainerTermination> MesosContainerizer::wait(
const ContainerID& containerId)
{
return dispatch(process.get(), &MesosContainerizerProcess::wait, containerId);
@@ -562,10 +563,11 @@ Future<Nothing> MesosContainerizerProcess::recover(
CHECK_SOME(run);
CHECK_SOME(run.get().id);
- // We need the pid so the reaper can monitor the executor so skip this
- // executor if it's not present. This is not an error because the slave
- // will try to wait on the container which will return a failed
- // Termination and everything will get cleaned up.
+ // We need the pid so the reaper can monitor the executor so
+ // skip this executor if it's not present. This is not an
+ // error because the slave will try to wait on the container
+ // which will return a failed ContainerTermination and
+ // everything will get cleaned up.
if (!run.get().forkedPid.isSome()) {
continue;
}
@@ -1357,7 +1359,7 @@ Future<Nothing> MesosContainerizerProcess::launch(
}
-Future<containerizer::Termination> MesosContainerizerProcess::wait(
+Future<ContainerTermination> MesosContainerizerProcess::wait(
const ContainerID& containerId)
{
CHECK(!containerId.has_parent());
@@ -1759,7 +1761,7 @@ void MesosContainerizerProcess::_____destroy(
return;
}
- containerizer::Termination termination;
+ ContainerTermination termination;
if (status.isReady() && status->isSome()) {
termination.set_status(status->get());
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/containerizer/mesos/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.hpp b/src/slave/containerizer/mesos/containerizer.hpp
index 6bd16e6..0cfe7b0 100644
--- a/src/slave/containerizer/mesos/containerizer.hpp
+++ b/src/slave/containerizer/mesos/containerizer.hpp
@@ -100,7 +100,7 @@ public:
virtual process::Future<ContainerStatus> status(
const ContainerID& containerId);
- virtual process::Future<containerizer::Termination> wait(
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId);
virtual void destroy(const ContainerID& containerId);
@@ -164,7 +164,7 @@ public:
virtual process::Future<ContainerStatus> status(
const ContainerID& containerId);
- virtual process::Future<containerizer::Termination> wait(
+ virtual process::Future<mesos::slave::ContainerTermination> wait(
const ContainerID& containerId);
virtual process::Future<bool> exec(
@@ -289,7 +289,7 @@ private:
Container() : sequence("mesos-container-status-updates") {}
// Promise for futures returned from wait().
- process::Promise<containerizer::Termination> promise;
+ process::Promise<mesos::slave::ContainerTermination> promise;
// We need to keep track of the future exit status for each
// executor because we'll only get a single notification when
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 3688f42..c686a97 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -104,6 +104,7 @@ using mesos::executor::Call;
using mesos::master::detector::MasterDetector;
+using mesos::slave::ContainerTermination;
using mesos::slave::QoSController;
using mesos::slave::QoSCorrection;
using mesos::slave::ResourceEstimator;
@@ -1914,7 +1915,7 @@ void Slave::runTasks(
Executor* executor = getExecutor(frameworkId, executorId);
if (executor != nullptr) {
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_LOST);
termination.add_reasons(TaskStatus::REASON_CONTAINER_UPDATE_FAILED);
termination.set_message(
@@ -3182,7 +3183,7 @@ void Slave::_reregisterExecutor(
Executor* executor = getExecutor(frameworkId, executorId);
if (executor != nullptr) {
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_LOST);
termination.add_reasons(TaskStatus::REASON_CONTAINER_UPDATE_FAILED);
termination.set_message(
@@ -3225,7 +3226,7 @@ void Slave::reregisterExecutorTimeout()
executor->state = Executor::TERMINATING;
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_LOST);
termination.add_reasons(
TaskStatus::REASON_EXECUTOR_REREGISTRATION_TIMEOUT);
@@ -3516,7 +3517,7 @@ void Slave::__statusUpdate(
Executor* executor = getExecutor(update.framework_id(), executorId);
if (executor != nullptr) {
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_LOST);
termination.add_reasons(TaskStatus::REASON_CONTAINER_UPDATE_FAILED);
termination.set_message(
@@ -4038,7 +4039,7 @@ void Slave::executorLaunched(
Executor* executor = getExecutor(frameworkId, executorId);
if (executor != nullptr) {
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_FAILED);
termination.add_reasons(TaskStatus::REASON_CONTAINER_LAUNCH_FAILED);
termination.set_message(
@@ -4115,7 +4116,7 @@ void Slave::executorLaunched(
void Slave::executorTerminated(
const FrameworkID& frameworkId,
const ExecutorID& executorId,
- const Future<containerizer::Termination>& termination)
+ const Future<ContainerTermination>& termination)
{
int status;
// A termination failure indicates the containerizer could not destroy a
@@ -4598,7 +4599,7 @@ void Slave::registerExecutorTimeout(
executor->state = Executor::TERMINATING;
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_FAILED);
termination.add_reasons(TaskStatus::REASON_EXECUTOR_REGISTRATION_TIMEOUT);
termination.set_message(
@@ -5215,7 +5216,7 @@ void Slave::_qosCorrections(const Future<list<QoSCorrection>>& future)
// (MESOS-2875).
executor->state = Executor::TERMINATING;
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_state(TASK_LOST);
termination.add_reasons(TaskStatus::REASON_CONTAINER_PREEMPTED);
termination.set_message("Container preempted by QoS correction");
@@ -5509,7 +5510,7 @@ Future<bool> Slave::authorizeSandboxAccess(
void Slave::sendExecutorTerminatedStatusUpdate(
const TaskID& taskId,
- const Future<containerizer::Termination>& termination,
+ const Future<ContainerTermination>& termination,
const FrameworkID& frameworkId,
const Executor* executor)
{
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 9f29d80..7ca9923 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -274,7 +274,7 @@ public:
void executorTerminated(
const FrameworkID& frameworkId,
const ExecutorID& executorId,
- const process::Future<containerizer::Termination>& termination);
+ const process::Future<mesos::slave::ContainerTermination>& termination);
// NOTE: Pulled these to public to make it visible for testing.
// TODO(vinod): Make tests friends to this class instead.
@@ -635,7 +635,7 @@ private:
void sendExecutorTerminatedStatusUpdate(
const TaskID& taskId,
- const Future<containerizer::Termination>& termination,
+ const Future<mesos::slave::ContainerTermination>& termination,
const FrameworkID& frameworkId,
const Executor* executor);
@@ -903,7 +903,7 @@ struct Executor
// slave initiated the destruction and will influence the
// information sent in the status updates for any remaining
// non-terminal tasks.
- Option<containerizer::Termination> pendingTermination;
+ Option<mesos::slave::ContainerTermination> pendingTermination;
private:
Executor(const Executor&); // No copying.
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/cluster.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cluster.cpp b/src/tests/cluster.cpp
index dd41544..b04653a 100644
--- a/src/tests/cluster.cpp
+++ b/src/tests/cluster.cpp
@@ -96,6 +96,8 @@ using mesos::master::detector::MasterDetector;
using mesos::master::detector::StandaloneMasterDetector;
using mesos::master::detector::ZooKeeperMasterDetector;
+using mesos::slave::ContainerTermination;
+
namespace mesos {
namespace internal {
namespace tests {
@@ -550,7 +552,7 @@ Slave::~Slave()
AWAIT_READY(containers);
foreach (const ContainerID& containerId, containers.get()) {
- process::Future<containerizer::Termination> wait =
+ process::Future<ContainerTermination> wait =
containerizer->wait(containerId);
containerizer->destroy(containerId);
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer.cpp b/src/tests/containerizer.cpp
index 761b1ed..bda3e6f 100644
--- a/src/tests/containerizer.cpp
+++ b/src/tests/containerizer.cpp
@@ -22,6 +22,8 @@
#include "tests/mesos.hpp"
+using namespace process;
+
using std::map;
using std::shared_ptr;
using std::string;
@@ -30,7 +32,7 @@ using testing::_;
using testing::Invoke;
using testing::Return;
-using namespace process;
+using mesos::slave::ContainerTermination;
using mesos::v1::executor::Mesos;
@@ -38,7 +40,6 @@ namespace mesos {
namespace internal {
namespace tests {
-
TestContainerizer::TestContainerizer(
const ExecutorID& executorId,
const shared_ptr<MockV1HTTPExecutor>& executor)
@@ -186,14 +187,14 @@ Future<bool> TestContainerizer::_launch(
}
promises[containerId] =
- Owned<Promise<containerizer::Termination>>(
- new Promise<containerizer::Termination>());
+ Owned<Promise<ContainerTermination>>(
+ new Promise<ContainerTermination>());
return true;
}
-Future<containerizer::Termination> TestContainerizer::_wait(
+Future<ContainerTermination> TestContainerizer::_wait(
const ContainerID& containerId)
{
// An unknown container is possible for tests where we "drop" the
@@ -234,7 +235,7 @@ void TestContainerizer::_destroy(const ContainerID& containerId)
}
if (promises.contains(containerId)) {
- containerizer::Termination termination;
+ ContainerTermination termination;
termination.set_message("Killed executor");
termination.set_status(0);
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer.hpp b/src/tests/containerizer.hpp
index cd7eeb0..f1fd579 100644
--- a/src/tests/containerizer.hpp
+++ b/src/tests/containerizer.hpp
@@ -103,7 +103,7 @@ public:
MOCK_METHOD1(
wait,
- process::Future<containerizer::Termination>(const ContainerID&));
+ process::Future<mesos::slave::ContainerTermination>(const ContainerID&));
MOCK_METHOD1(
destroy,
@@ -127,7 +127,7 @@ private:
const std::map<std::string, std::string>& environment,
bool checkpoint);
- process::Future<containerizer::Termination> _wait(
+ process::Future<mesos::slave::ContainerTermination> _wait(
const ContainerID& containerId);
void _destroy(const ContainerID& containerID);
@@ -138,8 +138,8 @@ private:
hashmap<std::pair<FrameworkID, ExecutorID>, ContainerID> containers_;
hashmap<ContainerID, process::Owned<MesosExecutorDriver>> drivers;
hashmap<ContainerID, process::Owned<executor::TestV1Mesos>> v1Libraries;
- hashmap<ContainerID,
- process::Owned<process::Promise<containerizer::Termination>>> promises;
+ hashmap<ContainerID, process::Owned<
+ process::Promise<mesos::slave::ContainerTermination>>> promises;
};
} // namespace tests {
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/composing_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/composing_containerizer_tests.cpp b/src/tests/containerizer/composing_containerizer_tests.cpp
index 5a9d5e4..51aab33 100644
--- a/src/tests/containerizer/composing_containerizer_tests.cpp
+++ b/src/tests/containerizer/composing_containerizer_tests.cpp
@@ -41,6 +41,8 @@ using std::vector;
using testing::_;
using testing::Return;
+using mesos::slave::ContainerTermination;
+
namespace mesos {
namespace internal {
namespace tests {
@@ -81,7 +83,7 @@ public:
MOCK_METHOD1(
wait,
- process::Future<containerizer::Termination>(
+ process::Future<ContainerTermination>(
const ContainerID&));
MOCK_METHOD1(
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/docker_containerizer_tests.cpp b/src/tests/containerizer/docker_containerizer_tests.cpp
index 42d4364..28cd3fa 100644
--- a/src/tests/containerizer/docker_containerizer_tests.cpp
+++ b/src/tests/containerizer/docker_containerizer_tests.cpp
@@ -59,6 +59,7 @@ using mesos::internal::slave::Slave;
using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerLogger;
+using mesos::slave::ContainerTermination;
using std::list;
using std::string;
@@ -272,7 +273,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Launch_Executor)
ASSERT_TRUE(exists(docker, slaveId, containerId.get()));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
@@ -400,7 +401,7 @@ TEST_F(DockerContainerizerTest, DISABLED_ROOT_DOCKER_Launch_Executor_Bridged)
ASSERT_TRUE(exists(docker, slaveId, containerId.get()));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
@@ -551,7 +552,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Launch)
ASSERT_TRUE(exists(docker, slaveId, containerId.get()));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
@@ -662,7 +663,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Kill)
EXPECT_CALL(sched, statusUpdate(&driver, _))
.WillOnce(FutureArg<1>(&statusKilled));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.killTask(task.task_id());
@@ -788,7 +789,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_TaskKillingCapability)
.WillOnce(FutureArg<1>(&statusKilling))
.WillOnce(FutureArg<1>(&statusKilled));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.killTask(task.task_id());
@@ -937,7 +938,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Usage)
EXPECT_LT(0, statistics.cpus_system_time_secs());
EXPECT_GT(statistics.mem_rss_bytes(), 0u);
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
dockerContainerizer.destroy(containerId.get());
@@ -1229,7 +1230,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Recover)
AWAIT_READY(recover);
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId);
ASSERT_FALSE(termination.isFailed());
@@ -1360,7 +1361,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_KillOrphanContainers)
AWAIT_READY(recover);
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId);
ASSERT_FALSE(termination.isFailed());
@@ -1563,7 +1564,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_LaunchWithPersistentVolumes)
AWAIT_READY(statusFinished);
EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
@@ -1733,7 +1734,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_RecoverPersistentVolumes)
// Wait until containerizer recover is complete.
AWAIT_READY(_recover);
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer->wait(containerId.get());
dockerContainerizer->destroy(containerId.get());
@@ -2610,7 +2611,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_SlaveRecoveryTaskContainer)
ASSERT_TRUE(exists(docker, slaveId, containerId.get()));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer->wait(containerId.get());
driver.stop();
@@ -2947,7 +2948,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_NC_PortMapping)
// to stdout by the docker container running nc -l.
EXPECT_TRUE(containsLine(lines, uuid));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
@@ -3055,7 +3056,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_LaunchSandboxWithColon)
ASSERT_TRUE(exists(docker, slaveId, containerId.get()));
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
dockerContainerizer.wait(containerId.get());
driver.stop();
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index 2b216c3..9f6b2ed 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -77,6 +77,7 @@ using mesos::internal::slave::Store;
using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerLogger;
+using mesos::slave::ContainerTermination;
using mesos::slave::Isolator;
namespace mesos {
@@ -271,9 +272,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystem)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -792,9 +791,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_Metrics)
containerizer.get()->destroy(containerId);
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Executor was killed.
@@ -845,9 +842,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeFromSandbox)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -900,9 +895,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeFromHost)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -953,9 +946,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_FileVolumeFromHost)
AWAIT_READY_FOR(launch, Seconds(60));
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1006,9 +997,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeFromHostSandboxMountPoint)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1059,9 +1048,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_FileVolumeFromHostSandboxMountPoint)
AWAIT_READY_FOR(launch, Seconds(60));
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1127,9 +1114,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_PersistentVolumeWithRootFilesystem)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1201,9 +1186,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_PersistentVolumeWithoutRootFilesystem)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1256,9 +1239,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ImageInVolumeWithoutRootFilesystem)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -1311,8 +1292,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ImageInVolumeWithRootFilesystem)
AWAIT_READY_FOR(launch, Seconds(240));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
// Because destroy rootfs spents a lot of time, we use 30s as timeout here.
AWAIT_READY_FOR(wait, Seconds(30));
@@ -1426,10 +1406,8 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_MultipleContainers)
containerizer.get()->destroy(containerId1);
// Wait on the containers.
- Future<containerizer::Termination> wait1 =
- containerizer.get()->wait(containerId1);
- Future<containerizer::Termination> wait2 =
- containerizer.get()->wait(containerId2);
+ Future<ContainerTermination> wait1 = containerizer.get()->wait(containerId1);
+ Future<ContainerTermination> wait2 = containerizer.get()->wait(containerId2);
AWAIT_READY_FOR(wait1, Seconds(60));
AWAIT_READY_FOR(wait2, Seconds(60));
@@ -1499,9 +1477,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_SandboxEnvironmentVariable)
AWAIT_READY_FOR(launch, Seconds(60));
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/isolator_tests.cpp b/src/tests/containerizer/isolator_tests.cpp
index 05620d2..2725eb0 100644
--- a/src/tests/containerizer/isolator_tests.cpp
+++ b/src/tests/containerizer/isolator_tests.cpp
@@ -102,6 +102,7 @@ using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerConfig;
using mesos::slave::ContainerLaunchInfo;
+using mesos::slave::ContainerTermination;
using mesos::slave::Isolator;
using process::http::OK;
@@ -157,7 +158,7 @@ Try<Nothing> isolatePid(
}
// Isolate process.
- process::Future<Nothing> isolate = isolator->isolate(containerId, child);
+ Future<Nothing> isolate = isolator->isolate(containerId, child);
// Note this is following the implementation of AWAIT_READY.
if (!process::internal::await(isolate, Seconds(15))) {
@@ -1534,8 +1535,7 @@ TEST_F(NamespacesPidIsolatorTest, ROOT_PidNamespace)
ASSERT_TRUE(launch.get());
// Wait on the container.
- process::Future<containerizer::Termination> wait =
- containerizer->wait(containerId);
+ Future<ContainerTermination> wait = containerizer->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/mesos_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/mesos_containerizer_tests.cpp b/src/tests/containerizer/mesos_containerizer_tests.cpp
index e021b68..49f4552 100644
--- a/src/tests/containerizer/mesos_containerizer_tests.cpp
+++ b/src/tests/containerizer/mesos_containerizer_tests.cpp
@@ -73,6 +73,7 @@ using mesos::slave::ContainerLaunchInfo;
using mesos::slave::ContainerLimitation;
using mesos::slave::ContainerLogger;
using mesos::slave::ContainerState;
+using mesos::slave::ContainerTermination;
using mesos::slave::Isolator;
using std::list;
@@ -218,9 +219,7 @@ TEST_F(MesosContainerizerIsolatorPreparationTest, ScriptSucceeds)
AWAIT_READY(launch);
// Wait for the child (preparation script + executor) to complete.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the child exited correctly.
@@ -270,9 +269,7 @@ TEST_F(MesosContainerizerIsolatorPreparationTest, ScriptFails)
AWAIT_READY(launch);
// Wait for the child (preparation script + executor) to complete.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the child failed to exit correctly.
@@ -333,8 +330,7 @@ TEST_F(MesosContainerizerIsolatorPreparationTest, MultipleScripts)
AWAIT_READY(launch);
// Wait for the child (preparation script(s) + executor) to complete.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the child failed to exit correctly.
@@ -415,9 +411,7 @@ TEST_F(MesosContainerizerIsolatorPreparationTest, ExecutorEnvironmentVariable)
AWAIT_READY(launch);
// Wait for the child (preparation script + executor) to complete.
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
AWAIT_READY(wait);
// Check the child exited correctly.
@@ -485,9 +479,7 @@ TEST_F(MesosContainerizerExecuteTest, IoRedirection)
AWAIT_READY(launch);
// Wait on the container.
- Future<containerizer::Termination> wait =
- containerizer->wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -668,8 +660,7 @@ TEST_F(MesosContainerizerDestroyTest, DestroyWhileFetching)
map<string, string>(),
false);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
-
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
AWAIT_READY(exec);
containerizer.destroy(containerId);
@@ -736,7 +727,7 @@ TEST_F(MesosContainerizerDestroyTest, DestroyWhilePreparing)
map<string, string>(),
false);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
AWAIT_READY(prepare);
@@ -753,7 +744,7 @@ TEST_F(MesosContainerizerDestroyTest, DestroyWhilePreparing)
AWAIT_READY(wait);
- containerizer::Termination termination = wait.get();
+ ContainerTermination termination = wait.get();
EXPECT_EQ(
"Container destroyed while preparing isolators",
@@ -862,13 +853,13 @@ TEST_F(MesosContainerizerProvisionerTest, ProvisionFailed)
AWAIT_FAILED(launch);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
containerizer.destroy(containerId);
AWAIT_READY(wait);
- containerizer::Termination termination = wait.get();
+ ContainerTermination termination = wait.get();
EXPECT_EQ(
"Container destroyed while provisioning images",
@@ -954,7 +945,7 @@ TEST_F(MesosContainerizerProvisionerTest, DestroyWhileProvisioning)
map<string, string>(),
false);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
AWAIT_READY(provision);
@@ -966,7 +957,7 @@ TEST_F(MesosContainerizerProvisionerTest, DestroyWhileProvisioning)
AWAIT_FAILED(launch);
AWAIT_READY(wait);
- containerizer::Termination termination = wait.get();
+ ContainerTermination termination = wait.get();
EXPECT_EQ(
"Container destroyed while provisioning images",
@@ -1057,7 +1048,7 @@ TEST_F(MesosContainerizerProvisionerTest, IsolatorCleanupBeforePrepare)
map<string, string>(),
false);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
AWAIT_READY(provision);
@@ -1069,7 +1060,7 @@ TEST_F(MesosContainerizerProvisionerTest, IsolatorCleanupBeforePrepare)
AWAIT_FAILED(launch);
AWAIT_READY(wait);
- containerizer::Termination termination = wait.get();
+ ContainerTermination termination = wait.get();
EXPECT_EQ(
"Container destroyed while provisioning images",
@@ -1146,7 +1137,7 @@ TEST_F(MesosContainerizerDestroyTest, LauncherDestroyFailure)
AWAIT_READY(launch);
- Future<containerizer::Termination> wait = containerizer.wait(containerId);
+ Future<ContainerTermination> wait = containerizer.wait(containerId);
containerizer.destroy(containerId);
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/containerizer/port_mapping_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/port_mapping_tests.cpp b/src/tests/containerizer/port_mapping_tests.cpp
index fd181ca..db619ea 100644
--- a/src/tests/containerizer/port_mapping_tests.cpp
+++ b/src/tests/containerizer/port_mapping_tests.cpp
@@ -83,6 +83,7 @@ using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerConfig;
using mesos::slave::ContainerLaunchInfo;
+using mesos::slave::ContainerTermination;
using mesos::slave::Isolator;
using std::list;
@@ -2197,8 +2198,7 @@ TEST_F(PortMappingMesosTest, ROOT_NetworkNamespaceHandleSymlink)
EXPECT_TRUE(os::exists(symlink));
EXPECT_TRUE(os::stat::islink(symlink));
- Future<containerizer::Termination> termination =
- containerizer->wait(containerId);
+ Future<ContainerTermination> termination = containerizer->wait(containerId);
driver.killTask(task.task_id());
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index e69c4f5..50a252b 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -52,6 +52,7 @@ using mesos::internal::slave::Slave;
using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerLogger;
+using mesos::slave::ContainerTermination;
using process::Clock;
using process::Future;
@@ -578,7 +579,7 @@ TEST_F(HealthCheckTest, ROOT_DOCKER_DockerHealthyTask)
EXPECT_TRUE(statusHealth.get().has_healthy());
EXPECT_TRUE(statusHealth.get().healthy());
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
containerizer.wait(containerId.get());
driver.stop();
@@ -1001,7 +1002,7 @@ TEST_F(HealthCheckTest, ROOT_DOCKER_DockerHealthStatusChange)
ASSERT_SOME(os::read(tmpPath));
EXPECT_EQ("bar", os::read(tmpPath).get());
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
containerizer.wait(containerId.get());
driver.stop();
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index ac1188e..d864ef3 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -65,6 +65,7 @@ using mesos::internal::slave::Slave;
using mesos::master::detector::MasterDetector;
using mesos::slave::ContainerLogger;
+using mesos::slave::ContainerTermination;
using process::Clock;
using process::Future;
@@ -322,8 +323,7 @@ TEST_F(HookTest, VerifySlaveExecutorEnvironmentDecorator)
ASSERT_TRUE(launch.get());
// Wait on the container.
- process::Future<containerizer::Termination> wait =
- containerizer->wait(containerId);
+ process::Future<ContainerTermination> wait = containerizer->wait(containerId);
AWAIT_READY(wait);
// Check the executor exited correctly.
@@ -711,7 +711,7 @@ TEST_F(HookTest, ROOT_DOCKER_VerifySlavePreLaunchDockerEnvironmentDecorator)
AWAIT_READY_FOR(statusFinished, Seconds(60));
EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
containerizer.wait(containerId.get());
driver.stop();
@@ -927,7 +927,7 @@ TEST_F(HookTest, ROOT_DOCKER_VerifySlavePreLaunchDockerHook)
AWAIT_READY_FOR(statusFinished, Seconds(60));
EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
- Future<containerizer::Termination> termination =
+ Future<ContainerTermination> termination =
containerizer.wait(containerId.get());
driver.stop();
http://git-wip-us.apache.org/repos/asf/mesos/blob/c28846fb/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index b6d4ae5..9ff19f4 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -77,6 +77,8 @@ using mesos::internal::master::Master;
using mesos::master::detector::MasterDetector;
using mesos::master::detector::StandaloneMasterDetector;
+using mesos::slave::ContainerTermination;
+
using mesos::v1::executor::Call;
using std::map;
@@ -1717,8 +1719,7 @@ TYPED_TEST(SlaveRecoveryTest, RemoveNonCheckpointingFramework)
AWAIT_READY(containers);
foreach (const ContainerID& containerId, containers.get()) {
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
containerizer.get()->destroy(containerId);
AWAIT_READY(wait);
@@ -2651,8 +2652,7 @@ TYPED_TEST(SlaveRecoveryTest, RegisterDisconnectedSlave)
AWAIT_READY(containers);
foreach (const ContainerID& containerId, containers.get()) {
- Future<containerizer::Termination> wait =
- containerizer.get()->wait(containerId);
+ Future<ContainerTermination> wait = containerizer.get()->wait(containerId);
containerizer.get()->destroy(containerId);
AWAIT_READY(wait);
@@ -4005,7 +4005,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, ResourceStatistics)
EXPECT_TRUE(usage.get().has_cpus_limit());
EXPECT_TRUE(usage.get().has_mem_limit_bytes());
- Future<containerizer::Termination> wait = containerizer->wait(containerId);
+ Future<ContainerTermination> wait = containerizer->wait(containerId);
containerizer->destroy(containerId);
@@ -4258,8 +4258,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PidNamespaceForward)
EXPECT_NE(0u, offers2.get().size());
// Set up to wait on the container's termination.
- Future<containerizer::Termination> termination =
- containerizer->wait(containerId);
+ Future<ContainerTermination> termination = containerizer->wait(containerId);
// Destroy the container.
containerizer->destroy(containerId);
@@ -4364,8 +4363,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PidNamespaceBackward)
EXPECT_NE(0u, offers2.get().size());
// Set up to wait on the container's termination.
- Future<containerizer::Termination> termination =
- containerizer->wait(containerId);
+ Future<ContainerTermination> termination = containerizer->wait(containerId);
// Destroy the container.
containerizer->destroy(containerId);