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
1=== added file 'HACKING.md'
2--- HACKING.md 1970-01-01 00:00:00 +0000
3+++ HACKING.md 2014-07-07 10:33:22 +0000
4@@ -0,0 +1,17 @@
5+# Local development
6+
7+To deploy ElasticSearch locally, pull the bzr branch into your
8+local charm repository and deploy from there:
9+
10+ mkdir -p ~/charms/trusty && cd ~/charms/trusty
11+ charm-get trusty/elasticsearch
12+ juju bootstrap
13+ juju deploy --repository=../.. local:elasticsearch
14+
15+
16+# Testing the ElasticSearch charm
17+
18+Run the unit-tests with `make test`.
19+
20+Run the functional tests with `juju test`.
21+
22
23=== modified file 'Makefile'
24--- Makefile 2014-06-06 14:40:08 +0000
25+++ Makefile 2014-07-07 10:33:22 +0000
26@@ -12,6 +12,12 @@
27 @echo Starting unit tests...
28 @PYTHONPATH=./hooks $(PYTHON) /usr/bin/nosetests3 --nologcapture unit_tests
29
30+deploy:
31+ @echo Deploying local elasticsearch charm
32+ @juju deploy --num-units=2 --repository=../.. local:trusty/elasticsearch
33+
34+
35+# The following targets are used for charm maintenance only.
36 bin/charm_helpers_sync.py:
37 @bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
38 > bin/charm_helpers_sync.py
39@@ -19,8 +25,3 @@
40 sync-charm-helpers: bin/charm_helpers_sync.py
41 @$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers.yaml
42
43-deploy:
44- @echo Deploying local elasticsearch charm
45- @juju deploy --num-units=3 --repository=../.. local:precise/elasticsearch
46- @juju deploy nrpe-external-master
47- @juju add-relation nrpe-external-master elasticsearch
48
49=== modified file 'README.md'
50--- README.md 2014-05-27 14:23:50 +0000
51+++ README.md 2014-07-07 10:33:22 +0000
52@@ -1,24 +1,38 @@
53-# Getting started with ElasticSearch
54-
55-To deploy ElasticSearch locally:
56-
57- juju bootstrap
58- juju deploy --repository=../.. local:elasticsearch
59-
60-You can add more units and they will discover each other and
61-join the cluster.
62+# Overview
63+
64+Elasticsearch is a flexible and powerful open source, distributed, real-time
65+search and analytics engine. Architected from the ground up for use in
66+distributed environments where reliability and scalability are must haves,
67+Elasticsearch gives you the ability to move easily beyond simple full-text
68+search. Through its robust set of APIs and query DSLs, plus clients for the
69+most popular programming languages, Elasticsearch delivers on the near
70+limitless promises of search technology.
71+
72+Except from [elasticsearch.org](http://www.elasticsearch.org/overview/ "Elasticsearch Overview")
73+
74+
75+# Usage
76+
77+Deploy two units from the charmstore with:
78+
79+ juju deploy --num-units 2 cs:trusty/elasticsearch
80+
81+And when they have started you can inspect the cluster health:
82+
83+ juju ssh elasticsearch/0 "curl http://localhost:9200/_cat/health?v"
84+ epoch timestamp cluster status node.total node.data shards ...
85+ 1404728290 10:18:10 elasticsearch green 2 2 0
86+
87+See the separate HACKING.md for information about deploying this charm
88+from a local repository.
89
90
91 ## Relating to the Elasticsearch cluster
92
93-This charm currently provides the website http interface to the
94-consuming service, ie. the private address of an elasticsearch unit. The
95-consuming service can use this on the website-relation-joined
96-relation to query the cluster for the list of nodes (many client
97-elasticsearch apis will do this for you [1]).
98-
99-If it's needed, we can add an elasticsearch cluster interface that
100-returns the lists of hosts in the cluster.
101+This charm currently provides the elasticsearch client interface to the
102+consuming service (cluster-name, host and port). Normally the other service
103+will only need this data from one elasticsearch unit to start as most client
104+libraries then query for the list of backends [1].
105
106 [1] http://elasticsearch-py.readthedocs.org/en/latest/api.html#elasticsearch
107
108@@ -26,21 +40,14 @@
109 ## Discovery
110
111 This charm uses unicast discovery which utilises the orchestration
112-of juju so that the discovery method is the same whether you deploy
113-on EC2, lxc or any other cloud provider.
114+of juju so that whether you deploy on ec2, lxc or any other cloud
115+provider, the functionality for discovering other nodes remains the same.
116
117 When a new unit first joins the cluster, it will update its config
118 with the other units in the cluster (via the peer-relation-joined
119 hook), after which ElasticSearch handles the rest.
120
121
122-## Testing the ElasticSearch charm
123-
124-Run the unit-tests with `make test`.
125-
126-Run the functional tests with `juju test`.
127-
128-
129 ## Downloading ElasticSearch
130
131 This charm installs elasticsearch from a configured apt repository.
132
133=== modified file 'config.yaml'
134--- config.yaml 2014-05-26 14:47:16 +0000
135+++ config.yaml 2014-07-07 10:33:22 +0000
136@@ -1,7 +1,7 @@
137 options:
138 apt-repository:
139 type: string
140- default: "deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main"
141+ default: "deb http://packages.elasticsearch.org/elasticsearch/1.2/debian stable main"
142 description: |
143 A deb-line for the apt archive which contains the elasticsearch package.
144 This is necessary until elasticsearch gets into the debian/ubuntu archives.
145@@ -15,9 +15,3 @@
146 default: "elasticsearch"
147 description: |
148 This sets the elasticsearch cluster name.
149- install-ansible-from-ppa:
150- type: boolean
151- default: true
152- description: |
153- By default ansible will be installed from the Ansible ppa. You can
154- set this to false for your deployments if you have ansible available
155
156=== modified file 'hooks/hooks.py'
157--- hooks/hooks.py 2014-05-27 08:05:37 +0000
158+++ hooks/hooks.py 2014-07-07 10:33:22 +0000
159@@ -27,9 +27,8 @@
160 """Install ansible before running the tasks tagged with 'install'."""
161 # Allow charm users to run preinstall setup.
162 charmhelpers.payload.execd.execd_preinstall()
163- config = charmhelpers.core.hookenv.config()
164 charmhelpers.contrib.ansible.install_ansible_support(
165- from_ppa=config['install-ansible-from-ppa'])
166+ from_ppa=False)
167
168
169 if __name__ == "__main__":
170
171=== modified file 'unit_tests/test_hooks.py'
172--- unit_tests/test_hooks.py 2014-02-18 13:46:55 +0000
173+++ unit_tests/test_hooks.py 2014-07-07 10:33:22 +0000
174@@ -19,9 +19,6 @@
175 patcher = mock.patch('hooks.charmhelpers')
176 self.mock_charmhelpers = patcher.start()
177 self.addCleanup(patcher.stop)
178- self.mock_charmhelpers.core.hookenv.config.return_value = {
179- 'install-ansible-from-ppa': True,
180- }
181
182 patcher = mock.patch('charmhelpers.contrib.ansible.apply_playbook')
183 self.mock_apply_playbook = patcher.start()
184@@ -32,17 +29,6 @@
185
186 ansible = self.mock_charmhelpers.contrib.ansible
187 ansible.install_ansible_support.assert_called_once_with(
188- from_ppa=True)
189-
190- def test_no_ppa_for_ansible_support(self):
191- self.mock_charmhelpers.core.hookenv.config.return_value = {
192- 'install-ansible-from-ppa': False,
193- }
194-
195- hooks.execute(['install'])
196-
197- ansible = self.mock_charmhelpers.contrib.ansible
198- ansible.install_ansible_support.assert_called_once_with(
199 from_ppa=False)
200
201 def test_applies_install_playbook(self):

Subscribers

People subscribed via source and target branches

to all changes: