Repository: aurora Updated Branches: refs/heads/master 653758131 -> 12be6fb72
Speed up Vagrant provisioning by using a custom base box. Reviewed at https://reviews.apache.org/r/44871/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/12be6fb7 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/12be6fb7 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/12be6fb7 Branch: refs/heads/master Commit: 12be6fb7293e71c1a98987c14dae3d4838bbfd5f Parents: 6537581 Author: Bill Farner <[email protected]> Authored: Thu Mar 17 18:07:00 2016 -0700 Committer: Bill Farner <[email protected]> Committed: Thu Mar 17 18:07:00 2016 -0700 ---------------------------------------------------------------------- .gitignore | 2 +- Vagrantfile | 3 +- build-support/packer/README.md | 59 ++++++++++ build-support/packer/aurora.json | 25 ++++ build-support/packer/build.sh | 118 +++++++++++++++++++ examples/vagrant/mesos_config/README.md | 10 ++ .../vagrant/mesos_config/etc_mesos-master/ip | 1 + .../vagrant/mesos_config/etc_mesos-master/roles | 1 + .../mesos_config/etc_mesos-slave/containerizers | 1 + .../mesos_config/etc_mesos-slave/hostname | 1 + .../vagrant/mesos_config/etc_mesos-slave/ip | 1 + .../mesos_config/etc_mesos-slave/modules | 12 ++ .../etc_mesos-slave/resource_estimator | 1 + .../mesos_config/etc_mesos-slave/resources | 1 + .../mesos_config/etc_mesos-slave/work_dir | 1 + examples/vagrant/provision-dev-cluster.sh | 63 +++------- .../upstart/aurora-scheduler-kerberos.conf | 2 +- examples/vagrant/upstart/aurora-scheduler.conf | 2 +- examples/vagrant/upstart/mesos-master.conf | 27 ----- examples/vagrant/upstart/mesos-slave.conf | 44 ------- 20 files changed, 253 insertions(+), 122 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 1af09a2..56808d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# SYNTAX NOTE: dist/ will ignore any directory named dist. Use dist/* to ignore dist in project root. +*.box *.iml *.ipr *.iws http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/Vagrantfile ---------------------------------------------------------------------- diff --git a/Vagrantfile b/Vagrantfile index 2d6c2ae..4ebf7d9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,7 +23,8 @@ Vagrant.require_version ">= 1.5.0" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = "aurora.local" - config.vm.box = "ubuntu/trusty64" + # See build-support/packer/README.md for instructions on updating this box. + config.vm.box = "apache-aurora/dev-environment" config.vm.define "devcluster" do |dev| dev.vm.network :private_network, ip: "192.168.33.7" http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/build-support/packer/README.md ---------------------------------------------------------------------- diff --git a/build-support/packer/README.md b/build-support/packer/README.md new file mode 100644 index 0000000..c76b909 --- /dev/null +++ b/build-support/packer/README.md @@ -0,0 +1,59 @@ +# Apache Aurora development environment + +This directory contains [Packer](https://packer.io) scripts +to build and distribute the base development environment for Aurora. + +The goal of this environment is to pre-fetch dependencies and artifacts +needed for the integration test environment so that `vagrant up` is +cheap after the box has been fetched for the first time. + +As dependencies (libraries, or external packages) of Aurora change, it +will be helpful to update this box and keep this cost low. + +## Updating the box + +1. Download [packer](https://www.packer.io/downloads.html) + +2. Modify build scripts to make the changes you want + (e.g. install packages via `apt`) + +3. Fetch the latest version of our base box + + $ vagrant box update --box ubuntu/trusty64 + + The box will be stored in version-specific directories under + `~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/`. Find the path to the `.ovf` file for the + latest version of the box. In the following step, this path will be referred to as + `$UBUNTU_OVF`. + +4. Build the new box + Using the path from the previous step, run the following command to start the build. + + $ packer build -var 'base_box_ovf=$UBUNTU_OVF' aurora.json + + This takes a while, approximately 20 minutes. When finished, your working directory will + contain a file named `packer_virtualbox-ovf_virtualbox.box`. + +5. Verify your box locally + + $ vagrant box add --name aurora-dev-env-testing \ + packer_virtualbox-ovf_virtualbox.box + + This will make a vagrant box named `aurora-dev-env-testing` locally available to vagrant + (i.e. not on Vagrant Cloud). We use a different name here to avoid confusion that could + arise from using an unreleased base box. + + Edit the [`Vagrantfile`](../../Vagrantfile), changing the line + + config.vm.box = "apache-aurora/dev-environment" + + to + + config.vm.box = "aurora-dev-env-testing" + + At this point, you can use the box as normal to run integraion tests. + +6. Upload the box to Vagrant Cloud + Our boxes are stored [here](https://atlas.hashicorp.com/apache-aurora/boxes/dev-environment). + You must have committer access to upload a dev image box, please + ask in [email protected] if you would like to contribute. http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/build-support/packer/aurora.json ---------------------------------------------------------------------- diff --git a/build-support/packer/aurora.json b/build-support/packer/aurora.json new file mode 100644 index 0000000..043b3d1 --- /dev/null +++ b/build-support/packer/aurora.json @@ -0,0 +1,25 @@ +{ + "variables": { + "base_box_ovf": null + }, + "builders": [{ + "type": "virtualbox-ovf", + "source_path": "{{user `base_box_ovf`}}", + "ssh_username": "vagrant", + "ssh_password": "vagrant", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "headless": true, + "vboxmanage": [ + ["modifyvm", "{{.Name}}", "--memory", "4096"], + ["modifyvm", "{{.Name}}", "--cpus", "2"] + ] + }], + "provisioners": [{ + "type": "shell", + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", + "scripts": [ + "build.sh" + ] + }], + "post-processors": ["vagrant"] +} http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/build-support/packer/build.sh ---------------------------------------------------------------------- diff --git a/build-support/packer/build.sh b/build-support/packer/build.sh new file mode 100644 index 0000000..e26f8e6 --- /dev/null +++ b/build-support/packer/build.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -o errexit +set -o nounset +set -o verbose + +readonly MESOS_VERSION=0.26.0 + +function remove_unused { + # The default ubuntu/trusty64 image includes juju-core, which adds ~300 MB to our image. + apt-get purge -y --auto-remove juju-core + + rm -f /home/vagrant/VBoxGuestAdditions.iso +} + +function install_base_packages { + add-apt-repository ppa:openjdk-r/ppa -y + apt-get update + apt-get -y install \ + bison \ + curl \ + git \ + libapr1-dev \ + libcurl4-nss-dev \ + libsasl2-dev \ + libsvn-dev \ + openjdk-8-jdk \ + python-dev + update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java + # Installing zookeeperd as a separate command, as otherwise openjdk-7-jdk is also installed. + apt-get install -y zookeeperd +} + +function install_docker { + # Instructions from https://docs.docker.com/engine/installation/linux/ubuntulinux/ + apt-get install apt-transport-https ca-certificates + apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 \ + --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' \ + > /etc/apt/sources.list.d/docker.list + apt-get update + apt-get -y install \ + linux-image-extra-$(uname -r) \ + apparmor \ + docker-engine +} + +function install_mesos { + URL_BASE='http://downloads.mesosphere.io/master/ubuntu/14.04' + DEB_URL="$URL_BASE/mesos_${MESOS_VERSION}-0.2.145.ubuntu1404_amd64.deb" + deb=$(basename $DEB_URL) + wget -c "$DEB_URL" + dpkg --install $deb + rm $deb +} + +function install_thrift { + # Install thrift, needed for code generation in the scheduler build. + curl -sSL http://apache.org/dist/thrift/KEYS | gpg --import - + gpg --export --armor 66B778F9 | apt-key add - + echo 'deb http://www.apache.org/dist/thrift/debian 0.9.1 main' \ + > /etc/apt/sources.list.d/thrift.list + apt-get update + apt-get install thrift-compiler=0.9.1 +} + +function warm_artifact_cache { + # Gradle caches in the user's home directory. Since development commands + # are executed by the vagrant user, switch to that user. + su - vagrant -c ' + git clone --depth 1 https://github.com/apache/aurora.git + pushd aurora + ./build-support/jenkins/build.sh + popd + rm -rf aurora' + + THIRD_PARTY_DIR=/home/vagrant/aurora/third_party + mkdir -p "$THIRD_PARTY_DIR" + + # Fetch the mesos egg, needed to build python components. + # The mesos.native target in 3rdparty/python/BUILD expects to find the native egg in third_party. + SVN_ROOT='https://svn.apache.org/repos/asf/aurora/3rdparty' + pushd "$THIRD_PARTY_DIR" + wget -c ${SVN_ROOT}/ubuntu/trusty64/python/mesos.native-${MESOS_VERSION}-py2.7-linux-x86_64.egg + popd + + chown -R vagrant:vagrant aurora +} + +function compact_box { + apt-get clean + + # By design, this will fail as it writes until the disk is full. + dd if=/dev/zero of=/junk bs=1M || true + rm -f /junk + sync +} + +remove_unused +install_base_packages +install_docker +install_mesos +install_thrift +warm_artifact_cache +compact_box http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/README.md ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/README.md b/examples/vagrant/mesos_config/README.md new file mode 100644 index 0000000..3943ba6 --- /dev/null +++ b/examples/vagrant/mesos_config/README.md @@ -0,0 +1,10 @@ +# Configuring the mesos package provided by mesosphere + +The mesosphere mesos package for debian is configured by creating files whose names match command +line argument and environment variables. + +When setting up our environment, the files under directories `etc_mesos-master` and +`etc_mesos-slave` are copied to `/etc/mesos-master` and `/etc/mesos-slave`, respectively. + +For more details, and the script that reads these files, see +[here](https://github.com/mesosphere/mesos-deb-packaging/blob/fd3c3866a847d07a8beb0cf8811f173406f910df/mesos-init-wrapper#L12-L48). http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-master/ip ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-master/ip b/examples/vagrant/mesos_config/etc_mesos-master/ip new file mode 100644 index 0000000..d64ac81 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-master/ip @@ -0,0 +1 @@ +192.168.33.7 http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-master/roles ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-master/roles b/examples/vagrant/mesos_config/etc_mesos-master/roles new file mode 100644 index 0000000..70c476f --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-master/roles @@ -0,0 +1 @@ +aurora-role http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/containerizers ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/containerizers b/examples/vagrant/mesos_config/etc_mesos-slave/containerizers new file mode 100644 index 0000000..7cea98b --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/containerizers @@ -0,0 +1 @@ +docker,mesos http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/hostname ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/hostname b/examples/vagrant/mesos_config/etc_mesos-slave/hostname new file mode 100644 index 0000000..d64ac81 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/hostname @@ -0,0 +1 @@ +192.168.33.7 http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/ip ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/ip b/examples/vagrant/mesos_config/etc_mesos-slave/ip new file mode 100644 index 0000000..d64ac81 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/ip @@ -0,0 +1 @@ +192.168.33.7 http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/modules ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/modules b/examples/vagrant/mesos_config/etc_mesos-slave/modules new file mode 100644 index 0000000..4352bca --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/modules @@ -0,0 +1,12 @@ +{ + "libraries": { + "file": "/usr/lib/libfixed_resource_estimator.so", + "modules": { + "name": "org_apache_mesos_FixedResourceEstimator", + "parameters": { + "key": "resources", + "value": "cpus:3" + } + } + } +} http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/resource_estimator ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/resource_estimator b/examples/vagrant/mesos_config/etc_mesos-slave/resource_estimator new file mode 100644 index 0000000..3b47356 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/resource_estimator @@ -0,0 +1 @@ +org_apache_mesos_FixedResourceEstimator http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/resources ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/resources b/examples/vagrant/mesos_config/etc_mesos-slave/resources new file mode 100644 index 0000000..5bfe779 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/resources @@ -0,0 +1 @@ +cpus(aurora-role):0.5;cpus(*):3.5;mem(aurora-role):1024;disk:20000 http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/mesos_config/etc_mesos-slave/work_dir ---------------------------------------------------------------------- diff --git a/examples/vagrant/mesos_config/etc_mesos-slave/work_dir b/examples/vagrant/mesos_config/etc_mesos-slave/work_dir new file mode 100644 index 0000000..0ba2698 --- /dev/null +++ b/examples/vagrant/mesos_config/etc_mesos-slave/work_dir @@ -0,0 +1 @@ +/var/lib/mesos http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/provision-dev-cluster.sh ---------------------------------------------------------------------- diff --git a/examples/vagrant/provision-dev-cluster.sh b/examples/vagrant/provision-dev-cluster.sh index df33a30..b1f661e 100755 --- a/examples/vagrant/provision-dev-cluster.sh +++ b/examples/vagrant/provision-dev-cluster.sh @@ -13,56 +13,18 @@ # limitations under the License. # -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 -echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list -add-apt-repository ppa:openjdk-r/ppa -y -apt-get update -apt-get -y install \ - bison \ - curl \ - git \ - libapr1-dev \ - libcurl4-nss-dev \ - libsasl2-dev \ - libsvn-dev \ - lxc-docker \ - openjdk-8-jdk \ - python-dev \ - zookeeperd - -update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +#################################################################################################### +# NOTE: When making changes to this file (especially if you are installing new packages), consider +# instead making changes to the base vagrant box (see build-support/packer/README.md). +#################################################################################################### readonly IP_ADDRESS=192.168.33.7 -readonly MESOS_VERSION=0.26.0 - function prepare_extras() { pushd aurora - # Fetch the mesos egg, needed to build python components. - # The mesos.native target in 3rdparty/python/BUILD expects to find the native egg in third_party. - mkdir -p third_party - pushd third_party - wget -c https://svn.apache.org/repos/asf/aurora/3rdparty/ubuntu/trusty64/python/mesos.native-${MESOS_VERSION}-py2.7-linux-x86_64.egg - popd - - # Install thrift, needed for code generation in the scheduler build. - curl -sSL http://apache.org/dist/thrift/KEYS | gpg --import - - gpg --export --armor 66B778F9 | sudo apt-key add - - echo 'deb http://www.apache.org/dist/thrift/debian 0.9.1 main' > /etc/apt/sources.list.d/thrift.list - apt-get update - apt-get install thrift-compiler=0.9.1 - # Include build script in default PATH. ln -sf /home/vagrant/aurora/examples/vagrant/aurorabuild.sh /usr/local/bin/aurorabuild popd - - sudo chown -R vagrant:vagrant aurora -} - -function install_mesos { - deb=mesos_${MESOS_VERSION}-0.2.145.ubuntu1404_amd64.deb - wget -c http://downloads.mesosphere.io/master/ubuntu/14.04/$deb - dpkg --install $deb } function install_cluster_config { @@ -103,27 +65,34 @@ function sudoless_docker_setup { } function start_services { - #Executing true on failure to please bash -e in case services are already running + # Executing true on failure to please bash -e in case services are already running start zookeeper || true - start mesos-master || true - start mesos-slave || true } function prepare_sources { + # Assign mesos command line arguments. + cp /vagrant/examples/vagrant/mesos_config/etc_mesos-slave/* /etc/mesos-slave + cp /vagrant/examples/vagrant/mesos_config/etc_mesos-master/* /etc/mesos-master + stop mesos-master || true + stop mesos-slave || true + start mesos-master + start mesos-slave + cat > /usr/local/bin/update-sources <<EOF #!/bin/bash rsync -urzvhl /vagrant/ /home/vagrant/aurora \ --filter=':- /vagrant/.gitignore' \ --exclude=.git \ + --exclude=/third_party \ --delete # Install/update the upstart configurations. sudo cp /vagrant/examples/vagrant/upstart/*.conf /etc/init EOF chmod +x /usr/local/bin/update-sources - update-sources + update-sources > /dev/null + chown -R vagrant:vagrant /home/vagrant } -install_mesos prepare_sources prepare_extras install_cluster_config http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/upstart/aurora-scheduler-kerberos.conf ---------------------------------------------------------------------- diff --git a/examples/vagrant/upstart/aurora-scheduler-kerberos.conf b/examples/vagrant/upstart/aurora-scheduler-kerberos.conf index eec5ee3..f1852f1 100644 --- a/examples/vagrant/upstart/aurora-scheduler-kerberos.conf +++ b/examples/vagrant/upstart/aurora-scheduler-kerberos.conf @@ -39,7 +39,7 @@ exec bin/aurora-scheduler \ -hostname=aurora.local \ -native_log_quorum_size=1 \ -zk_endpoints=localhost:2181 \ - -mesos_master_address=zk://localhost:2181/mesos/master \ + -mesos_master_address=zk://localhost:2181/mesos \ -serverset_path=/aurora/scheduler \ -native_log_zk_group_path=/aurora/replicated-log \ -native_log_file_path=/var/db/aurora \ http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/upstart/aurora-scheduler.conf ---------------------------------------------------------------------- diff --git a/examples/vagrant/upstart/aurora-scheduler.conf b/examples/vagrant/upstart/aurora-scheduler.conf index 7e10b2c..120b89a 100644 --- a/examples/vagrant/upstart/aurora-scheduler.conf +++ b/examples/vagrant/upstart/aurora-scheduler.conf @@ -34,7 +34,7 @@ exec bin/aurora-scheduler \ -http_port=8081 \ -native_log_quorum_size=1 \ -zk_endpoints=localhost:2181 \ - -mesos_master_address=zk://localhost:2181/mesos/master \ + -mesos_master_address=zk://localhost:2181/mesos \ -serverset_path=/aurora/scheduler \ -native_log_zk_group_path=/aurora/replicated-log \ -native_log_file_path=/var/db/aurora \ http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/upstart/mesos-master.conf ---------------------------------------------------------------------- diff --git a/examples/vagrant/upstart/mesos-master.conf b/examples/vagrant/upstart/mesos-master.conf deleted file mode 100644 index a2ed953..0000000 --- a/examples/vagrant/upstart/mesos-master.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -description "mesos master" -start on stopped rc RUNLEVEL=[2345] -respawn -post-stop exec sleep 5 - -env LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -env MY_HOST=192.168.33.7 -env ZK_HOST=192.168.33.7 - -exec /usr/sbin/mesos-master \ - --zk=zk://$ZK_HOST:2181/mesos/master \ - --ip=$MY_HOST \ - --work_dir=/usr/local/aurora/master/db \ - --roles=aurora-role \ - --quorum=1 http://git-wip-us.apache.org/repos/asf/aurora/blob/12be6fb7/examples/vagrant/upstart/mesos-slave.conf ---------------------------------------------------------------------- diff --git a/examples/vagrant/upstart/mesos-slave.conf b/examples/vagrant/upstart/mesos-slave.conf deleted file mode 100644 index d97fa1f..0000000 --- a/examples/vagrant/upstart/mesos-slave.conf +++ /dev/null @@ -1,44 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -description "mesos slave" -start on stopped rc RUNLEVEL=[2345] -respawn -post-stop exec sleep 5 - -env LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -env MY_HOST=192.168.33.7 -env ZK_HOST=192.168.33.7 - -# TODO(ksweeney): Scheduler assumes 'rack' and 'host' are present. Make them optional. -# N.B. The value for --work_dir must match the value configured for the slave_root in -# examples/vagrant/provision-dev-cluster.sh. C.f. AURORA-680 for the client fix to -# obviate that need. -exec /usr/sbin/mesos-slave --master=zk://$ZK_HOST:2181/mesos/master \ - --ip=$MY_HOST \ - --hostname=$MY_HOST \ - --resources="cpus(aurora-role):0.5;cpus(*):3.5;mem(aurora-role):1024;disk:20000" \ - --work_dir="/var/lib/mesos" \ - --containerizers=docker,mesos \ - --resource_estimator="org_apache_mesos_FixedResourceEstimator" \ - --modules='{ - "libraries": { - "file": "/usr/lib/libfixed_resource_estimator.so", - "modules": { - "name": "org_apache_mesos_FixedResourceEstimator", - "parameters": { - "key": "resources", - "value": "cpus:3" - } - } - } - }'
