Merge lp:~mbruzek/charms/precise/cassandra/ppc64le into lp:charms/cassandra

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 34
Proposed branch: lp:~mbruzek/charms/precise/cassandra/ppc64le
Merge into: lp:charms/cassandra
Diff against target: 115 lines (+48/-18)
3 files modified
config.yaml (+5/-1)
hooks/cassandra-common (+40/-17)
tests/01-test (+3/-0)
To merge this branch: bzr merge lp:~mbruzek/charms/precise/cassandra/ppc64le
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
Review via email: mp+226291@code.launchpad.net

Description of the change

These are the changes needed to make cassandra run on power PC.

The charm should check if the deb package exists and use that to install.

There is a configuration value that have to be updated for ppc64le only.
There is a configuration value that needs to change for openjdk.

To post a comment you must log in.
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Matt,

Can you list the two configuration values that need to be changed?

Thanks,
Tim

Revision history for this message
Matt Bruzek (mbruzek) wrote :

Sorry I was not clear. The charm code had to be changed that edits the Cassandra configuration file cassandra-env.sh to get the charm to deploy.

For reference those values are:
UseCondCardMark (had to be removed the OpenJDK does not recognize this value)
-Xss (had to be increased to 1664k which is 10x the original value in the file)

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Hey Matt, good stuff! Nice to see the Cassandra charm being updated to run on ppc64le! Here's what I found:

PPC64LE
-------
The changes for ppc64le worked great. I tested on ppc64le with a bundled cassandra .deb [1], and on x86_64 with and without a bundled .deb. The charm started up just fine in all scenarios.

Charm Proof
-----------
W: config.yaml: option datacenter does not have the keys: default
W: config.yaml: option dc_suffix does not have the keys: default
W: config.yaml: option rack does not have the keys: default

These warnings were not caused by your change, but it would be nice to go ahead and get them cleaned up.

Tests
-----
There are tests in the charm that can be executed like so:

cd charms/trusty/cassandra/tests && make

I have two comments on the tests:

1. They fail. They fail on the current store revision also, so the failure is not a result of this change, but it would be nice to get them fixed, although not necessarily in this merge.
2. The tests are not detected by bundletester [2], so they will not be run by our automated testing infrastructure. The easiest way to fix it in this case is to:

cd charms/trusty/cassandra/tests
echo -e '#!/bin/bash\nmake' > 01-test && chmod +x 01-test

You can then run the tests by executing `bundletester -F` from within the charm dir. (By default, bundletester looks for executable files, in a tests/ dir, that match the "[0-9]*" glob pattern.)

Again, I'm not suggesting that these tests must be fixed in this merge, merely documenting the findings of my review. IMO it would be acceptable to fix the tests in a separate merge.

[1] http://www.apache.org/dist/cassandra/debian/pool/main/c/cassandra/cassandra_2.1.0~rc6_all.deb
[2]* lp:~tvansteenburgh/charmtester/bundletester

* This is not the official bundletester repo, but has some fixes that haven't been merged yet.

35. By Matt Bruzek

Improving charm proof errors and adding a test that can be run from the automated framework.

Revision history for this message
Matt Bruzek (mbruzek) wrote :

Thanks for the review Tim.

I have improved the charm proof status with the default keys and added a 01-test as you described to allow the Makefile to be called from the automated tester.

Revision history for this message
amir sanjar (asanjar) wrote :

Matt it looks good. The only recommendation would be to install JAVA SDK package as default for performance and java life cycle management tools (i.e jps).
example: jps | awk '{print $2}'

Revision history for this message
Charles Butler (lazypower) wrote :

Awesome merge MBruzek!

Thank you for your continued effort on this. +1 on the merge, but I'd like to see additional info on the offline installer in the readme. theres no notation of placing a 'fat packed' offline-able install mode by simply placing a cassandra_*.deb in files.

I'll merge this tentatively with a follow up MP to update the readme.

