You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2017/08/17 04:56:41 UTC

[1/4] mesos git commit: Fixed mesos containerizer to support docker image WORKDIR missing.

Repository: mesos
Updated Branches:
  refs/heads/master 258363a56 -> 855550074


Fixed mesos containerizer to support docker image WORKDIR missing.

Some docker image may have 'WORKDIR' set in its manifest but that
'WORKDIR' does not exist in the image rootfs (e.g., the workdir
is removed in the following dockerfile).

>From the reference of dockerfile, "If the WORKDIR doesn’t exist,
it will be created even if it’s not used in any subsequent
Dockerfile instruction". So we should create the working directory
if it does not exist in the image's rootfs.

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


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

Branch: refs/heads/master
Commit: 917b229219338846427efd1f1f2c5906c7eb238f
Parents: 258363a
Author: Gilbert Song <so...@gmail.com>
Authored: Fri Aug 11 17:52:18 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Wed Aug 16 21:54:37 2017 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/launch.cpp | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/917b2292/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 8e66293..0affcf5 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -565,6 +565,29 @@ int MesosContainerizerLaunch::execute()
 #endif // __WINDOWS__
 
   if (launchInfo.has_working_directory()) {
+    // If working directory does not exist (e.g., being removed from
+    // the container image), create an empty directory even it may
+    // not be used. Please note that this case can only be possible
+    // if an image has 'WORKDIR' specified in its manifest but that
+    // 'WORKDIR' does not exist in the image's rootfs.
+    //
+    // TODO(gilbert): Set the proper ownership to this working
+    // directory to make sure a specified non-root user has the
+    // permission to write to this working directory. Right now
+    // it is owned by root, and any non-root user will fail to
+    // write to this directory. Please note that this is identical
+    // to the semantic as docker daemon. The semantic can be
+    // verified by:
+    // 'docker run -ti -u nobody quay.io/spinnaker/front50:master bash'
+    // The ownership of '/workdir' is root. Creating any file under
+    // '/workdir' will fail for 'Permission denied'.
+    Try<Nothing> mkdir = os::mkdir(launchInfo.working_directory());
+    if (mkdir.isError()) {
+      cerr << "Failed to create working directory "
+           << "'" << launchInfo.working_directory() << "': "
+           << mkdir.error() << endl;
+    }
+
     Try<Nothing> chdir = os::chdir(launchInfo.working_directory());
     if (chdir.isError()) {
       cerr << "Failed to chdir into current working directory "


[2/4] mesos git commit: Added MESOS-7652 to 1.3.2 CHANGELOG.

Posted by gi...@apache.org.
Added MESOS-7652 to 1.3.2 CHANGELOG.


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

Branch: refs/heads/master
Commit: ba5e92d7699a9b2f376d55da1f4df7e827165039
Parents: 917b229
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Aug 16 21:51:56 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Wed Aug 16 21:54:38 2017 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ba5e92d7/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 95fabd0..8c4ef39 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -73,6 +73,7 @@ All Issues:
 ** Bug
   * [MESOS-6743] - Docker executor hangs forever if `docker stop` fails.
   * [MESOS-6950] - Launching two tasks with the same Docker image simultaneously may cause a staging dir never cleaned up.
+  * [MESOS-7652] - Docker image with universal containerizer does not work if WORKDIR is missing in the rootfs.
 
 
 Release Notes - Mesos - Version 1.3.1


[4/4] mesos git commit: Added MESOS-7652 to 1.2.3 CHANGELOG.

Posted by gi...@apache.org.
Added MESOS-7652 to 1.2.3 CHANGELOG.


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

Branch: refs/heads/master
Commit: 0cc6673ab5f0277048d5c9523fcd6af258ae310b
Parents: ba5e92d
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Aug 16 21:52:17 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Wed Aug 16 21:54:38 2017 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0cc6673a/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 8c4ef39..a77549c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -386,6 +386,7 @@ All Issues:
 ** Bug
   * [MESOS-6743] - Docker executor hangs forever if `docker stop` fails.
   * [MESOS-6950] - Launching two tasks with the same Docker image simultaneously may cause a staging dir never cleaned up.
+  * [MESOS-7652] - Docker image with universal containerizer does not work if WORKDIR is missing in the rootfs.
 
 
 Release Notes - Mesos - Version 1.2.2


[3/4] mesos git commit: Added MESOS-7652 to 1.1.3 CHANGELOG.

Posted by gi...@apache.org.
Added MESOS-7652 to 1.1.3 CHANGELOG.


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

Branch: refs/heads/master
Commit: 85555007440877c6bb680123a4e04c73ba256345
Parents: 0cc6673
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Aug 16 21:52:54 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Wed Aug 16 21:54:38 2017 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/85555007/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index a77549c..907623f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -906,6 +906,7 @@ All Issues:
   * [MESOS-6950] - Launching two tasks with the same Docker image simultaneously may cause a staging dir never cleaned up.
   * [MESOS-7540] - Add an agent flag for executor re-registration timeout.
   * [MESOS-7569] - Allow "old" executors with half-open connections to be preserved during agent upgrade / restart.
+  * [MESOS-7652] - Docker image with universal containerizer does not work if WORKDIR is missing in the rootfs.
   * [MESOS-7689] - Libprocess can crash on malformed request paths for libprocess messages.
   * [MESOS-7690] - The agent can crash when an unknown executor tries to register.
   * [MESOS-7581] - Fix interference of external Boost installations when using some unbundled dependencies.