Use bash instead of sh for bootstrap scripts.

Testing Done:
vagrant up

Bugs closed: AURORA-5

Reviewed at https://reviews.apache.org/r/16094/
Adding support for a 'locked job warning' in client APIs
Add top level LICENSE file.

Reviewed at https://reviews.apache.org/r/16090/
Enable integration with hooks on a failed update.

Adding support for err hooks when update is rolled back or failed. Hooks use thrift ResponseCode to detect operation failure, so updater has to simulate an ERROR response code to properly support error hooks.

Also, failed_instances no longer tell the truth as far as update status goes. Converted to use failure count check to determine update success.

Testing Done:
./pants src/test/python/twitter/aurora/client/api:all

Reviewed at https://reviews.apache.org/r/16139/
Fix noSlotsFound stat in Preemptor

This changes the noSlotsFound stat in the Preemptor to be incremented after all the slaves have been searched not after each one.

Testing Done:
./gradlew clean build

Reviewed at https://reviews.apache.org/r/16168/
Remove ability to install a custom quota module.

Testing Done:
gradle clean build

Reviewed at https://reviews.apache.org/r/16098/
Use binaries for vagrant up.

This is a significant speedup - we now skip building mesos from source.

Before: Bringing up the devtools took 24 minutes:
vagrant up  36.41s user 4.28s system 2% cpu 24:20.66 total

In this version it takes less than 8 minutes:
vagrant up devtools  31.22s user 3.14s system 7% cpu 7:43.25 total

So now a full new Aurora cluster takes less than 13 min:
vagrant up  102.64s user 12.44s system 15% cpu 12:47.19 total

Testing Done:
vagrant destroy
vagrant up
Verified that job submission and all components work.

Bugs closed: AURORA-8

Reviewed at https://reviews.apache.org/r/16200/
Pin master to -SNAPSHOT and -dev versions.

Ensure that we don't inadvertendly publish artifacts that aren't
final tagged versions. A future review will introduce tooling to
automatically and atomically increment these version numbers.

Testing Done:
% ./gradlew publishToMavenLocal
% ./pants setup_py src/main/python/twitter/aurora/config:config-packaged

Bugs closed: AURORA-10

Reviewed at https://reviews.apache.org/r/16228/
Output all states in maintenance endpoint.

Improve the /maintenance endpoint to print out hosts affected by
SCHEDULED and DRAINED states.

Testing Done:
./gradlew clean build

Bugs closed: AURORA-9

Reviewed at https://reviews.apache.org/r/16220/
Fix gradle to include same version as artifact in generated distribution tarball

Version number is now available to both the application plugin and the maven-publish plugin.

Note that this also changes the Maven artifactId from 'twitter-aurora' to 'aurora-scheduler'.

groupId remains 'com.twitter.aurora' - I imagine we will change this to 'org.apache.aurora'
in combination with a refactor of package names.

Testing Done:
'vagrant up' works

'./gradlew distTar' produces dist/distributions/aurora-scheduler-0.2.0-SNAPSHOT.tar
'./gradlew distZip' produces dist/distributions/aurora-scheduler-0.2.0-SNAPSHOT.zip

'./gradlew publishToMavenLocal' publishes appropriately-named binary and source jars

Bugs closed: AURORA-10

Reviewed at https://reviews.apache.org/r/16257/
Added extra_modules option to Scheduler.
First steps towards aurora client v2

First step towards aurora client v2!

- Initial implementation of the noun/verb command and options processing framework.
- Initial implementation of a command processing context for aurora commands.
- Implementations of a "Job" noun and "create" and "kill" verbs.
- Tests.

Note: not all of the v1 tests for the create and kill verbs have been migrated to the new
framework; command processing contexts need a bit more work to make it easy to do the
appropriate mocking/stubbing to support them. They'll be in the next change.

Reviewed at https://reviews.apache.org/r/16130/
Now treating empty log file as new log file in test.

Testing Done:
Gradle clean build.

Tested with the isolated scheduler and an empty log file.
?  git:(master) ? ls -lh /tmp/testing_log_file                                                                                                          ~/workspace/incubator-aurora
-rw-r--r--  1 skarumuri  wheel     0B Dec 13 14:56 /tmp/testing_log_file

Ran it on master:

Running on an empty file would result in an exception as follows:

E1213 22:58:26.660 THREAD1 org.apache.zookeeper.server.NIOServerCnxn$Factory$1.uncaughtException: Thread Thread[main,5,main] died
java.lang.IllegalStateException: Failed to open the log, cannot continue
	at com.twitter.aurora.scheduler.storage.log.LogStorage.prepare(LogStorage.java:289)
	at com.twitter.aurora.scheduler.storage.CallOrderEnforcingStorage.prepare(CallOrderEnforcingStorage.java:80)
	at com.twitter.aurora.scheduler.SchedulerLifecycle.prepare(SchedulerLifecycle.java:144)
	at com.twitter.aurora.scheduler.app.SchedulerMain.run(SchedulerMain.java:255)
	at com.twitter.common.application.AppLauncher.run(AppLauncher.java:102)
	at com.twitter.common.application.AppLauncher.launch(AppLauncher.java:181)
	at com.twitter.common.application.AppLauncher.launch(AppLauncher.java:142)
	at com.twitter.aurora.scheduler.app.SchedulerMain.main(SchedulerMain.java:276)
Caused by: java.io.IOException: Failed to interpret log contents: com.twitter.aurora.codec.ThriftBinaryCodec$CodingException: Failed to deserialize thrift object.
	at com.twitter.aurora.scheduler.log.testing.FileLog.open(FileLog.java:80)
	at com.twitter.aurora.scheduler.storage.log.LogManager.open(LogManager.java:123)
	at com.twitter.aurora.scheduler.storage.log.LogStorage.prepare(LogStorage.java:287)
	... 7 more
Caused by: com.twitter.aurora.codec.ThriftBinaryCodec$CodingException: Failed to deserialize thrift object.
	at com.twitter.aurora.codec.ThriftBinaryCodec.decodeNonNull(ThriftBinaryCodec.java:86)
	at com.twitter.aurora.codec.ThriftBinaryCodec.decode(ThriftBinaryCodec.java:59)
	at com.twitter.aurora.scheduler.log.testing.FileLog.open(FileLog.java:67)
	... 9 more
Caused by: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes. (This is often indicative of an internal error on the server side. Please check your server logs.)
	at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
	at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:362)
	at org.apache.thrift.protocol.TBinaryProtocol.readByte(TBinaryProtocol.java:251)
	at org.apache.thrift.protocol.TBinaryProtocol.readFieldBegin(TBinaryProtocol.java:215)
	at com.twitter.aurora.gen.test.FileLogContents$FileLogContentsStandardScheme.read(FileLogContents.java:349)
	at com.twitter.aurora.gen.test.FileLogContents$FileLogContentsStandardScheme.read(FileLogContents.java:342)
	at com.twitter.aurora.gen.test.FileLogContents.read(FileLogContents.java:292)
	at org.apache.thrift.TDeserializer.deserialize(TDeserializer.java:69)
	at com.twitter.aurora.codec.ThriftBinaryCodec.decodeNonNull(ThriftBinaryCodec.java:79)
	... 11 more

I1213 22:58:27.001 THREAD11 org.apache.zookeeper.server.SessionTrackerImpl.run: SessionTrackerImpl exited loop!
UnresettableLogManager is ignoring a reset() request.
I1213 22:58:27.002 THREAD14 com.twitter.common.application.ShutdownRegistry$ShutdownRegistryImpl.execute: Action controller has already completed, subsequent calls ignored.

After the fix: No exception.

Reviewed at https://reviews.apache.org/r/16261/
Rewrite SchedulerLifecycle, employing a state machine.

This change addresses two issues:
  - Ensure leadership is canceled whenever onDefeated is called.
  - Scheduler should wait for registered to be called before attempting to
    invoke driver.

Some additional structural changes were made:
  - Driver.run() is no longer used.  Instead, we invoke Driver.start()
    (non-blocking), and the lifecycle uses Driver.join() to await exit.
    This allows us to avoid jumping through thread-safety hoops in unit tests.
  - A shim interface (DelayedActions) was added to SchedulerLifecycle to make
    testing easier when capturing delayed closures.

Testing Done:
gradle clean build

Reviewed at https://reviews.apache.org/r/16054/
Bumping up python thrift version to 0.9.1

Testing Done:
./pants src/test/python:all

Reviewed at https://reviews.apache.org/r/16266/
Dropping duplicate LOCK error message.

Reviewed at https://reviews.apache.org/r/16310/
Lock should be released if job does not exist

Reviewed at https://reviews.apache.org/r/16268/
Fix thermos glitch in aurora-12.

Fix thermos glitch in aurora-12:

The task list used by the command line was returned as an iterator, but used as a list.

Testing Done:
Ran all unit tests.

Bugs closed: aurora-12

Reviewed at https://reviews.apache.org/r/16326/
Releasing aurora-0.2.0
Bumping up snapshot version to 0.3.0