Thanks again for the effort!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2013-11-22 16:43:13 +0000
3+++ config.yaml 2014-08-25 17:51:57 +0000
4@@ -220,15 +220,19 @@
5 Used with endpoint_snitch=GossipingPropertyFileSnitch to prefer the internal ip when
6 possible, as the Ec2MultiRegionSnitch does. Used with cassandra >= 1.2.x
7 dc_suffix:
8+ default:
9 type: string
10 description:
11 Add a suffix to a datacenter name. Used by the Ec2Snitch and Ec2MultiRegionSnitch to
12 append a string to the EC2 region name. Used with cassandra >= 1.2.x
13 datacenter:
14+ default:
15 type: string
16 description:
17 The datacenter used by the enpoint_snitch. i.e. "DC1"
18- rack:
19+ rack:
20+ default:
21 type: string
22 description:
23 The rack used by the enpoint_snitch. i.e. "Rack1"
24+
25
26=== modified file 'hooks/cassandra-common'
27--- hooks/cassandra-common 2014-05-19 20:07:30 +0000
28+++ hooks/cassandra-common 2014-08-25 17:51:57 +0000
29@@ -13,7 +13,7 @@
30 CASSANDRA_GROUP="cassandra"
31 NAGIOS_EXPORT_DIR="/var/lib/nagios/export"
32
33-set -e
34+set -ex
35
36 export LANG=en_US.UTF-8
37
38@@ -79,20 +79,33 @@
39 APT_REPO_KEY=$(config-get apt-repo-key)
40 # Check for configured extra packages to install from config
41 EXTRA_PACKAGES="$(config-get extra_packages)"
42- # Add the key
43- if [[ -n "${APT_REPO_KEY}" ]]; then
44- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${APT_REPO_KEY}
45- fi
46- if [[ -n "${APT_REPO_SPEC}" ]]; then
47- echo "${APT_REPO_SPEC}" > /etc/apt/sources.list.d/cassandra.list
48- fi
49- # Update the repositories
50+ # Get the debian package in the files directory.
51+ DEBIAN_PACKAGE_FILE=($CHARM_DIR/files/cassandra_*.deb)
52+ # Does the debain cassandra package exist in the charm directory?
53+ if [[ -f ${DEBIAN_PACKAGE_FILE} ]]; then
54+ # The apt-get update command is necessary to install java.
55+ apt-get update -qq
56+ # Install the prerequisites for cassandra.
57+ DEBIAN_FRONTEND=noninteractive apt-get -qq install -y openjdk-7-jre-headless libjna-java python-support python-cheetah dnsutils bzr ${EXTRA_PACKAGES}
58+ # Use the debian package manager to install the cassandra package.
59+ dpkg -i ${DEBIAN_PACKAGE_FILE}
60+ else
61+ # Add the key
62+ if [[ -n "${APT_REPO_KEY}" ]]; then
63+ # Use port 80 to get the keyserver key.
64+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${APT_REPO_KEY}
65+ fi
66+ if [[ -n "${APT_REPO_SPEC}" ]]; then
67+ echo "${APT_REPO_SPEC}" > /etc/apt/sources.list.d/cassandra.list
68+ fi
69+ # Update the repositories
70
71- apt-get update
72- # Ensure that cassandra does not startup before we have configured it
73- disable_cassandra_start
74- # Install the package
75- DEBIAN_FRONTEND=noninteractive apt-get -qq install -y cassandra python-cheetah dnsutils bzr ${EXTRA_PACKAGES}
76+ apt-get update
77+ # Ensure that cassandra does not startup before we have configured it
78+ disable_cassandra_start
79+ # Install the package
80+ DEBIAN_FRONTEND=noninteractive apt-get -qq install -y cassandra python-cheetah dnsutils bzr ${EXTRA_PACKAGES}
81+ fi
82 bzr_ci || :
83 }
84
85@@ -349,9 +362,19 @@
86 # Open port ready for expose
87 open-port ${CLIENT_PORT}/TCP
88
89- # Default cassandra-env.sh for some cassandra 1.0.x specifies -Xss128k
90- # while 160k min is required
91- sed -i -e "s/-Xss128k/-Xss256k/" ${CASSANDRA_ENV}
92+ # Get the architecture from the uname command.
93+ ARCHITECTURE=`uname -m`
94+ if [ "$ARCHITECTURE" == "ppc64le" ]; then
95+ # On the ppc64le architecture requires a higher value for stack size.
96+ sed -i -e "s/-Xss[0-9]*k/-Xss1664k/" ${CASSANDRA_ENV}
97+ else
98+ # Default cassandra-env.sh for some cassandra 1.0.x specifies -Xss128k
99+ # while 160k min is required
100+ sed -i -e "s/-Xss[0-9]*k/-Xss256k/" ${CASSANDRA_ENV}
101+ fi
102+ # OpenJDK does not handle the UseCondCardMark flag.
103+ sed -i -e "s/-XX:+UseCondCardMark//" ${CASSANDRA_ENV}
104+
105 # Configure memory settings as specified in configuration
106 if [ "$AUTO_MEMORY" = "False" ]; then
107 juju-log "Configuring Manual Memory Setttings"
108
109=== added file 'tests/01-test'
110--- tests/01-test 1970-01-01 00:00:00 +0000
111+++ tests/01-test 2014-08-25 17:51:57 +0000
112@@ -0,0 +1,3 @@
113+#!/bin/bash
114+# Run the cassandra tests that are in the Makefile.
115+make

Subscribers

People subscribed via source and target branches

to all changes: