You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2018/09/30 07:04:34 UTC

[mesos] branch master updated (bf833e0 -> 7aaef19)

This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from bf833e0  Added MESOS-9279 to 1.5.2 CHANGELOG.
     new d74779e  Updated mininal supported Docker version from 1.0.0 to 1.8.0.
     new f1ca2db  Specified `--type=container` for `docker inspect` command.
     new 7aaef19  Added MESOS-9231 in CHANGELOG and updated upgrades.md.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG                          |  1 +
 docs/docker-containerizer.md       |  2 +-
 docs/upgrades.md                   |  5 +++++
 src/docker/docker.cpp              |  6 ++++--
 src/docker/executor.cpp            | 14 --------------
 src/slave/containerizer/docker.cpp |  9 ---------
 src/tests/health_check_tests.cpp   | 27 ---------------------------
 7 files changed, 11 insertions(+), 53 deletions(-)


[mesos] 03/03: Added MESOS-9231 in CHANGELOG and updated upgrades.md.

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 7aaef1979a10de5e11548123d1985474b143854b
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Sun Sep 30 09:55:12 2018 +0800

    Added MESOS-9231 in CHANGELOG and updated upgrades.md.
    
    Review: https://reviews.apache.org/r/68887
---
 CHANGELOG        | 1 +
 docs/upgrades.md | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 3eeb5b0..f38aa8c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -10,6 +10,7 @@ Release Notes - Mesos - Version 1.7.1 (WIP)
   * [MESOS-8545] - AgentAPIStreamingTest.AttachInputToNestedContainerSession is flaky.
   * [MESOS-9131] - Health checks launching nested containers while a container is being destroyed lead to unkillable tasks.
   * [MESOS-9228] - SLRP does not clean up plugin containers after it is removed.
+  * [MESOS-9231] - `docker inspect` may return an unexpected result to Docker executor due to a race condition.
   * [MESOS-9267] - Mesos agent crashes when CNI network is not configured but used.
   * [MESOS-9279] - Docker Containerizer 'usage' call might be expensive if mount table is big.
 
diff --git a/docs/upgrades.md b/docs/upgrades.md
index e8a7cb6..576b42d 100644
--- a/docs/upgrades.md
+++ b/docs/upgrades.md
@@ -54,6 +54,7 @@ We categorize the changes as follows:
       <li>A <a href="#1-7-x-volume-mode-support">Volume mode support</a></li>
       <li>C <a href="#1-7-x-create-disk">`CREATE_DISK` and `DESTROY_DISK` operations and ACLs</a></li>
       <li>A <a href="#1-7-x-resource-provider-acls">Resource Provider ACLs</a></li>
+      <li>C <a href="#1-7-x-update-minimal-docker-version">Update the minimal supported Docker version</a></li>
     </ul>
   </td>
 
@@ -467,6 +468,10 @@ We categorize the changes as follows:
 
 * A new `ViewResourceProvider` ACL has been introduced to control which principals are allowed to call the `GET_RESOURCE_PROVIDERS` agent API.
 
+<a name="1-7-x-update-minimal-docker-version"></a>
+
+* To specify the `--type=container` option for the `docker inspect <container_name>` command, the minimal supported Docker version has been updated from 1.0.0 to 1.8.0 since Docker supported `--type=container` for the `docker inspect` command starting from 1.8.0.
+
 <a name="1-7-x-enforce-container-ports"></a>
 
 * A new [`--enforce_container_ports`](configuration/agent.md#enforce_container_ports) flag has been added to toggle whether the [`network/ports`](isolators/network-ports.md) isolator should enforce TCP ports usage limits.


[mesos] 01/03: Updated mininal supported Docker version from 1.0.0 to 1.8.0.

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit d74779eba1ba1d6583c76052c38a98668847eb68
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Sat Sep 29 11:07:46 2018 +0800

    Updated mininal supported Docker version from 1.0.0 to 1.8.0.
    
    The reason that we need Docker 1.8.0+ is, for `docker inspect` command,
    we need to specify the option `--type=container` which was added to the
    `docker inspect` command starting from Docker 1.8.0.
    
    Review: https://reviews.apache.org/r/68882
---
 docs/docker-containerizer.md       |  2 +-
 src/docker/docker.cpp              |  2 +-
 src/docker/executor.cpp            | 14 --------------
 src/slave/containerizer/docker.cpp |  9 ---------
 src/tests/health_check_tests.cpp   | 27 ---------------------------
 5 files changed, 2 insertions(+), 52 deletions(-)

diff --git a/docs/docker-containerizer.md b/docs/docker-containerizer.md
index 941a153..213e5d4 100644
--- a/docs/docker-containerizer.md
+++ b/docs/docker-containerizer.md
@@ -22,7 +22,7 @@ the agent with "docker" as one of the containerizers option.
 Example: `mesos-agent --containerizers=docker,mesos`
 
 Each agent that has the Docker containerizer should have Docker CLI
-client installed (version >= 1.0.0).
+client installed (version >= 1.8.0).
 
 If you enable iptables on agent, make sure the iptables allow all
 traffic from docker bridge interface through add below rule:
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index baac70f..fed10de 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -149,7 +149,7 @@ Try<Owned<Docker>> Docker::create(
   }
 #endif // __linux__
 
-  Try<Nothing> validateVersion = docker->validateVersion(Version(1, 0, 0));
+  Try<Nothing> validateVersion = docker->validateVersion(Version(1, 8, 0));
   if (validateVersion.isError()) {
     return Error(validateVersion.error());
   }
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index f461af9..f638e4b 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -791,20 +791,6 @@ private:
 
     HealthCheck healthCheck = task.health_check();
 
-    // To make sure the health check runs in the same mount namespace
-    // with the container, we wrap the original command in `docker exec`.
-    if (healthCheck.has_command()) {
-      // `docker exec` requires docker version greater than 1.3.0.
-      Try<Nothing> validateVersion =
-        docker->validateVersion(Version(1, 3, 0));
-
-      if (validateVersion.isError()) {
-        LOG(ERROR) << "Unable to launch health check process: "
-                   << validateVersion.error();
-        return;
-      }
-    }
-
     vector<string> namespaces;
     if (healthCheck.type() == HealthCheck::HTTP ||
         healthCheck.type() == HealthCheck::TCP) {
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index aa1f6cc..192dc29 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -193,15 +193,6 @@ Try<DockerContainerizer*> DockerContainerizer::create(
 
   Shared<Docker> docker = create->share();
 
-  if (flags.docker_mesos_image.isSome()) {
-    Try<Nothing> validateResult = docker->validateVersion(Version(1, 5, 0));
-    if (validateResult.isError()) {
-      string message = "Docker with mesos images requires docker 1.5+";
-      message += validateResult.error();
-      return Error(message);
-    }
-  }
-
   // TODO(tnachen): We should also mark the work directory as shared
   // mount here, more details please refer to MESOS-3483.
 
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index ec82f90..c972b90 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -2354,15 +2354,6 @@ TEST_F(DockerContainerizerHealthCheckTest, ROOT_DOCKER_DockerHealthyTask)
   Shared<Docker> docker(
       new MockDocker(tests::flags.docker, tests::flags.docker_socket));
 
-  Try<Nothing> validateResult = docker->validateVersion(Version(1, 3, 0));
-  ASSERT_SOME(validateResult)
-    << "-------------------------------------------------------------\n"
-    << "We cannot run this test because of 'docker exec' command \n"
-    << "require docker version greater than '1.3.0'. You won't be \n"
-    << "able to use the docker exec method, but feel free to disable\n"
-    << "this test.\n"
-    << "-------------------------------------------------------------";
-
   Try<Owned<cluster::Master>> master = StartMaster();
   ASSERT_SOME(master);
 
@@ -2484,15 +2475,6 @@ TEST_F(DockerContainerizerHealthCheckTest, ROOT_DOCKER_DockerHealthStatusChange)
   Shared<Docker> docker(
       new MockDocker(tests::flags.docker, tests::flags.docker_socket));
 
-  Try<Nothing> validateResult = docker->validateVersion(Version(1, 3, 0));
-  ASSERT_SOME(validateResult)
-    << "-------------------------------------------------------------\n"
-    << "We cannot run this test because of 'docker exec' command \n"
-    << "require docker version greater than '1.3.0'. You won't be \n"
-    << "able to use the docker exec method, but feel free to disable\n"
-    << "this test.\n"
-    << "-------------------------------------------------------------";
-
   Try<Owned<cluster::Master>> master = StartMaster();
   ASSERT_SOME(master);
 
@@ -2668,15 +2650,6 @@ TEST_F(
   Shared<Docker> docker(
       new MockDocker(tests::flags.docker, tests::flags.docker_socket));
 
-  Try<Nothing> validateResult = docker->validateVersion(Version(1, 3, 0));
-  ASSERT_SOME(validateResult)
-    << "-------------------------------------------------------------\n"
-    << "We cannot run this test because of 'docker exec' command \n"
-    << "require docker version greater than '1.3.0'. You won't be \n"
-    << "able to use the docker exec method, but feel free to disable\n"
-    << "this test.\n"
-    << "-------------------------------------------------------------";
-
   Try<Owned<cluster::Master>> master = StartMaster();
   ASSERT_SOME(master);
 


[mesos] 02/03: Specified `--type=container` for `docker inspect` command.

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit f1ca2dbbbebe11bf6a222d95efa3fd73da760e6a
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Wed Sep 26 08:32:51 2018 +0800

    Specified `--type=container` for `docker inspect` command.
    
    Without `--type` option, `docker inspect` is generic and will match
    against any object types. However in our case, we only care about
    Docker container rather than any other object types, so we need to
    add `--type=container` so that `docker inspect` will only match Docker
    container.
    
    Review: https://reviews.apache.org/r/68872
---
 src/docker/docker.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index fed10de..fb39f74 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -1322,7 +1322,9 @@ Future<Docker::Container> Docker::inspect(
   // discarded, and a mutex to control access to the callback.
   auto callback = std::make_shared<pair<lambda::function<void()>, mutex>>();
 
-  const string cmd = path + " -H " + socket + " inspect " + containerName;
+  const string cmd =
+    path + " -H " + socket + " inspect --type=container " + containerName;
+
   _inspect(cmd, promise, retryInterval, callback);
 
   return promise->future()