Merge ~athos-ribeiro/+git/cassandra:initial-review into ~athos-ribeiro/+git/cassandra:master

Proposed by Athos Ribeiro
Status: Merged
Merged at revision: 93cd9f8e9a129bef05e98a59ab19baa404249537
Proposed branch: ~athos-ribeiro/+git/cassandra:initial-review
Merge into: ~athos-ribeiro/+git/cassandra:master
Diff against target: 85 lines (+17/-10)
2 files modified
snap/snapcraft.yaml (+13/-8)
wrapper-cassandra (+4/-2)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior (community) Approve
Bryce Harrington Pending
Canonical Server Pending
Review via email: mp+404147@code.launchpad.net

Description of the change

Addressing Sergio's comments from the mailing list review at https://lists.launchpad.net/ubuntu-docker-images/msg00031.html

The core-20 request was not addressed: we need to use core-18 for the ant plugin.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP, Athos.

It's a bummer that we can't use core20 for this snap. I think it's OK to keep it as core18, but we should keep a TODO to revisit this when possible and investigate what needs to be done to covert to core20.

I'm leaving a question about the $non_proxy_host variable, but otherwise this LGTM.

review: Needs Information
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Hi Sergio,

Thanks for the review.

I make a few additional adjustments to the snap to make sure it runs in strict mode.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the follow up. I found a typo in the description, but other than that the changes LGTM now. I confess I didn't try to build the snap locally nor install it in a VM; I will do that now before I approve this MP.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks!

I fixed the typo and force pushed to fix the bogus commit.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Alright, I built the snap locally and things seemed to work OK. I noticed a few errors during the build, but it finished.

I was also able to install the snap inside a VM and start the service. I noticed that the startup process tries to read /proc/sys/vm/max_map_count but fails because of permission issues; it's worth considering fixing this later, but it's certainly not a blocker.

Another interesting thing is that I noticed the snap doesn't use libjemalloc. I'm not sure if it's possible to include it in the snap, but it's also worth considering.

All in all, this LGTM so I'm approving the MP. Thanks.

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks for the review, Sergio.

I will make adjustments to the OCI based on these snap changes. After that, I will re-visit the snap to include cqlsh, verify the /proc/sys/vm/max_map_count issue, and analyze including libjemalloc.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
2index 8b47d02..431f57c 100644
3--- a/snap/snapcraft.yaml
4+++ b/snap/snapcraft.yaml
5@@ -4,15 +4,13 @@ adopt-info: cassandra
6 base: core18
7 summary: Manage massive amounts of data, fast, without losing sleep
8 description: |
9- The Apache Cassandra database is the right choice when you need
10- scalability and high availability without compromising performance. Linear
11- scalability and proven fault-tolerance on commodity hardware or cloud
12- infrastructure make it the perfect platform for mission-critical
13- data.Cassandra's support for replicating across multiple datacenters is
14- best-in-class, providing lower latency for your users and the peace of
15- mind of knowing that you can survive regional outages.
16+ Apache Cassandra is an open source NoSQL distributed database trusted by
17+ thousands of companies for scalability and high availability without
18+ compromising performance. Linear scalability and proven fault-tolerance on
19+ commodity hardware or cloud infrastructure make it a good platform for
20+ mission-critical data.
21
22-confinement: devmode
23+confinement: strict
24 grade: devel
25
26 apps:
27@@ -69,6 +67,8 @@ parts:
28 # remove http(s):// from hosts
29 http_host=$(echo $http_host | sed 's;^https\?://;;')
30 https_host=$(echo $https_host | sed 's;^https\?://;;')
31+ non_proxy_hosts=$(echo $no_proxy | sed -e 's;https\?://;;g' -e 's/\s*,\s*/|/g')
32+ non_proxy_hosts=${non_proxy_hosts:=localhost}
33 cat << EOF > $HOME/.m2/settings.xml
34 <?xml version="1.0" encoding="UTF-8"?>
35 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
36@@ -81,6 +81,7 @@ parts:
37 <protocol>http</protocol>
38 <host>${http_host}</host>
39 <port>${http_port}</port>
40+ <nonProxyHosts>${non_proxy_hosts}</nonProxyHosts>
41 </proxy>
42 <proxy>
43 <id>launchpad-proxy-https</id>
44@@ -88,6 +89,7 @@ parts:
45 <protocol>https</protocol>
46 <host>${https_host}</host>
47 <port>${https_port}</port>
48+ <nonProxyHosts>${non_proxy_hosts}</nonProxyHosts>
49 </proxy>
50 </proxies>
51 </settings>
52@@ -110,6 +112,9 @@ parts:
53 fi
54 snapcraftctl set-version "${candidate_version}"
55 snapcraftctl build
56+ override-stage: |
57+ snapcraftctl stage
58+ chmod +x usr/sbin/cassandra
59 build-packages:
60 - ant-optional
61 - build-essential
62diff --git a/wrapper-cassandra b/wrapper-cassandra
63index 401a29f..b47a21c 100755
64--- a/wrapper-cassandra
65+++ b/wrapper-cassandra
66@@ -7,7 +7,7 @@
67 [ -e "$CASSANDRA_DATA" ] || mkdir "$CASSANDRA_DATA"
68
69 # Required config files. Use the default if one is not provided.
70-for f in cassandra.yaml logback.xml cassandra-env.sh jvm.options; do
71+for f in cassandra.yaml logback.xml cassandra-env.sh jvm8-server.options; do
72 if [ ! -e "$CASSANDRA_CONF/$f" ]; then
73 if [ "$f" = "cassandra-env.sh" ]; then
74 # Libraries are in /usr/share/cassandra, not CASSANDRA_HOME
75@@ -20,7 +20,9 @@ for f in cassandra.yaml logback.xml cassandra-env.sh jvm.options; do
76 done
77
78 export cassandra_storagedir="$CASSANDRA_DATA"
79-export JVM_OPTS="$JVM_OPTS -Dcassandra.config=file://$CASSANDRA_CONF/cassandra.yaml"
80+export JNA_TMPDIR="$SNAP_DATA/tmp/JNA"
81+mkdir -p $JNA_TMPDIR
82+export JVM_OPTS="$JVM_OPTS -Dcassandra.config=file://$CASSANDRA_CONF/cassandra.yaml -Djna.tmpdir=$JNA_TMPDIR"
83
84 # The -x bit isn't set on cassandra
85 /bin/sh $SNAP/usr/sbin/cassandra -R -p "$CASSANDRA_HOME/cassandra.pid"

Subscribers

People subscribed via source and target branches

to all changes: