aurora git commit: Clean up leaking of mounts into the host's mtab.

2016-08-29 Thread jcohen
Repository: aurora
Updated Branches:
  refs/heads/master 874625e8f -> c34f78a6d


Clean up leaking of mounts into the host's mtab.

Reviewed at https://reviews.apache.org/r/51502/


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

Branch: refs/heads/master
Commit: c34f78a6d4cb5b8935c82fe924f58ab480c29535
Parents: 874625e
Author: Joshua Cohen 
Authored: Mon Aug 29 15:52:44 2016 -0500
Committer: Joshua Cohen 
Committed: Mon Aug 29 15:52:44 2016 -0500

--
 .../python/apache/aurora/executor/common/sandbox.py | 12 
 .../apache/aurora/executor/common/test_sandbox.py   | 12 
 src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh|  6 ++
 3 files changed, 22 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/aurora/blob/c34f78a6/src/main/python/apache/aurora/executor/common/sandbox.py
--
diff --git a/src/main/python/apache/aurora/executor/common/sandbox.py 
b/src/main/python/apache/aurora/executor/common/sandbox.py
index cedcab6..a172691 100644
--- a/src/main/python/apache/aurora/executor/common/sandbox.py
+++ b/src/main/python/apache/aurora/executor/common/sandbox.py
@@ -243,11 +243,15 @@ class FileSystemImageSandbox(DirectorySandbox):
 def do_mount(source, destination):
   safe_mkdir(destination)
   log.info('Mounting %s into task filesystem at %s.' % (source, 
destination))
+
+  # This mount call is meant to mimic what mesos does when mounting into 
the container. C.f.
+  # 
https://github.com/apache/mesos/blob/c3228f3c3d1a1b2c145d1377185cfe22da6079eb/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp#L521-L528
   subprocess.check_call([
-'mount',
-'--bind',
-source,
-destination])
+  'mount',
+  '-n',
+  '--rbind',
+  source,
+  destination])
 
 if self._mounted_volume_paths is not None:
   for container_path in self._mounted_volume_paths:

