Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCOS cassandra #396

Merged
merged 2 commits into from
Jul 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Mesos Frameworks
- [x] Aurora framework
- [x] Chronos framework
- [ ] Kubernetes framework
- [ ] Cassandra framework
- [x] Cassandra framework
- [ ] Myriad framework
- [ ] Spark framework
- [ ] Storm framework
Expand Down
3 changes: 3 additions & 0 deletions group_vars/vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ consul_advertise: "{{ ansible_eth1.ipv4.address }}"
consul_bind_addr: "{{ ansible_eth1.ipv4.address }}"
marathon_hostname: "{{ ansible_eth1.ipv4.address }}"
mesos_hostname: "{{ ansible_eth1.ipv4.address }}"
frameworks_marathon_url: "http://{{ ansible_eth1.ipv4.address }}:8080"
frameworks_mesos_master_url: "http://{{ ansible_eth1.ipv4.address }}:5050"

registrator_uri: "consul://{{ ansible_eth1.ipv4.address }}:8500"
weave_launch_peers: "
{%- set weave_peers = [] -%}
Expand Down
1 change: 1 addition & 0 deletions packer/scripts/ubuntu/install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ docker pull weaveworks/weave:${WEAVE_VERSION}
docker pull weaveworks/scope:latest
docker pull mesosphere/marathon:${MARATHON_VERSION}
docker pull mesosphere/chronos:${CHRONOS_VERSION}
docker pull capgemini/dcos-cli:latest

sudo service docker stop
echo manual | sudo tee /etc/init/docker.override >/dev/null
25 changes: 25 additions & 0 deletions roles/frameworks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Role Name
=========

Install mesos frameworks via capgemini:dcos-cli.

Requirements
------------

The tasks inside the role should be run only once, i.e run_once=true

Role Variables
--------------

frameworks_dcos_cli_image: capgemini/dcos-cli
frameworks_zk_master_peers: "zk://{{ zookeeper_peers_nodes }}/mesos"
frameworks_mesos_master_url: "http://{{ ansible_ssh_host }}:5050"
frameworks_marathon_url: "http://{{ ansible_ssh_host }}:8080"

frameworks_FRAMEWORK-NAME_enabled: false

License
-------

BSD

11 changes: 11 additions & 0 deletions roles/frameworks/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# defaults file for frameworks
frameworks_dcos_cli_image: capgemini/dcos-cli
frameworks_zk_master_peers: "zk://{{ zookeeper_peers_nodes }}/mesos"
frameworks_mesos_master_url: "http://{{ ansible_ssh_host }}:{{ mesos_master_port }}"
frameworks_marathon_url: "http://{{ ansible_ssh_host }}:{{ marathon_port }}"

frameworks_cassandra_enabled: false
frameworks_cassandra_node_count: 1
frameworks_list:
- cassandra
2 changes: 2 additions & 0 deletions roles/frameworks/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for frameworks
135 changes: 135 additions & 0 deletions roles/frameworks/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
galaxy_info:
author: Alberto Lamela
description:
company: Capgemini
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
# - 21
# - 22
#- name: SmartOS
# versions:
# - all
# - any
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
# - utopic
# - vivid
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - jessie
# - lenny
# - squeeze
# - wheezy
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
#- cloud
#- cloud:ec2
#- cloud:gce
#- cloud:rax
#- clustering
#- database
#- database:nosql
#- database:sql
#- development
#- monitoring
#- networking
#- packaging
#- system
#- web
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

49 changes: 49 additions & 0 deletions roles/frameworks/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# tasks file for frameworks
- name: "create config directory"
when: "frameworks_{{ item }}_enabled"
run_once: true
template:
src: "{{ item }}-config.j2"
dest: "/tmp/{{ item }}-config"
mode: 0755
sudo: yes
tags:
- "{{ item }}"
with_items:
- "{{ frameworks_list }}"

- name: "install dcos-cli package"
when: "frameworks_{{ item }}_enabled"
run_once: true
docker:
name: "{{ item }}"
image: "{{ frameworks_dcos_cli_image }}"
state: started
command: "package install --options=/config --yes {{ item }}"
volumes:
- "/tmp/{{ item }}-config:/config"
env:
MESOS_MASTER_URL: "{{ frameworks_mesos_master_url }}"
MARATHON_URL: "{{ frameworks_marathon_url }}"
tags:
- "{{ item }}"
with_items:
- "{{ frameworks_list }}"

- name: "uninstall dcos-cli package"
when: "not frameworks_{{ item }}_enabled"
run_once: true
docker:
name: "{{ item }}"
image: "{{ frameworks_dcos_cli_image }}"
state: started
command: "package uninstall {{ item }}"
env:
MESOS_MASTER_URL: "{{ frameworks_mesos_master_url }}"
MARATHON_URL: "{{ frameworks_marathon_url }}"
tags:
- "{{ item }}"
with_items:
- "{{ frameworks_list }}"

7 changes: 7 additions & 0 deletions roles/frameworks/templates/cassandra-config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we expose the other config vars here or just leave it for now? https://github.com/mesosphere/universe/blob/version-1.x/repo/packages/C/cassandra/0/config.json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even expose the minimum required configuration values would be nice with the default in the config.json e.g.
"framework","cluster-name","zk-timeout-ms","node-count","seed-count","health-check-interval-seconds","bootstrap-grace-time-seconds","data-directory","resources"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be a follow-up issue

"mesos": {"master": "{{ frameworks_zk_master_peers }}"},
"cassandra": {
"zk": "zk://{{ zookeeper_peers_nodes }}/cassandra-mesos",
"node-count": {{ frameworks_cassandra_node_count }}
}
}
2 changes: 2 additions & 0 deletions roles/frameworks/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for frameworks
1 change: 1 addition & 0 deletions roles/mesos/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ mesos_resources: "ports(*):[31000-32000]"
mesos_slave_work_dir: "/tmp/mesos"
mesos_ip: "{{ ansible_default_ipv4.address }}"
mesos_hostname: "{{ ansible_ssh_host }}"

5 changes: 5 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
roles:
- haproxy

# Installing DCOS frameworks from one master.
- hosts: mesos_masters
roles:
- frameworks

- include: tests/test.yml
vars_files:
- ../roles/marathon/defaults/main.yml
Expand Down