Clean up setup.py and the Vagrant test.
diff --git a/README.md b/README.md
index c89d721..dda601d 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,6 @@
# Wait for the VM and Mysos API endpoint to come up (http://192.168.33.17:55001 becomes available).
- ./vagrant/test.sh
+ tox -e vagrant
`test.sh` verifies that Mysos successfully creates a MySQL cluster and then deletes it.
diff --git a/setup.py b/setup.py
index b559549..ab01bf7 100644
--- a/setup.py
+++ b/setup.py
@@ -41,15 +41,10 @@
list_package_data_files('mysos/scheduler', 'assets'))
},
install_requires=[
- 'cherrypy==3.2.2',
'kazoo==1.3.1',
'mako==0.4.0',
'mesos.interface{0}'.format(MESOS_VERSION),
- 'mysql-python',
- 'pynacl==0.3.0',
'pyyaml==3.10',
- 'sqlalchemy',
- 'zake==0.2.1',
make_commons_requirement('app'),
make_commons_requirement('collections'),
make_commons_requirement('concurrent'),
@@ -61,15 +56,30 @@
make_commons_requirement('zookeeper'),
],
extras_require={
- 'test': ['webtest',],
- 'driver': ['mesos.native{0}'.format(MESOS_VERSION),],
+ 'test': [
+ 'pynacl>=0.3.0',
+ 'webtest',
+ 'zake==0.2.1',
+ ],
+ 'scheduler': [
+ 'cherrypy==3.2.2',
+ 'mesos.native{0}'.format(MESOS_VERSION),
+ 'pynacl>=0.3.0,<1',
+ ],
+ 'executor': [
+ 'mesos.native{0}'.format(MESOS_VERSION),
+ ],
+ 'test_client': [
+ 'sqlalchemy',
+ 'mysql-python'
+ ]
},
entry_points={
'console_scripts': [
- 'mysos_scheduler=mysos.scheduler.mysos_scheduler:proxy_main [driver]',
- 'mysos_executor=mysos.executor.mysos_executor:proxy_main [driver]',
- 'vagrant_mysos_executor=mysos.executor.testing.vagrant_mysos_executor:proxy_main [driver]',
- 'mysos_test_client=mysos.testing.mysos_test_client:proxy_main',
+ 'mysos_scheduler=mysos.scheduler.mysos_scheduler:proxy_main [scheduler]',
+ 'mysos_executor=mysos.executor.mysos_executor:proxy_main [executor]',
+ 'vagrant_mysos_executor=mysos.executor.testing.vagrant_mysos_executor:proxy_main [executor]',
+ 'mysos_test_client=mysos.testing.mysos_test_client:proxy_main [test_client]',
],
},
)
diff --git a/tox.ini b/tox.ini
index cf6f944..7d4fd2d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,7 @@
whitelist_externals=mkdir
commands =
mkdir -p {toxinidir}/dist/
- pip install --find-links {toxinidir}/3rdparty -e .[driver]
+ pip install --find-links {toxinidir}/3rdparty -e .[scheduler]
pex \
--source-dir={toxinidir} \
--output-file={toxinidir}/dist/fake_mysos_executor.pex \
@@ -32,3 +32,9 @@
twitter.checkstyle==0.1.0
skip_install = True
commands = twitterstyle -n ImportOrder mysos tests
+
+# This currently requires the Vagrant VM to be up.
+# TODO(jyx): Launch Vagrant here directly.
+[testenv:vagrant]
+install_command = pip install -e .[test_client] --find-links {toxinidir}/3rdparty {opts} {packages}
+commands = {toxinidir}/vagrant/test.sh
diff --git a/vagrant/bin/mysos_executor.sh b/vagrant/bin/mysos_executor.sh
index d9738f1..474cd0e 100755
--- a/vagrant/bin/mysos_executor.sh
+++ b/vagrant/bin/mysos_executor.sh
@@ -6,7 +6,11 @@
# Using python to run pip and vagrant_mysos_executor because the shebang in venv/bin/pip can
# exceed system limit and cannot be executed directly.
+
+# 'protobuf' is a a dependency of mesos.interface's but we install it separately because otherwise
+# 3.0.0-alpha is installed and it breaks the mesos.interface install.
+venv/bin/python venv/bin/pip install 'protobuf==2.6.1'
venv/bin/python venv/bin/pip install --find-links /home/vagrant/mysos/deps mesos.native
-venv/bin/python venv/bin/pip install --pre --find-links . mysos
+venv/bin/python venv/bin/pip install --pre --find-links . mysos[executor]
venv/bin/python venv/bin/vagrant_mysos_executor
diff --git a/vagrant/bin/mysos_scheduler.sh b/vagrant/bin/mysos_scheduler.sh
index c6ada7a..c050591 100755
--- a/vagrant/bin/mysos_scheduler.sh
+++ b/vagrant/bin/mysos_scheduler.sh
@@ -5,8 +5,12 @@
TMPDIR=$(mktemp -d)
virtualenv $TMPDIR # Create venv under /tmp.
+
+# 'protobuf' is a dependency of mesos.interface's but we install it separately because otherwise
+# 3.0.0-alpha is installed and it breaks the mesos.interface install.
+$TMPDIR/bin/pip install 'protobuf==2.6.1'
$TMPDIR/bin/pip install --find-links /home/vagrant/mysos/deps mesos.native
-$TMPDIR/bin/pip install --pre --find-links /home/vagrant/mysos/dist mysos
+$TMPDIR/bin/pip install --pre --find-links /home/vagrant/mysos/dist mysos[scheduler]
ZK_HOST=192.168.33.17
API_PORT=55001
diff --git a/vagrant/provision-dev-cluster.sh b/vagrant/provision-dev-cluster.sh
index d8390cf..55a0b17 100755
--- a/vagrant/provision-dev-cluster.sh
+++ b/vagrant/provision-dev-cluster.sh
@@ -6,19 +6,15 @@
export DEBIAN_FRONTEND=noninteractive
aptitude update -q
aptitude install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
- libcurl3-dev \
- libsasl2-dev \
+ curl \ # We use curl --silent to download pakcages.
+ libcurl3-dev \ # Mesos requirement.
+ libsasl2-dev \ # Mesos requirement.
python-dev \
zookeeper \
mysql-server-5.6 \
libmysqlclient-dev \
- libunwind8 \
python-virtualenv \
- bison flex # For libnl.
-
-# Fix up a dependency issue of Mesos egg: _mesos.so links to libunwind.so.7 but Trusty only has
-# libunwind.so.8.
-ln -sf /usr/lib/x86_64-linux-gnu/libunwind.so.8 /usr/lib/x86_64-linux-gnu/libunwind.so.7
+ libffi-dev # For pynacl.
# Fix up Ubuntu mysql-server-5.6 issue: mysql_install_db looks for this file even if we don't need
# it.
@@ -38,7 +34,6 @@
# Install the upstart configurations.
sudo cp /home/vagrant/mysos/vagrant/upstart/*.conf /etc/init
-chown -R vagrant:vagrant /home/vagrant/mysos
EOF
chmod +x /usr/local/bin/update-mysos
sudo -u vagrant update-mysos
diff --git a/vagrant/test.sh b/vagrant/test.sh
index a0b69c9..bbfe21f 100755
--- a/vagrant/test.sh
+++ b/vagrant/test.sh
@@ -11,7 +11,7 @@
cluster_user="mysos"
HERE="$(cd "$(dirname "$0")" && pwd)"
-executable=$HERE/../.tox/py27/bin/mysos_test_client
+executable=$HERE/../.tox/vagrant/bin/mysos_test_client
if [ ! -f ${executable} ]; then
echo "${executable} doesn't exist. Build it first."