http://git-wip-us.apache.org/repos/asf/aurora/blob/c34f78a6/src/test/python/apache/aurora/executor/common/test_sandbox.py
--
diff --git a/src/test/python/apache/aurora/executor/common/test_sandbox.py 
b/src/test/python/apache/aurora/executor/common/test_sandbox.py
index 2ba3341..57ab39e 100644
--- a/src/test/python/apache/aurora/executor/common/test_sandbox.py
+++ b/src/test/python/apache/aurora/executor/common/test_sandbox.py
@@ -217,19 +217,22 @@ def test_filesystem_sandbox_mounts_paths(mock_safe_mkdir, 
mock_check_call):
   assert mock_check_call.mock_calls == [
   mock.call([
   'mount',
-  '--bind',
+  '-n',
+  '--rbind',
   '/some/container/path',
   os.path.join(task_fs_path, 'some/container/path')
   ]),
   mock.call([
   'mount',
-  '--bind',
+  '-n',
+  '--rbind',
 '/some/other/container/path',
 os.path.join(task_fs_path, 'some/other/container/path')
   ]),
   mock.call([
   'mount',
-  '--bind',
+  '-n',
+  '--rbind',
   sandbox_directory,
   os.path.join(task_fs_path, sandbox_mount_point[1:])
   ])
@@ -257,7 +260,8 @@ def test_filesystem_sandbox_no_volumes(mock_safe_mkdir, 
mock_check_call):
   assert mock_check_call.mock_calls == [
 mock.call([
   'mount',
-  '--bind',
+  '-n',
+  '--rbind',
   sandbox_directory,
   os.path.join(task_fs_path, sandbox_mount_point[1:])
 ])

http://git-wip-us.apache.org/repos/asf/aurora/blob/c34f78a6/src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
--
diff --git a/src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh 
b/src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
index 7c32c94..d81abe1 100755
--- a/src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
+++ b/src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
@@ -428,8 +428,14 @@ test_appc() {
   popd
   rm -rf "$TEMP_PATH"
 
+  num_mounts_before=$(mount |wc -l |tr -d '\n')
+
   TEST_JOB_APPC_ARGS=("${BASE_ARGS[@]}" "$TEST_JOB_APPC" "--bind 
appc_image_id=$APPC_IMAGE_ID")
   test_http_example "${TEST_JOB_APPC_ARGS[@]}"
+
+  num_mounts_after=$(mount |wc -l |tr -d '\n')
+  # We want to be sure that running the isolated task did not leak any mounts.
+  [[ "$num_mounts_before" = "$num_mounts_after" ]]
 }
 
 RETCODE=1



aurora git commit: Re-enable python style check in the integration build.

2016-08-29 Thread jsirois
Repository: aurora
Updated Branches:
  refs/heads/master 76db37d97 -> 56906a796


Re-enable python style check in the integration build.

pants test does not appear to invoke the python checkstyle. Re-enable
it by explicitly calling in the integration build script. Also fix the
few issues that have already been commited.

Reviewed at https://reviews.apache.org/r/51484/


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

Branch: refs/heads/master
Commit: 56906a79644807a8e7a909656cf513c2eece3a3b
Parents: 76db37d
Author: Santhosh Kumar Shanmugham 
Authored: Mon Aug 29 11:02:12 2016 -0600
Committer: John Sirois 
Committed: Mon Aug 29 11:02:12 2016 -0600

--
 build-support/jenkins/build.sh  |  1 +
 .../python/apache/aurora/client/cli/context.py  |  2 +-
 .../python/apache/aurora/client/cli/update.py   | 14 +++-
 src/main/python/apache/thermos/core/process.py  |  1 -
 .../aurora/executor/common/test_sandbox.py  | 24 ++--
 .../python/apache/thermos/core/test_process.py  |  4 ++--
 6 files changed, 24 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/aurora/blob/56906a79/build-support/jenkins/build.sh
--
diff --git a/build-support/jenkins/build.sh b/build-support/jenkins/build.sh
index 1de1446..e54bd2a 100755
--- a/build-support/jenkins/build.sh
+++ b/build-support/jenkins/build.sh
@@ -24,6 +24,7 @@ date
 ./build-support/python/isort-check
 
 # Run remaining Python style checks and all tests
+./build-support/python/checkstyle-check
 ./pants test.pytest --junit-xml-dir="$PWD/dist/test-results" \
   src/{main,test}/python:: -- -v
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/56906a79/src/main/python/apache/aurora/client/cli/context.py
--
diff --git a/src/main/python/apache/aurora/client/cli/context.py 
b/src/main/python/apache/aurora/client/cli/context.py
index f1a256a..9cf5839 100644
--- a/src/main/python/apache/aurora/client/cli/context.py
+++ b/src/main/python/apache/aurora/client/cli/context.py
@@ -30,7 +30,7 @@ from apache.aurora.client.cli import (
 EXIT_INVALID_PARAMETER,
 Context
 )
-from apache.aurora.client.config import AnnotatedAuroraConfig, get_config
+from apache.aurora.client.config import get_config
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.common.clusters import CLUSTERS

http://git-wip-us.apache.org/repos/asf/aurora/blob/56906a79/src/main/python/apache/aurora/client/cli/update.py
--
diff --git a/src/main/python/apache/aurora/client/cli/update.py 
b/src/main/python/apache/aurora/client/cli/update.py
index 23aaa2c..d23243d 100644
--- a/src/main/python/apache/aurora/client/cli/update.py
+++ b/src/main/python/apache/aurora/client/cli/update.py
@@ -110,6 +110,7 @@ class UpdateController(object):
 "Failed to abort update due to error:",
 "Update has been aborted.")
 
+
 def format_timestamp(stamp_millis):
   return datetime.datetime.utcfromtimestamp(stamp_millis / 1000).isoformat()
 
@@ -128,6 +129,7 @@ WAIT_OPTION = lambda help_msg: CommandOption(
 action='store_true',
 help=help_msg)
 
+
 class StartUpdate(Verb):
 
   UPDATE_MSG_TEMPLATE = "Job update has started. View your update progress at 
%s"
@@ -203,15 +205,15 @@ class StartUpdate(Verb):
 
 
 def rollback_state_to_err_code(state):
-return (EXIT_OK if state == JobUpdateStatus.ROLLED_BACK else
-EXIT_COMMAND_FAILURE if state == JobUpdateStatus.ROLLED_FORWARD 
else
-EXIT_UNKNOWN_ERROR)
+  return (EXIT_OK if state == JobUpdateStatus.ROLLED_BACK else
+  EXIT_COMMAND_FAILURE if state == JobUpdateStatus.ROLLED_FORWARD else
+  EXIT_UNKNOWN_ERROR)
 
 
 def update_state_to_err_code(state):
-return (EXIT_OK if state == JobUpdateStatus.ROLLED_FORWARD else
-EXIT_COMMAND_FAILURE if state == JobUpdateStatus.ROLLED_BACK else
-EXIT_UNKNOWN_ERROR)
+  return (EXIT_OK if state == JobUpdateStatus.ROLLED_FORWARD else
+  EXIT_COMMAND_FAILURE if state == JobUpdateStatus.ROLLED_BACK else
+  EXIT_UNKNOWN_ERROR)
 
 
 def wait_for_update(context, clock, api, update_key, state_to_err_code_func):

http://git-wip-us.apache.org/repos/asf/aurora/blob/56906a79/src/main/python/apache/thermos/core/process.py
--
diff 

aurora git commit: Added Uber to the relevant user list

2016-08-29 Thread maxim
Repository: aurora
Updated Branches:
  refs/heads/master 4a2aff987 -> 76db37d97


Added Uber to the relevant user list

Testing Done:
Their latest blog post regarding their engineering stack mentioned their use of 
aurora for long running jobs.

Reviewed at https://reviews.apache.org/r/51474/


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

Branch: refs/heads/master
Commit: 76db37d97e7a7bebbe2403b48b6eaa563dc1bcd6
Parents: 4a2aff9
Author: Tarun Gogineni 
Authored: Mon Aug 29 09:35:17 2016 -0700
Committer: Maxim Khutornenko 
Committed: Mon Aug 29 09:35:17 2016 -0700

--
 README.md | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/aurora/blob/76db37d9/README.md
--
diff --git a/README.md b/README.md
index 77fb770..c314f5a 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ Are you using Aurora too?  Let us know, or submit a patch to 
join the list!
 - [Sabre Labs](http://www.sabre.com)
 - [TellApart](https://www.tellapart.com)
 - [Twitter](https://twitter.com)
+- [Uber](https://www.uber.com)
 
 ## Getting Help
 If you have questions that aren't answered in our 
[documentation](https://aurora.apache.org/documentation/latest/), you can reach 
out to one of our [mailing lists](https://aurora.apache.org/community/). We're 
also often available in IRC: #aurora on