Merge lp:~bigdata-dev/charms/bundles/apache-hadoop-spark-notebook/trunk into lp:~charmers/charms/bundles/apache-hadoop-spark-notebook/bundle
- Charm Bundles (0.0)
- trunk
- Merge into bundle
Proposed by
Kevin W Monroe
Status: | Merged |
---|---|
Merged at revision: | 5 |
Proposed branch: | lp:~bigdata-dev/charms/bundles/apache-hadoop-spark-notebook/trunk |
Merge into: | lp:~charmers/charms/bundles/apache-hadoop-spark-notebook/bundle |
Diff against target: |
462 lines (+147/-194) 5 files modified
README.md (+78/-78) bundle.yaml (+9/-9) tests/00-setup (+0/-8) tests/01-bundle.py (+57/-99) tests/tests.yaml (+3/-0) |
To merge this branch: | bzr merge lp:~bigdata-dev/charms/bundles/apache-hadoop-spark-notebook/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kevin W Monroe | Approve | ||
Review via email: mp+286952@code.launchpad.net |
Commit message
Description of the change
updates from bigdata-dev:
- version lock charms in bundle.yaml
- update bundle tests
- fix README formatting
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'README.md' | |||
2 | --- README.md 2015-07-09 15:09:34 +0000 | |||
3 | +++ README.md 2016-02-23 21:01:00 +0000 | |||
4 | @@ -16,81 +16,81 @@ | |||
5 | 16 | - 1 Notebook (colocated on the Spark unit) | 16 | - 1 Notebook (colocated on the Spark unit) |
6 | 17 | 17 | ||
7 | 18 | 18 | ||
86 | 19 | ## Usage | 19 | ## Usage |
87 | 20 | Deploy this bundle using juju-quickstart: | 20 | Deploy this bundle using juju-quickstart: |
88 | 21 | 21 | ||
89 | 22 | juju quickstart u/bigdata-dev/apache-hadoop-spark-notebook | 22 | juju quickstart apache-hadoop-spark-notebook |
90 | 23 | 23 | ||
91 | 24 | See `juju quickstart --help` for deployment options, including machine | 24 | See `juju quickstart --help` for deployment options, including machine |
92 | 25 | constraints and how to deploy a locally modified version of the | 25 | constraints and how to deploy a locally modified version of the |
93 | 26 | apache-hadoop-spark-notebook bundle.yaml. | 26 | apache-hadoop-spark-notebook bundle.yaml. |
94 | 27 | 27 | ||
95 | 28 | 28 | ||
96 | 29 | ## Testing the deployment | 29 | ## Testing the deployment |
97 | 30 | 30 | ||
98 | 31 | ### Smoke test HDFS admin functionality | 31 | ### Smoke test HDFS admin functionality |
99 | 32 | Once the deployment is complete and the cluster is running, ssh to the HDFS | 32 | Once the deployment is complete and the cluster is running, ssh to the HDFS |
100 | 33 | Master unit: | 33 | Master unit: |
101 | 34 | 34 | ||
102 | 35 | juju ssh hdfs-master/0 | 35 | juju ssh hdfs-master/0 |
103 | 36 | 36 | ||
104 | 37 | As the `ubuntu` user, create a temporary directory on the Hadoop file system. | 37 | As the `ubuntu` user, create a temporary directory on the Hadoop file system. |
105 | 38 | The steps below verify HDFS functionality: | 38 | The steps below verify HDFS functionality: |
106 | 39 | 39 | ||
107 | 40 | hdfs dfs -mkdir -p /tmp/hdfs-test | 40 | hdfs dfs -mkdir -p /tmp/hdfs-test |
108 | 41 | hdfs dfs -chmod -R 777 /tmp/hdfs-test | 41 | hdfs dfs -chmod -R 777 /tmp/hdfs-test |
109 | 42 | hdfs dfs -ls /tmp # verify the newly created hdfs-test subdirectory exists | 42 | hdfs dfs -ls /tmp # verify the newly created hdfs-test subdirectory exists |
110 | 43 | hdfs dfs -rm -R /tmp/hdfs-test | 43 | hdfs dfs -rm -R /tmp/hdfs-test |
111 | 44 | hdfs dfs -ls /tmp # verify the hdfs-test subdirectory has been removed | 44 | hdfs dfs -ls /tmp # verify the hdfs-test subdirectory has been removed |
112 | 45 | exit | 45 | exit |
113 | 46 | 46 | ||
114 | 47 | ### Smoke test YARN and MapReduce | 47 | ### Smoke test YARN and MapReduce |
115 | 48 | Run the `terasort.sh` script from the Spark unit to generate and sort data. The | 48 | Run the `terasort.sh` script from the Spark unit to generate and sort data. The |
116 | 49 | steps below verify that Spark is communicating with the cluster via the plugin | 49 | steps below verify that Spark is communicating with the cluster via the plugin |
117 | 50 | and that YARN and MapReduce are working as expected: | 50 | and that YARN and MapReduce are working as expected: |
118 | 51 | 51 | ||
119 | 52 | juju ssh spark/0 | 52 | juju ssh spark/0 |
120 | 53 | ~/terasort.sh | 53 | ~/terasort.sh |
121 | 54 | exit | 54 | exit |
122 | 55 | 55 | ||
123 | 56 | ### Smoke test HDFS functionality from user space | 56 | ### Smoke test HDFS functionality from user space |
124 | 57 | From the Spark unit, delete the MapReduce output previously generated by the | 57 | From the Spark unit, delete the MapReduce output previously generated by the |
125 | 58 | `terasort.sh` script: | 58 | `terasort.sh` script: |
126 | 59 | 59 | ||
127 | 60 | juju ssh spark/0 | 60 | juju ssh spark/0 |
128 | 61 | hdfs dfs -rm -R /user/ubuntu/tera_demo_out | 61 | hdfs dfs -rm -R /user/ubuntu/tera_demo_out |
129 | 62 | exit | 62 | exit |
130 | 63 | 63 | ||
131 | 64 | ### Smoke test Spark | 64 | ### Smoke test Spark |
132 | 65 | SSH to the Spark unit and run the SparkPi demo as follows: | 65 | SSH to the Spark unit and run the SparkPi demo as follows: |
133 | 66 | 66 | ||
134 | 67 | juju ssh spark/0 | 67 | juju ssh spark/0 |
135 | 68 | ~/sparkpi.sh | 68 | ~/sparkpi.sh |
136 | 69 | exit | 69 | exit |
137 | 70 | 70 | ||
138 | 71 | ### Access the IPython Notebook web interface | 71 | ### Access the IPython Notebook web interface |
139 | 72 | Access the notebook web interface at | 72 | Access the notebook web interface at |
140 | 73 | http://{spark_unit_ip_address}:8880. The ip address can be found by running | 73 | http://{spark_unit_ip_address}:8880. The ip address can be found by running |
141 | 74 | `juju status spark/0 | grep public-address`. | 74 | `juju status spark/0 | grep public-address`. |
142 | 75 | 75 | ||
143 | 76 | 76 | ||
144 | 77 | ## Scale Out Usage | 77 | ## Scale Out Usage |
145 | 78 | This bundle was designed to scale out. To increase the amount of Compute | 78 | This bundle was designed to scale out. To increase the amount of Compute |
146 | 79 | Slaves, you can add units to the compute-slave service. To add one unit: | 79 | Slaves, you can add units to the compute-slave service. To add one unit: |
147 | 80 | 80 | ||
148 | 81 | juju add-unit compute-slave | 81 | juju add-unit compute-slave |
149 | 82 | 82 | ||
150 | 83 | Or you can add multiple units at once: | 83 | Or you can add multiple units at once: |
151 | 84 | 84 | ||
152 | 85 | juju add-unit -n4 compute-slave | 85 | juju add-unit -n4 compute-slave |
153 | 86 | 86 | ||
154 | 87 | 87 | ||
155 | 88 | ## Contact Information | 88 | ## Contact Information |
156 | 89 | 89 | ||
157 | 90 | - <bigdata-dev@lists.launchpad.net> | 90 | - <bigdata-dev@lists.launchpad.net> |
158 | 91 | 91 | ||
159 | 92 | 92 | ||
160 | 93 | ## Help | 93 | ## Help |
161 | 94 | 94 | ||
162 | 95 | - [Juju mailing list](https://lists.ubuntu.com/mailman/listinfo/juju) | 95 | - [Juju mailing list](https://lists.ubuntu.com/mailman/listinfo/juju) |
163 | 96 | - [Juju community](https://jujucharms.com/community) | 96 | - [Juju community](https://jujucharms.com/community) |
164 | 97 | 97 | ||
165 | === modified file 'bundle.yaml' | |||
166 | --- bundle.yaml 2015-07-16 20:35:31 +0000 | |||
167 | +++ bundle.yaml 2016-02-23 21:01:00 +0000 | |||
168 | @@ -1,46 +1,46 @@ | |||
169 | 1 | services: | 1 | services: |
170 | 2 | compute-slave: | 2 | compute-slave: |
172 | 3 | charm: cs:trusty/apache-hadoop-compute-slave | 3 | charm: cs:trusty/apache-hadoop-compute-slave-9 |
173 | 4 | num_units: 3 | 4 | num_units: 3 |
174 | 5 | annotations: | 5 | annotations: |
175 | 6 | gui-x: "300" | 6 | gui-x: "300" |
176 | 7 | gui-y: "200" | 7 | gui-y: "200" |
178 | 8 | constraints: mem=3G | 8 | constraints: mem=7G |
179 | 9 | hdfs-master: | 9 | hdfs-master: |
181 | 10 | charm: cs:trusty/apache-hadoop-hdfs-master | 10 | charm: cs:trusty/apache-hadoop-hdfs-master-9 |
182 | 11 | num_units: 1 | 11 | num_units: 1 |
183 | 12 | annotations: | 12 | annotations: |
184 | 13 | gui-x: "600" | 13 | gui-x: "600" |
185 | 14 | gui-y: "350" | 14 | gui-y: "350" |
186 | 15 | constraints: mem=7G | 15 | constraints: mem=7G |
187 | 16 | plugin: | 16 | plugin: |
189 | 17 | charm: cs:trusty/apache-hadoop-plugin | 17 | charm: cs:trusty/apache-hadoop-plugin-10 |
190 | 18 | annotations: | 18 | annotations: |
191 | 19 | gui-x: "900" | 19 | gui-x: "900" |
192 | 20 | gui-y: "200" | 20 | gui-y: "200" |
193 | 21 | secondary-namenode: | 21 | secondary-namenode: |
195 | 22 | charm: cs:trusty/apache-hadoop-hdfs-secondary | 22 | charm: cs:trusty/apache-hadoop-hdfs-secondary-7 |
196 | 23 | num_units: 1 | 23 | num_units: 1 |
197 | 24 | annotations: | 24 | annotations: |
198 | 25 | gui-x: "600" | 25 | gui-x: "600" |
199 | 26 | gui-y: "600" | 26 | gui-y: "600" |
200 | 27 | constraints: mem=7G | 27 | constraints: mem=7G |
201 | 28 | spark: | 28 | spark: |
203 | 29 | charm: cs:trusty/apache-spark | 29 | charm: cs:trusty/apache-spark-6 |
204 | 30 | num_units: 1 | 30 | num_units: 1 |
205 | 31 | annotations: | 31 | annotations: |
206 | 32 | gui-x: "1200" | 32 | gui-x: "1200" |
207 | 33 | gui-y: "200" | 33 | gui-y: "200" |
208 | 34 | constraints: mem=3G | 34 | constraints: mem=3G |
209 | 35 | yarn-master: | 35 | yarn-master: |
211 | 36 | charm: cs:trusty/apache-hadoop-yarn-master | 36 | charm: cs:trusty/apache-hadoop-yarn-master-7 |
212 | 37 | num_units: 1 | 37 | num_units: 1 |
213 | 38 | annotations: | 38 | annotations: |
214 | 39 | gui-x: "600" | 39 | gui-x: "600" |
215 | 40 | gui-y: "100" | 40 | gui-y: "100" |
216 | 41 | constraints: mem=7G | 41 | constraints: mem=7G |
217 | 42 | notebook: | 42 | notebook: |
219 | 43 | charm: cs:trusty/apache-spark-notebook | 43 | charm: cs:trusty/apache-spark-notebook-3 |
220 | 44 | annotations: | 44 | annotations: |
221 | 45 | gui-x: "1200" | 45 | gui-x: "1200" |
222 | 46 | gui-y: "450" | 46 | gui-y: "450" |
223 | @@ -53,4 +53,4 @@ | |||
224 | 53 | - [plugin, yarn-master] | 53 | - [plugin, yarn-master] |
225 | 54 | - [plugin, hdfs-master] | 54 | - [plugin, hdfs-master] |
226 | 55 | - [spark, plugin] | 55 | - [spark, plugin] |
228 | 56 | - [notebook, spark] | 56 | - [spark, notebook] |
229 | 57 | 57 | ||
230 | === removed file 'tests/00-setup' | |||
231 | --- tests/00-setup 2015-07-16 20:35:31 +0000 | |||
232 | +++ tests/00-setup 1970-01-01 00:00:00 +0000 | |||
233 | @@ -1,8 +0,0 @@ | |||
234 | 1 | #!/bin/bash | ||
235 | 2 | |||
236 | 3 | if ! dpkg -s amulet &> /dev/null; then | ||
237 | 4 | echo Installing Amulet... | ||
238 | 5 | sudo add-apt-repository -y ppa:juju/stable | ||
239 | 6 | sudo apt-get update | ||
240 | 7 | sudo apt-get -y install amulet | ||
241 | 8 | fi | ||
242 | 9 | 0 | ||
243 | === modified file 'tests/01-bundle.py' | |||
244 | --- tests/01-bundle.py 2015-07-16 20:35:31 +0000 | |||
245 | +++ tests/01-bundle.py 2016-02-23 21:01:00 +0000 | |||
246 | @@ -1,61 +1,32 @@ | |||
247 | 1 | #!/usr/bin/env python3 | 1 | #!/usr/bin/env python3 |
248 | 2 | 2 | ||
249 | 3 | import os | 3 | import os |
250 | 4 | import time | ||
251 | 5 | import unittest | 4 | import unittest |
252 | 6 | 5 | ||
253 | 7 | import yaml | 6 | import yaml |
254 | 8 | import amulet | 7 | import amulet |
255 | 9 | 8 | ||
256 | 10 | 9 | ||
261 | 11 | class Base(object): | 10 | class TestBundle(unittest.TestCase): |
258 | 12 | """ | ||
259 | 13 | Base class for tests for Apache Hadoop Bundle. | ||
260 | 14 | """ | ||
262 | 15 | bundle_file = os.path.join(os.path.dirname(__file__), '..', 'bundle.yaml') | 11 | bundle_file = os.path.join(os.path.dirname(__file__), '..', 'bundle.yaml') |
263 | 16 | profile_name = None | ||
264 | 17 | 12 | ||
265 | 18 | @classmethod | 13 | @classmethod |
269 | 19 | def deploy(cls): | 14 | def setUpClass(cls): |
267 | 20 | # classmethod inheritance doesn't work quite right with | ||
268 | 21 | # setUpClass / tearDownClass, so subclasses have to manually call this | ||
270 | 22 | cls.d = amulet.Deployment(series='trusty') | 15 | cls.d = amulet.Deployment(series='trusty') |
271 | 23 | with open(cls.bundle_file) as f: | 16 | with open(cls.bundle_file) as f: |
272 | 24 | bun = f.read() | 17 | bun = f.read() |
307 | 25 | profiles = yaml.safe_load(bun) | 18 | bundle = yaml.safe_load(bun) |
308 | 26 | # amulet always selects the first profile, so we have to fudge it here | 19 | cls.d.load(bundle) |
309 | 27 | profile = {cls.profile_name: profiles[cls.profile_name]} | 20 | cls.d.setup(timeout=1800) |
310 | 28 | cls.d.load(profile) | 21 | cls.d.sentry.wait_for_messages({'notebook': 'Ready'}, timeout=1800) |
311 | 29 | cls.d.setup(timeout=9000) | 22 | cls.hdfs = cls.d.sentry['hdfs-master'][0] |
312 | 30 | cls.d.sentry.wait() | 23 | cls.yarn = cls.d.sentry['yarn-master'][0] |
313 | 31 | cls.hdfs = cls.d.sentry.unit['hdfs-master/0'] | 24 | cls.slave = cls.d.sentry['compute-slave'][0] |
314 | 32 | cls.yarn = cls.d.sentry.unit['yarn-master/0'] | 25 | cls.secondary = cls.d.sentry['secondary-namenode'][0] |
315 | 33 | cls.slave = cls.d.sentry.unit['compute-slave/0'] | 26 | cls.spark = cls.d.sentry['spark'][0] |
316 | 34 | cls.secondary = cls.d.sentry.unit['secondary-namenode/0'] | 27 | cls.notebook = cls.d.sentry['notebook'][0] |
317 | 35 | cls.plugin = cls.d.sentry.unit['plugin/0'] | 28 | |
318 | 36 | cls.client = cls.d.sentry.unit['client/0'] | 29 | def test_components(self): |
285 | 37 | |||
286 | 38 | @classmethod | ||
287 | 39 | def reset_env(cls): | ||
288 | 40 | # classmethod inheritance doesn't work quite right with | ||
289 | 41 | # setUpClass / tearDownClass, so subclasses have to manually call this | ||
290 | 42 | juju_env = amulet.helpers.default_environment() | ||
291 | 43 | services = ['hdfs-master', 'yarn-master', 'compute-slave', 'secondary-namenode', 'plugin', 'client'] | ||
292 | 44 | |||
293 | 45 | def check_env_clear(): | ||
294 | 46 | state = amulet.waiter.state(juju_env=juju_env) | ||
295 | 47 | for service in services: | ||
296 | 48 | if state.get(service, {}) != {}: | ||
297 | 49 | return False | ||
298 | 50 | return True | ||
299 | 51 | |||
300 | 52 | for service in services: | ||
301 | 53 | cls.d.remove(service) | ||
302 | 54 | with amulet.helpers.timeout(300): | ||
303 | 55 | while not check_env_clear(): | ||
304 | 56 | time.sleep(5) | ||
305 | 57 | |||
306 | 58 | def test_hadoop_components(self): | ||
319 | 59 | """ | 30 | """ |
320 | 60 | Confirm that all of the required components are up and running. | 31 | Confirm that all of the required components are up and running. |
321 | 61 | """ | 32 | """ |
322 | @@ -63,17 +34,48 @@ | |||
323 | 63 | yarn, retcode = self.yarn.run("pgrep -a java") | 34 | yarn, retcode = self.yarn.run("pgrep -a java") |
324 | 64 | slave, retcode = self.slave.run("pgrep -a java") | 35 | slave, retcode = self.slave.run("pgrep -a java") |
325 | 65 | secondary, retcode = self.secondary.run("pgrep -a java") | 36 | secondary, retcode = self.secondary.run("pgrep -a java") |
327 | 66 | client, retcode = self.client.run("pgrep -a java") | 37 | spark, retcode = self.spark.run("pgrep -a java") |
328 | 38 | notebook, retcode = self.spark.run("pgrep -a python") | ||
329 | 67 | 39 | ||
330 | 68 | # .NameNode needs the . to differentiate it from SecondaryNameNode | 40 | # .NameNode needs the . to differentiate it from SecondaryNameNode |
331 | 69 | assert '.NameNode' in hdfs, "NameNode not started" | 41 | assert '.NameNode' in hdfs, "NameNode not started" |
332 | 42 | assert '.NameNode' not in yarn, "NameNode should not be running on yarn-master" | ||
333 | 43 | assert '.NameNode' not in slave, "NameNode should not be running on compute-slave" | ||
334 | 44 | assert '.NameNode' not in secondary, "NameNode should not be running on secondary-namenode" | ||
335 | 45 | assert '.NameNode' not in spark, "NameNode should not be running on spark" | ||
336 | 46 | |||
337 | 70 | assert 'ResourceManager' in yarn, "ResourceManager not started" | 47 | assert 'ResourceManager' in yarn, "ResourceManager not started" |
338 | 48 | assert 'ResourceManager' not in hdfs, "ResourceManager should not be running on hdfs-master" | ||
339 | 49 | assert 'ResourceManager' not in slave, "ResourceManager should not be running on compute-slave" | ||
340 | 50 | assert 'ResourceManager' not in secondary, "ResourceManager should not be running on secondary-namenode" | ||
341 | 51 | assert 'ResourceManager' not in spark, "ResourceManager should not be running on spark" | ||
342 | 52 | |||
343 | 71 | assert 'JobHistoryServer' in yarn, "JobHistoryServer not started" | 53 | assert 'JobHistoryServer' in yarn, "JobHistoryServer not started" |
344 | 54 | assert 'JobHistoryServer' not in hdfs, "JobHistoryServer should not be running on hdfs-master" | ||
345 | 55 | assert 'JobHistoryServer' not in slave, "JobHistoryServer should not be running on compute-slave" | ||
346 | 56 | assert 'JobHistoryServer' not in secondary, "JobHistoryServer should not be running on secondary-namenode" | ||
347 | 57 | assert 'JobHistoryServer' not in spark, "JobHistoryServer should not be running on spark" | ||
348 | 58 | |||
349 | 72 | assert 'NodeManager' in slave, "NodeManager not started" | 59 | assert 'NodeManager' in slave, "NodeManager not started" |
350 | 60 | assert 'NodeManager' not in yarn, "NodeManager should not be running on yarn-master" | ||
351 | 61 | assert 'NodeManager' not in hdfs, "NodeManager should not be running on hdfs-master" | ||
352 | 62 | assert 'NodeManager' not in secondary, "NodeManager should not be running on secondary-namenode" | ||
353 | 63 | assert 'NodeManager' not in spark, "NodeManager should not be running on spark" | ||
354 | 64 | |||
355 | 73 | assert 'DataNode' in slave, "DataServer not started" | 65 | assert 'DataNode' in slave, "DataServer not started" |
356 | 66 | assert 'DataNode' not in yarn, "DataNode should not be running on yarn-master" | ||
357 | 67 | assert 'DataNode' not in hdfs, "DataNode should not be running on hdfs-master" | ||
358 | 68 | assert 'DataNode' not in secondary, "DataNode should not be running on secondary-namenode" | ||
359 | 69 | assert 'DataNode' not in spark, "DataNode should not be running on spark" | ||
360 | 70 | |||
361 | 74 | assert 'SecondaryNameNode' in secondary, "SecondaryNameNode not started" | 71 | assert 'SecondaryNameNode' in secondary, "SecondaryNameNode not started" |
362 | 72 | assert 'SecondaryNameNode' not in yarn, "SecondaryNameNode should not be running on yarn-master" | ||
363 | 73 | assert 'SecondaryNameNode' not in hdfs, "SecondaryNameNode should not be running on hdfs-master" | ||
364 | 74 | assert 'SecondaryNameNode' not in slave, "SecondaryNameNode should not be running on compute-slave" | ||
365 | 75 | assert 'SecondaryNameNode' not in spark, "SecondaryNameNode should not be running on spark" | ||
366 | 75 | 76 | ||
368 | 76 | return hdfs, yarn, slave, secondary, client # allow subclasses to do additional checks | 77 | assert 'spark' in spark, 'Spark should be running on spark' |
369 | 78 | assert 'notebook' in notebook, 'Notebook should be running on spark' | ||
370 | 77 | 79 | ||
371 | 78 | def test_hdfs_dir(self): | 80 | def test_hdfs_dir(self): |
372 | 79 | """ | 81 | """ |
373 | @@ -84,11 +86,11 @@ | |||
374 | 84 | 86 | ||
375 | 85 | NB: These are order-dependent, so must be done as part of a single test case. | 87 | NB: These are order-dependent, so must be done as part of a single test case. |
376 | 86 | """ | 88 | """ |
378 | 87 | output, retcode = self.client.run("su hdfs -c 'hdfs dfs -mkdir -p /user/ubuntu'") | 89 | output, retcode = self.spark.run("su hdfs -c 'hdfs dfs -mkdir -p /user/ubuntu'") |
379 | 88 | assert retcode == 0, "Created a user directory on hdfs FAILED:\n{}".format(output) | 90 | assert retcode == 0, "Created a user directory on hdfs FAILED:\n{}".format(output) |
381 | 89 | output, retcode = self.client.run("su hdfs -c 'hdfs dfs -chown ubuntu:ubuntu /user/ubuntu'") | 91 | output, retcode = self.spark.run("su hdfs -c 'hdfs dfs -chown ubuntu:ubuntu /user/ubuntu'") |
382 | 90 | assert retcode == 0, "Assigning an owner to hdfs directory FAILED:\n{}".format(output) | 92 | assert retcode == 0, "Assigning an owner to hdfs directory FAILED:\n{}".format(output) |
384 | 91 | output, retcode = self.client.run("su hdfs -c 'hdfs dfs -chmod -R 755 /user/ubuntu'") | 93 | output, retcode = self.spark.run("su hdfs -c 'hdfs dfs -chmod -R 755 /user/ubuntu'") |
385 | 92 | assert retcode == 0, "seting directory permission on hdfs FAILED:\n{}".format(output) | 94 | assert retcode == 0, "seting directory permission on hdfs FAILED:\n{}".format(output) |
386 | 93 | 95 | ||
387 | 94 | def test_yarn_mapreduce_exe(self): | 96 | def test_yarn_mapreduce_exe(self): |
388 | @@ -112,59 +114,15 @@ | |||
389 | 112 | ('cleanup', "su hdfs -c 'hdfs dfs -rm -r /user/ubuntu/teragenout'"), | 114 | ('cleanup', "su hdfs -c 'hdfs dfs -rm -r /user/ubuntu/teragenout'"), |
390 | 113 | ] | 115 | ] |
391 | 114 | for name, step in test_steps: | 116 | for name, step in test_steps: |
393 | 115 | output, retcode = self.client.run(step) | 117 | output, retcode = self.spark.run(step) |
394 | 116 | assert retcode == 0, "{} FAILED:\n{}".format(name, output) | 118 | assert retcode == 0, "{} FAILED:\n{}".format(name, output) |
395 | 117 | 119 | ||
446 | 118 | 120 | def test_spark(self): | |
447 | 119 | class TestScalable(unittest.TestCase, Base): | 121 | output, retcode = self.spark.run("su ubuntu -c 'bash -lc /home/ubuntu/sparkpi.sh 2>&1'") |
448 | 120 | profile_name = 'apache-core-batch-processing' | 122 | assert 'Pi is roughly' in output, 'SparkPI test failed: %s' % output |
449 | 121 | 123 | ||
450 | 122 | @classmethod | 124 | def test_notebook(self): |
451 | 123 | def setUpClass(cls): | 125 | pass # requires javascript; how to test? |
402 | 124 | cls.deploy() | ||
403 | 125 | |||
404 | 126 | @classmethod | ||
405 | 127 | def tearDownClass(cls): | ||
406 | 128 | cls.reset_env() | ||
407 | 129 | |||
408 | 130 | def test_hadoop_components(self): | ||
409 | 131 | """ | ||
410 | 132 | In addition to testing that the components are running where they | ||
411 | 133 | are supposed to be, confirm that none of them are also running where | ||
412 | 134 | they shouldn't be. | ||
413 | 135 | """ | ||
414 | 136 | hdfs, yarn, slave, secondary, client = super(TestScalable, self).test_hadoop_components() | ||
415 | 137 | |||
416 | 138 | # .NameNode needs the . to differentiate it from SecondaryNameNode | ||
417 | 139 | assert '.NameNode' not in yarn, "NameNode should not be running on yarn-master" | ||
418 | 140 | assert '.NameNode' not in slave, "NameNode should not be running on compute-slave" | ||
419 | 141 | assert '.NameNode' not in secondary, "NameNode should not be running on secondary-namenode" | ||
420 | 142 | assert '.NameNode' not in client, "NameNode should not be running on client" | ||
421 | 143 | |||
422 | 144 | assert 'ResourceManager' not in hdfs, "ResourceManager should not be running on hdfs-master" | ||
423 | 145 | assert 'ResourceManager' not in slave, "ResourceManager should not be running on compute-slave" | ||
424 | 146 | assert 'ResourceManager' not in secondary, "ResourceManager should not be running on secondary-namenode" | ||
425 | 147 | assert 'ResourceManager' not in client, "ResourceManager should not be running on client" | ||
426 | 148 | |||
427 | 149 | assert 'JobHistoryServer' not in hdfs, "JobHistoryServer should not be running on hdfs-master" | ||
428 | 150 | assert 'JobHistoryServer' not in slave, "JobHistoryServer should not be running on compute-slave" | ||
429 | 151 | assert 'JobHistoryServer' not in secondary, "JobHistoryServer should not be running on secondary-namenode" | ||
430 | 152 | assert 'JobHistoryServer' not in client, "JobHistoryServer should not be running on client" | ||
431 | 153 | |||
432 | 154 | assert 'NodeManager' not in yarn, "NodeManager should not be running on yarn-master" | ||
433 | 155 | assert 'NodeManager' not in hdfs, "NodeManager should not be running on hdfs-master" | ||
434 | 156 | assert 'NodeManager' not in secondary, "NodeManager should not be running on secondary-namenode" | ||
435 | 157 | assert 'NodeManager' not in client, "NodeManager should not be running on client" | ||
436 | 158 | |||
437 | 159 | assert 'DataNode' not in yarn, "DataNode should not be running on yarn-master" | ||
438 | 160 | assert 'DataNode' not in hdfs, "DataNode should not be running on hdfs-master" | ||
439 | 161 | assert 'DataNode' not in secondary, "DataNode should not be running on secondary-namenode" | ||
440 | 162 | assert 'DataNode' not in client, "DataNode should not be running on client" | ||
441 | 163 | |||
442 | 164 | assert 'SecondaryNameNode' not in yarn, "SecondaryNameNode should not be running on yarn-master" | ||
443 | 165 | assert 'SecondaryNameNode' not in hdfs, "SecondaryNameNode should not be running on hdfs-master" | ||
444 | 166 | assert 'SecondaryNameNode' not in slave, "SecondaryNameNode should not be running on compute-slave" | ||
445 | 167 | assert 'SecondaryNameNode' not in client, "SecondaryNameNode should not be running on client" | ||
452 | 168 | 126 | ||
453 | 169 | 127 | ||
454 | 170 | if __name__ == '__main__': | 128 | if __name__ == '__main__': |
455 | 171 | 129 | ||
456 | === added file 'tests/tests.yaml' | |||
457 | --- tests/tests.yaml 1970-01-01 00:00:00 +0000 | |||
458 | +++ tests/tests.yaml 2016-02-23 21:01:00 +0000 | |||
459 | @@ -0,0 +1,3 @@ | |||
460 | 1 | reset: false | ||
461 | 2 | packages: | ||
462 | 3 | - amulet |
+1, test deploy on AWS succeeded