Add elements for building a Mesos bay node image
These diskimage-builder elements install Docker, Zookeeper, Mesos and Marathon in a Ubuntu Trusty image. Change-Id: Ia299554c0367a0de0fbff31f7740970bf3fdb010 Partial-Implements: blueprint mesos-bay-type
This commit is contained in:
parent
9443357a4f
commit
33e742207b
|
@ -0,0 +1,27 @@
|
|||
Mesos elements
|
||||
==============
|
||||
|
||||
This directory contains `[diskimage-builder](https://github.com/openstack/diskimage-builder)`
|
||||
elements to build an image which contains mesos and its frameworks required to
|
||||
use the heat template mesoscluster.yaml.
|
||||
|
||||
Currently, only Ubuntu 14.04 is supported. An example Ubuntu based image can be
|
||||
built and uploaded to glance as follows:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install git qemu-utils python-pip
|
||||
sudo pip install pyyaml
|
||||
|
||||
git clone https://git.openstack.org/openstack/magnum
|
||||
git clone https://git.openstack.org/openstack/diskimage-builder.git
|
||||
git clone https://git.openstack.org/openstack/dib-utils.git
|
||||
export PATH="${PWD}/dib-utils/bin:$PATH"
|
||||
export ELEMENTS_PATH=magnum/magnum/templates/heat-mesos/elements
|
||||
export DIB_RELEASE=trusty
|
||||
|
||||
diskimage-builder/bin/disk-image-create ubuntu vm docker mesos \
|
||||
-o ubuntu-mesos.qcow2
|
||||
|
||||
glance image-create --name ubuntu-mesos --is-public True \
|
||||
--disk-format=qcow2 --container-format=bare \
|
||||
--property os_distro=ubuntu --file=ubuntu-mesos.qcow2
|
|
@ -0,0 +1 @@
|
|||
package-installs
|
|
@ -0,0 +1 @@
|
|||
lxc-docker:
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2015 Huawei Technologies Co.,LTD.
|
||||
#
|
||||
# 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.
|
||||
|
||||
service docker stop
|
||||
[ -f /etc/init/docker.conf ] && echo "manual" > /etc/init/docker.override
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2015 Huawei Technologies Co.,LTD.
|
||||
#
|
||||
# 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.
|
||||
|
||||
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||
set -x
|
||||
fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
wget -qO- https://get.docker.com/gpg | sudo apt-key add -
|
||||
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Add the repository
|
||||
echo "deb https://get.docker.com/${DISTRO} docker main" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list
|
|
@ -0,0 +1 @@
|
|||
package-installs
|
|
@ -0,0 +1,3 @@
|
|||
zookeeperd:
|
||||
mesos:
|
||||
marathon:
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2015 Huawei Technologies Co.,LTD.
|
||||
#
|
||||
# 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.
|
||||
|
||||
for service in zookeeper mesos-slave mesos-master marathon; do
|
||||
service $service stop
|
||||
[ -f /etc/init/$service.conf ] && echo "manual" > /etc/init/$service.override
|
||||
done
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2015 Huawei Technologies Co.,LTD.
|
||||
#
|
||||
# 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.
|
||||
|
||||
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||
set -x
|
||||
fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
|
||||
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
|
||||
CODENAME=$(lsb_release -cs)
|
||||
|
||||
# Add the repository
|
||||
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | \
|
||||
sudo tee /etc/apt/sources.list.d/mesosphere.list
|
Loading…
Reference in New Issue