summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Smith <mike.smith@codethink.co.uk>2014-12-11 14:23:59 (GMT)
committerMike Smith <mike.smith@codethink.co.uk>2014-12-18 13:29:42 (GMT)
commitefbe0573ce48cfe860345a683e40c27debcb894b (patch)
treef279c18f23db73a3498cb80a21fc7d2d0566e0fe
parentf7dd00169f2482a4db7087008317589848afed32 (diff)
downloaddefinitions-efbe0573ce48cfe860345a683e40c27debcb894b.tar.gz
Add chunks for Java, ANT and ZooKeeper
Java is sourced from the binary Java release from Oracle. This chunk was originally written by Francisco Marchena. ANT is a Java build system and is needed by ZooKeeper. ZooKeeper itself is documented at http://zookeeper.apache.org/ This patch also brings in a zookeeper test program in a seperate strata that can be safely discarded if not required. this test program was written by me, <mike.smith@codethink.co.uk> and is not designed to be used in any practical way, but to showcase the functionality of zookeeper within baserock The ZooKeeper demonstration server and client are currently hosted on baserock/test. The Java binary chunk only works for x86_64. As such, these systems are limited to that architecture.
-rw-r--r--clusters/zookeeper.morph21
-rw-r--r--strata/zookeeper-client.morph17
-rw-r--r--strata/zookeeper-server.morph11
-rw-r--r--strata/zookeeper.morph31
-rw-r--r--strata/zookeeper/java-ant.morph8
-rw-r--r--strata/zookeeper/java-binary.morph11
-rw-r--r--strata/zookeeper/zookeeper-client.morph17
-rw-r--r--strata/zookeeper/zookeeper-server.morph30
-rw-r--r--strata/zookeeper/zookeeper.morph14
-rw-r--r--systems/zookeeper-client-x86_64.morph23
-rw-r--r--systems/zookeeper-server-x86_64.morph23
11 files changed, 206 insertions, 0 deletions
diff --git a/clusters/zookeeper.morph b/clusters/zookeeper.morph
new file mode 100644
index 0000000..1153d4b
--- /dev/null
+++ b/clusters/zookeeper.morph
@@ -0,0 +1,21 @@
+name: zookeeper
+kind: cluster
+systems:
+ - morph: systems/zookeeper-client-x86_64.morph
+ deploy:
+ my-client-system:
+ type: kvm
+ location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-client.img
+ DISK_SIZE: 4G
+ RAM_SIZE: 1G
+ VCPUS: 1
+ HOSTNAME: zkclient
+ - morph: systems/zookeeper-server-x86_64.morph
+ deploy:
+ my-server-system:
+ type: kvm
+ location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-server.img
+ DISK_SIZE: 4G
+ RAM_SIZE: 1G
+ VCPUS: 1
+ HOSTNAME: zkserver
diff --git a/strata/zookeeper-client.morph b/strata/zookeeper-client.morph
new file mode 100644
index 0000000..d4502ea
--- /dev/null
+++ b/strata/zookeeper-client.morph
@@ -0,0 +1,17 @@
+name: zookeeper-client
+kind: stratum
+description: |
+ This stratum installs a small demonstration program for the
+ client side of ZooKeeper. The program can take up to two
+ arguments:
+ (1) The IP address of the ZooKeeper server to connect to
+ (2) The type of client that this will be (default client
+ types are typeOneNode & typeTwoNode)
+build-depends:
+- morph: strata/zookeeper.morph
+chunks:
+- name: zookeeper-client
+ morph: strata/zookeeper/zookeeper-client.morph
+ repo: baserock:tests/zookeeper-test
+ ref: master
+ build-depends: []
diff --git a/strata/zookeeper-server.morph b/strata/zookeeper-server.morph
new file mode 100644
index 0000000..6ad4269
--- /dev/null
+++ b/strata/zookeeper-server.morph
@@ -0,0 +1,11 @@
+name: zookeeper-server
+kind: stratum
+description: This Stratum installs a zookeeper server and small program to populate it with default data.
+build-depends:
+- morph: strata/zookeeper.morph
+chunks:
+- name: zookeeper-server
+ morph: strata/zookeeper/zookeeper-server.morph
+ repo: baserock:tests/zookeeper-test
+ ref: master
+ build-depends: []
diff --git a/strata/zookeeper.morph b/strata/zookeeper.morph
new file mode 100644
index 0000000..3bcd5cc
--- /dev/null
+++ b/strata/zookeeper.morph
@@ -0,0 +1,31 @@
+name: zookeeper
+kind: stratum
+description: |
+ This stratum installs zookeeper and its dependencies.
+build-depends:
+- morph: strata/core.morph
+chunks:
+- name: cppunit
+ repo: upstream:cppunit
+ ref: 77bb121d73c4593d6e3addacacb1bfbd21f53dcf
+ build-depends: []
+- name: java-binary
+ morph: strata/zookeeper/java-binary.morph
+ repo: github:franred/gerrit-installation-binaries
+ ref: ef262c635890f19eaff8ef6bbd831ee9b0d8693e
+ unpetrify-ref: master
+ build-depends: []
+- name: java-ant
+ morph: strata/zookeeper/java-ant.morph
+ repo: upstream:java/ant
+ ref: master
+ build-depends:
+ - cppunit
+ - java-binary
+- name: zookeeper
+ morph: strata/zookeeper/zookeeper.morph
+ repo: upstream:zookeeper
+ ref: baserock/mikesmith/zookeeper
+ unpetrify-ref: trunk
+ build-depends:
+ - java-ant
diff --git a/strata/zookeeper/java-ant.morph b/strata/zookeeper/java-ant.morph
new file mode 100644
index 0000000..37d402b
--- /dev/null
+++ b/strata/zookeeper/java-ant.morph
@@ -0,0 +1,8 @@
+name: ant
+kind: chunk
+build-commands:
+- |
+ export JAVA_HOME=/usr/lib/jdk1.8.0_20
+ sh build.sh -Ddist.dir="$DESTDIR/usr/lib/ant" dist
+- mkdir -p "${DESTDIR}${PREFIX}/bin"
+- ln -sf "${PREFIX}/lib/ant/bin/ant" "${DESTDIR}${PREFIX}/bin/ant"
diff --git a/strata/zookeeper/java-binary.morph b/strata/zookeeper/java-binary.morph
new file mode 100644
index 0000000..a6c11f9
--- /dev/null
+++ b/strata/zookeeper/java-binary.morph
@@ -0,0 +1,11 @@
+name: java-binary
+kind: chunk
+configure-commands: []
+build-commands:
+- cat jdk-8u20-linux-x64.tar.gz_* > jdk-8u20-linux-x64.tar.gz
+install-commands:
+- mkdir -p "$DESTDIR$PREFIX"/bin
+- mkdir -p "$DESTDIR$PREFIX"/lib
+- tar zxf jdk-8u20-linux-x64.tar.gz -C "$DESTDIR$PREFIX"/lib
+- unzip jce_policy-8.zip -d "$DESTDIR$PREFIX"/lib/jdk1.8.0_20/jre/lib/security
+- ln -sfn "$PREFIX"/lib/jdk1.8.0_20/jre/bin/java "$DESTDIR$PREFIX"/bin/
diff --git a/strata/zookeeper/zookeeper-client.morph b/strata/zookeeper/zookeeper-client.morph
new file mode 100644
index 0000000..591c184
--- /dev/null
+++ b/strata/zookeeper/zookeeper-client.morph
@@ -0,0 +1,17 @@
+name: zookeeper-client
+kind: chunk
+build-commands:
+ - mkdir -p "$DESTDIR$PREFIX"/zookeeper-client
+ - cp -r * "$DESTDIR$PREFIX"/zookeeper-client
+ - make -C "$DESTDIR$PREFIX"/zookeeper-client/ZKTest/Release/
+post-install-commands:
+ - |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-client.service
+ [unit]
+ Description=Zookeeper client init
+ [Service]
+ ExecStart=/usr/zookeeper-client/ZKTest/Release/ZKTest nodeTypeOne 10.24.1.198
+ RemainAfterExit=yes
+ [Install]
+ WantedBy=multi-user.target
+ EOF
diff --git a/strata/zookeeper/zookeeper-server.morph b/strata/zookeeper/zookeeper-server.morph
new file mode 100644
index 0000000..082c063
--- /dev/null
+++ b/strata/zookeeper/zookeeper-server.morph
@@ -0,0 +1,30 @@
+name: zookeeper-server
+kind: chunk
+build-commands:
+ - mkdir -p "$DESTDIR$PREFIX"/zookeeper_server
+ - cp -r * "$DESTDIR$PREFIX"/zookeeper_server
+ - make -C "$DESTDIR$PREFIX"/zookeeper_server/zkServerFileSetup/Release/
+post-install-commands:
+ - |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-server.service
+ [unit]
+ Description=Zookeeper server
+ [Service]
+ ExecStart=/usr/zookeeper/bin/zkServer.sh start
+ RemainAfterExit=yes
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-init.service
+ [unit]
+ Description=Zookeeper server init
+ [Service]
+ ExecStart=/usr/zookeeper_server/zkServerFileSetup/Release/zkServerFileSetup
+ RemainAfterExit=no
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - mkdir "$DESTDIR"/etc/systemd/system/multi-user.target.wants
+ - ln -s "$DESTDIR"/etc/systemd/system/zookeeper-server.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-server.service
+ - ln -s "$DESTDIR"/etc/systemd/system/zookeeper-init.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-init.service
diff --git a/strata/zookeeper/zookeeper.morph b/strata/zookeeper/zookeeper.morph
new file mode 100644
index 0000000..dbe6ccb
--- /dev/null
+++ b/strata/zookeeper/zookeeper.morph
@@ -0,0 +1,14 @@
+name: zookeeper
+kind: chunk
+configure-commands:
+ - mkdir -p "$DESTDIR$PREFIX"/lib/zookeeper
+build-commands:
+ - ant -p compile_jute
+ - mkdir -p "$DESTDIR$PREFIX"/zookeeper
+ - cp -r * "$DESTDIR$PREFIX"/zookeeper
+ - cd "$DESTDIR$PREFIX"/zookeeper/src/c && autoreconf -i
+ - cd "$DESTDIR$PREFIX"/zookeeper/src/c && ./configure --prefix="$PREFIX" --libdir="$PREFIX"/lib/
+ - make -C "$DESTDIR$PREFIX"/zookeeper/src/c
+ - cd "$DESTDIR$PREFIX"/zookeeper/src/c && make install
+ - mv "$DESTDIR$PREFIX"/zookeeper/conf/zoo_sample.cfg "$DESTDIR$PREFIX"/zookeeper/conf/zoo.cfg
+ - make -C "$DESTDIR$PREFIX"/zookeeper/src/c zktest-mt
diff --git a/systems/zookeeper-client-x86_64.morph b/systems/zookeeper-client-x86_64.morph
new file mode 100644
index 0000000..c8ac778
--- /dev/null
+++ b/systems/zookeeper-client-x86_64.morph
@@ -0,0 +1,23 @@
+name: zookeeper-client-x86_64
+kind: system
+description: |
+ A system that is able to build other systems based on the 64-bit x86
+ architecture. includes the installation of zookeeper and a test client.
+arch: x86_64
+strata:
+- name: build-essential
+ morph: strata/build-essential.morph
+- name: core
+ morph: strata/core.morph
+- name: foundation
+ morph: strata/foundation.morph
+- name: bsp-x86_64-generic
+ morph: strata/bsp-x86_64-generic.morph
+- name: zookeeper-client
+ morph: strata/zookeeper-client.morph
+configuration-extensions:
+- set-hostname
+- add-config-files
+- simple-network
+- nfsboot
+- install-files
diff --git a/systems/zookeeper-server-x86_64.morph b/systems/zookeeper-server-x86_64.morph
new file mode 100644
index 0000000..ad022a9
--- /dev/null
+++ b/systems/zookeeper-server-x86_64.morph
@@ -0,0 +1,23 @@
+name: zookeeper-server-X86_64
+kind: system
+description: |
+ A system that is able to build other systems based on the 64-bit x86
+ architecture. includes the zookeeper server and setup for basic tests
+arch: x86_64
+strata:
+- name: build-essential
+ morph: strata/build-essential.morph
+- name: core
+ morph: strata/core.morph
+- name: foundation
+ morph: strata/foundation.morph
+- name: bsp-x86_64-generic
+ morph: strata/bsp-x86_64-generic.morph
+- name: zookeeper-server
+ morph: strata/zookeeper-server.morph
+configuration-extensions:
+- set-hostname
+- add-config-files
+- simple-network
+- nfsboot
+- install-files