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 08:24:03 UTC
[1/3] mesos git commit: Added MESOS-7652 to 1.2.3 CHANGELOG.
Repository: mesos
Updated Branches:
refs/heads/1.2.x d1a58c9a5 -> 3ecb6c35c
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/3ecb6c35
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3ecb6c35
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3ecb6c35
Branch: refs/heads/1.2.x
Commit: 3ecb6c35c7c6c5d9444cbc61824ef37457c024ac
Parents: a203e35
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Aug 16 21:52:17 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Thu Aug 17 01:23:09 2017 -0700
----------------------------------------------------------------------
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3ecb6c35/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 2fd4f83..37651ca 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,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/3] mesos git commit: Change launcher working directory before
dropping privilege.
Posted by gi...@apache.org.
Change launcher working directory before dropping privilege.
The launcher needs to change its working directory before dropping
privilege by switching users and installing capabilities, because
afterwards it might not have access to traverse to the desired
working directory.
Review: https://reviews.apache.org/r/59551/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c39822ed
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c39822ed
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c39822ed
Branch: refs/heads/1.2.x
Commit: c39822ed05b5b8cd21e401605b0ffb3df93945d6
Parents: d1a58c9
Author: James Peach <jp...@apache.org>
Authored: Fri Jun 16 20:44:54 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Thu Aug 17 01:23:09 2017 -0700
----------------------------------------------------------------------
src/slave/containerizer/mesos/launch.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c39822ed/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 3a76bb2..a75b639 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -558,6 +558,16 @@ int MesosContainerizerLaunch::execute()
}
#endif // __WINDOWS__
+ if (launchInfo.has_working_directory()) {
+ Try<Nothing> chdir = os::chdir(launchInfo.working_directory());
+ if (chdir.isError()) {
+ cerr << "Failed to chdir into current working directory "
+ << "'" << launchInfo.working_directory() << "': "
+ << chdir.error() << endl;
+ exitWithStatus(EXIT_FAILURE);
+ }
+ }
+
#ifndef __WINDOWS__
// Change user if provided. Note that we do that after executing the
// preparation commands so that those commands will be run with the
@@ -623,16 +633,6 @@ int MesosContainerizerLaunch::execute()
}
#endif // __linux__
- if (launchInfo.has_working_directory()) {
- Try<Nothing> chdir = os::chdir(launchInfo.working_directory());
- if (chdir.isError()) {
- cerr << "Failed to chdir into current working directory "
- << "'" << launchInfo.working_directory() << "': "
- << chdir.error() << endl;
- exitWithStatus(EXIT_FAILURE);
- }
- }
-
// Prepare the executable and the argument list for the child.
string executable(launchInfo.command().shell()
? os::Shell::name
[2/3] mesos git commit: Fixed mesos containerizer to support docker
image WORKDIR missing.
Posted by gi...@apache.org.
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/a203e357
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a203e357
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a203e357
Branch: refs/heads/1.2.x
Commit: a203e357e569d114882df9e4b688aa80d9fda112
Parents: c39822e
Author: Gilbert Song <so...@gmail.com>
Authored: Fri Aug 11 17:52:18 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Thu Aug 17 01:23:09 2017 -0700
----------------------------------------------------------------------
src/slave/containerizer/mesos/launch.cpp | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a203e357/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index a75b639..712701f 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -559,6 +559,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 "