Merge lp:~michael.nelson/charms/trusty/elasticsearch/update-readme into lp:~charmers/charms/trusty/elasticsearch/trunk

Proposed by Michael Nelson
Status: Merged
Merged at revision: 31
Proposed branch: lp:~michael.nelson/charms/trusty/elasticsearch/update-readme
Merge into: lp:~charmers/charms/trusty/elasticsearch/trunk
Diff against target: 201 lines (+58/-54)
6 files modified
HACKING.md (+17/-0)
Makefile (+6/-5)
README.md (+33/-26)
config.yaml (+1/-7)
hooks/hooks.py (+1/-2)
unit_tests/test_hooks.py (+0/-14)
To merge this branch: bzr merge lp:~michael.nelson/charms/trusty/elasticsearch/update-readme
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
Review via email: mp+225802@code.launchpad.net

Commit message

Fix issues in readme, update default to elasticsearch 1.2.

Description of the change

* Simplify and correct README.
* Edit out local deployment info into a separate HACKING.md.
* Remove the install-ansible-from-ppa option since this charm is trusty
  only and a suitable version of ansible is in trusty.
* Update the default repo to the 1.2 elasticsearch repo.

To post a comment you must log in.
Revision history for this message
Charles Butler (lazypower) wrote :

+1 LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'HACKING.md'
--- HACKING.md 1970-01-01 00:00:00 +0000
+++ HACKING.md 2014-07-07 10:33:22 +0000
@@ -0,0 +1,17 @@
1# Local development
2
3To deploy ElasticSearch locally, pull the bzr branch into your
4local charm repository and deploy from there:
5
6 mkdir -p ~/charms/trusty && cd ~/charms/trusty
7 charm-get trusty/elasticsearch
8 juju bootstrap
9 juju deploy --repository=../.. local:elasticsearch
10
11
12# Testing the ElasticSearch charm
13
14Run the unit-tests with `make test`.
15
16Run the functional tests with `juju test`.
17
018
=== modified file 'Makefile'
--- Makefile 2014-06-06 14:40:08 +0000
+++ Makefile 2014-07-07 10:33:22 +0000
@@ -12,6 +12,12 @@
12 @echo Starting unit tests...12 @echo Starting unit tests...
13 @PYTHONPATH=./hooks $(PYTHON) /usr/bin/nosetests3 --nologcapture unit_tests13 @PYTHONPATH=./hooks $(PYTHON) /usr/bin/nosetests3 --nologcapture unit_tests
1414
15deploy:
16 @echo Deploying local elasticsearch charm
17 @juju deploy --num-units=2 --repository=../.. local:trusty/elasticsearch
18
19
20# The following targets are used for charm maintenance only.
15bin/charm_helpers_sync.py:21bin/charm_helpers_sync.py:
16 @bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \22 @bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
17 > bin/charm_helpers_sync.py23 > bin/charm_helpers_sync.py
@@ -19,8 +25,3 @@
19sync-charm-helpers: bin/charm_helpers_sync.py25sync-charm-helpers: bin/charm_helpers_sync.py
20 @$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers.yaml26 @$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers.yaml
2127
22deploy:
23 @echo Deploying local elasticsearch charm
24 @juju deploy --num-units=3 --repository=../.. local:precise/elasticsearch
25 @juju deploy nrpe-external-master
26 @juju add-relation nrpe-external-master elasticsearch
2728
=== modified file 'README.md'
--- README.md 2014-05-27 14:23:50 +0000
+++ README.md 2014-07-07 10:33:22 +0000
@@ -1,24 +1,38 @@
1# Getting started with ElasticSearch1# Overview
22
3To deploy ElasticSearch locally:3Elasticsearch is a flexible and powerful open source, distributed, real-time
44search and analytics engine. Architected from the ground up for use in
5 juju bootstrap5distributed environments where reliability and scalability are must haves,
6 juju deploy --repository=../.. local:elasticsearch6Elasticsearch gives you the ability to move easily beyond simple full-text
77search. Through its robust set of APIs and query DSLs, plus clients for the
8You can add more units and they will discover each other and8most popular programming languages, Elasticsearch delivers on the near
9join the cluster.9limitless promises of search technology.
10
11Except from [elasticsearch.org](http://www.elasticsearch.org/overview/ "Elasticsearch Overview")
12
13
14# Usage
15
16Deploy two units from the charmstore with:
17
18 juju deploy --num-units 2 cs:trusty/elasticsearch
19
20And when they have started you can inspect the cluster health:
21
22 juju ssh elasticsearch/0 "curl http://localhost:9200/_cat/health?v"
23 epoch timestamp cluster status node.total node.data shards ...
24 1404728290 10:18:10 elasticsearch green 2 2 0
25
26See the separate HACKING.md for information about deploying this charm
27from a local repository.
1028
1129
12## Relating to the Elasticsearch cluster30## Relating to the Elasticsearch cluster
1331
14This charm currently provides the website http interface to the32This charm currently provides the elasticsearch client interface to the
15consuming service, ie. the private address of an elasticsearch unit. The33consuming service (cluster-name, host and port). Normally the other service
16consuming service can use this on the website-relation-joined34will only need this data from one elasticsearch unit to start as most client
17relation to query the cluster for the list of nodes (many client35libraries then query for the list of backends [1].
18elasticsearch apis will do this for you [1]).
19
20If it's needed, we can add an elasticsearch cluster interface that
21returns the lists of hosts in the cluster.
2236
23[1] http://elasticsearch-py.readthedocs.org/en/latest/api.html#elasticsearch37[1] http://elasticsearch-py.readthedocs.org/en/latest/api.html#elasticsearch
2438
@@ -26,21 +40,14 @@
26## Discovery40## Discovery
2741
28This charm uses unicast discovery which utilises the orchestration42This charm uses unicast discovery which utilises the orchestration
29of juju so that the discovery method is the same whether you deploy43of juju so that whether you deploy on ec2, lxc or any other cloud
30on EC2, lxc or any other cloud provider.44provider, the functionality for discovering other nodes remains the same.
3145
32When a new unit first joins the cluster, it will update its config46When a new unit first joins the cluster, it will update its config
33with the other units in the cluster (via the peer-relation-joined47with the other units in the cluster (via the peer-relation-joined
34hook), after which ElasticSearch handles the rest.48hook), after which ElasticSearch handles the rest.
3549
3650
37## Testing the ElasticSearch charm
38
39Run the unit-tests with `make test`.
40
41Run the functional tests with `juju test`.
42
43
44## Downloading ElasticSearch51## Downloading ElasticSearch
4552
46This charm installs elasticsearch from a configured apt repository.53This charm installs elasticsearch from a configured apt repository.
4754
=== modified file 'config.yaml'
--- config.yaml 2014-05-26 14:47:16 +0000
+++ config.yaml 2014-07-07 10:33:22 +0000
@@ -1,7 +1,7 @@
1options:1options:
2 apt-repository:2 apt-repository:
3 type: string3 type: string
4 default: "deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main"4 default: "deb http://packages.elasticsearch.org/elasticsearch/1.2/debian stable main"
5 description: |5 description: |
6 A deb-line for the apt archive which contains the elasticsearch package.6 A deb-line for the apt archive which contains the elasticsearch package.
7 This is necessary until elasticsearch gets into the debian/ubuntu archives.7 This is necessary until elasticsearch gets into the debian/ubuntu archives.
@@ -15,9 +15,3 @@
15 default: "elasticsearch"15 default: "elasticsearch"
16 description: |16 description: |
17 This sets the elasticsearch cluster name.17 This sets the elasticsearch cluster name.
18 install-ansible-from-ppa:
19 type: boolean
20 default: true
21 description: |
22 By default ansible will be installed from the Ansible ppa. You can
23 set this to false for your deployments if you have ansible available
2418
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2014-05-27 08:05:37 +0000
+++ hooks/hooks.py 2014-07-07 10:33:22 +0000
@@ -27,9 +27,8 @@
27 """Install ansible before running the tasks tagged with 'install'."""27 """Install ansible before running the tasks tagged with 'install'."""
28 # Allow charm users to run preinstall setup.28 # Allow charm users to run preinstall setup.
29 charmhelpers.payload.execd.execd_preinstall()29 charmhelpers.payload.execd.execd_preinstall()
30 config = charmhelpers.core.hookenv.config()
31 charmhelpers.contrib.ansible.install_ansible_support(30 charmhelpers.contrib.ansible.install_ansible_support(
32 from_ppa=config['install-ansible-from-ppa'])31 from_ppa=False)
3332
3433
35if __name__ == "__main__":34if __name__ == "__main__":
3635
=== modified file 'unit_tests/test_hooks.py'
--- unit_tests/test_hooks.py 2014-02-18 13:46:55 +0000
+++ unit_tests/test_hooks.py 2014-07-07 10:33:22 +0000
@@ -19,9 +19,6 @@
19 patcher = mock.patch('hooks.charmhelpers')19 patcher = mock.patch('hooks.charmhelpers')
20 self.mock_charmhelpers = patcher.start()20 self.mock_charmhelpers = patcher.start()
21 self.addCleanup(patcher.stop)21 self.addCleanup(patcher.stop)
22 self.mock_charmhelpers.core.hookenv.config.return_value = {
23 'install-ansible-from-ppa': True,
24 }
2522
26 patcher = mock.patch('charmhelpers.contrib.ansible.apply_playbook')23 patcher = mock.patch('charmhelpers.contrib.ansible.apply_playbook')
27 self.mock_apply_playbook = patcher.start()24 self.mock_apply_playbook = patcher.start()
@@ -32,17 +29,6 @@
3229
33 ansible = self.mock_charmhelpers.contrib.ansible30 ansible = self.mock_charmhelpers.contrib.ansible
34 ansible.install_ansible_support.assert_called_once_with(31 ansible.install_ansible_support.assert_called_once_with(
35 from_ppa=True)
36
37 def test_no_ppa_for_ansible_support(self):
38 self.mock_charmhelpers.core.hookenv.config.return_value = {
39 'install-ansible-from-ppa': False,
40 }
41
42 hooks.execute(['install'])
43
44 ansible = self.mock_charmhelpers.contrib.ansible
45 ansible.install_ansible_support.assert_called_once_with(
46 from_ppa=False)32 from_ppa=False)
4733
48 def test_applies_install_playbook(self):34 def test_applies_install_playbook(self):

Subscribers

People subscribed via source and target branches

to all changes: