From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master
Added new Java apps and modified exiting OpenJDK 8 base apps to include new
policy file and new location of runjava.jar
Added elasticsearch app.
Added apache derby app.
Added Java 9 java.base app.
Modified existing openjdk8-fedora-non-isolated, openjdk8-fedora and
openjdk8-zulu-compact<N> base apps to copy
runjava.jar under new location and place new java.policy file to give
enough permissions to newly located
runjava.jar
Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
Message-Id: <1477456516-2410-1-git-send-email-jwkozac...@gmail.com>
---
diff --git a/apache-derby/Makefile b/apache-derby/Makefile
--- a/apache-derby/Makefile
+++ b/apache-derby/Makefile
@@ -0,0 +1,21 @@
+.PHONY: module
+
+VERSION := 10.10.2.0
+
+module: ROOTFS
+
+db-derby-$(VERSION)-bin.tar.gz:
+ wget
http://archive.apache.org/dist/db/derby/db-derby-10.10.2.0/db-derby-10.10.2.0-bin.tar.gz
+
+ROOTFS/db-derby: db-derby-$(VERSION)-bin.tar.gz
+ mkdir -p ROOTFS/db-derby
+ tar xvf db-derby-$(VERSION)-bin.tar.gz
+ cp -a db-derby-$(VERSION)-bin/lib ROOTFS/db-derby
+
+ROOTFS/db-derby/security.policy:
+ cp security.policy ROOTFS/db-derby
+
+ROOTFS: ROOTFS/db-derby ROOTFS/db-derby/security.policy
+
+clean:
+ rm -rf ROOTFS db-derby-*
diff --git a/apache-derby/module.py b/apache-derby/module.py
--- a/apache-derby/module.py
+++ b/apache-derby/module.py
@@ -0,0 +1,9 @@
+from osv.modules import api
+
+api.require('java')
+
+_classpath =
["/db-derby/lib/derby.jar", "/db-derby/lib/derbynet.jar", "/db-derby/lib/derbytools.jar", "/db-derby/lib/derbyclient.jar"]
+_args =
["-Djava.security.policy=/db-derby/security.policy", "org.apache.derby.drda.NetworkServerControl", "start"]
+
+default = api.run_java(classpath = _classpath, args = _args)
+
diff --git a/apache-derby/security.policy b/apache-derby/security.policy
--- a/apache-derby/security.policy
+++ b/apache-derby/security.policy
@@ -0,0 +1,3 @@
+grant {
+ permission java.security.AllPermission;
+};
diff --git a/apache-derby/usr.manifest b/apache-derby/usr.manifest
--- a/apache-derby/usr.manifest
+++ b/apache-derby/usr.manifest
@@ -0,0 +1 @@
+/db-derby/**: ${MODULE_DIR}/ROOTFS/db-derby/**
diff --git a/elasticsearch/Makefile b/elasticsearch/Makefile
--- a/elasticsearch/Makefile
+++ b/elasticsearch/Makefile
@@ -0,0 +1,26 @@
+VERSION:=2.4.0
+NAME:=elasticsearch
+DIR:=$(NAME)-$(VERSION)
+TARBALL:=$(DIR).tar.gz
+URL:=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/$(VERSION)/$(TARBALL)
+
+module: ROOTFS usr.manifest
+
+$(TARBALL):
+ wget $(URL)
+
+ROOTFS/$(NAME): $(TARBALL)
+ tar xvf $(TARBALL)
+ mkdir -p ROOTFS
+ mv $(DIR) ROOTFS/$(NAME)
+ touch ROOTFS/$(NAME)
+ find ./assets/config -type f -exec cp {} ROOTFS/$(NAME)/config/. \;
+
+usr.manifest:
+ echo "/$(NAME)/**: \$${MODULE_DIR}/ROOTFS/$(NAME)/**" > usr.manifest
+
+clean:
+ rm -rf ROOTFS $(DIR)
+ rm -f usr.manifest $(TARBALL)
+
+ROOTFS: ROOTFS/$(NAME)
diff --git a/elasticsearch/assets/config/elasticsearch.yml
b/elasticsearch/assets/config/elasticsearch.yml
--- a/elasticsearch/assets/config/elasticsearch.yml
+++ b/elasticsearch/assets/config/elasticsearch.yml
@@ -0,0 +1,97 @@
+# ======================== Elasticsearch Configuration
=========================
+#
+# NOTE: Elasticsearch comes with reasonable defaults for most settings.
+# Before you set out to tweak and tune the configuration, make sure
you
+# understand what are you trying to accomplish and the consequences.
+#
+# The primary way of configuring a node is via this file. This template
lists
+# the most important settings you may want to configure for a production
cluster.
+#
+# Please see the documentation for further information on configuration
options:
+#
<http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
+#
+# ---------------------------------- Cluster
-----------------------------------
+#
+# Use a descriptive name for your cluster:
+#
+# cluster.name: my-application
+#
+# ------------------------------------ Node
------------------------------------
+#
+# Use a descriptive name for the node:
+#
+# node.name: node-1
+#
+# Add custom attributes to the node:
+#
+# node.rack: r1
+#
+# ----------------------------------- Paths
------------------------------------
+#
+# Path to directory where to store the data (separate multiple locations
by comma):
+#
+# path.data: /path/to/data
+#
+# Path to log files:
+#
+# path.logs: /path/to/logs
+#
+# ----------------------------------- Memory
-----------------------------------
+#
+# Lock the memory on startup:
+#
+#bootstrap.mlockall: false
+#bootstrap.ctrlhandler: false
+bootstrap.seccomp: false
+#
+# Make sure that the `ES_HEAP_SIZE` environment variable is set to about
half the memory
+# available on the system and that the owner of the process is allowed to
use this limit.
+#
+# Elasticsearch performs poorly when the system is swapping the memory.
+#
+# ---------------------------------- Network
-----------------------------------
+#
+# Set the bind address to a specific IP (IPv4 or IPv6):
+#
+network.host: 0.0.0.0
+#
+# Set a custom port for HTTP:
+#
+# http.port: 9200
+#
+# For more information, see the documentation at:
+#
<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
+#
+# --------------------------------- Discovery
----------------------------------
+#
+# Pass an initial list of hosts to perform discovery when new node is
started:
+# The default list of hosts is ["127.0.0.1", "[::1]"]
+#
+# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
+#
+# Prevent the "split brain" by configuring the majority of nodes (total
number of nodes / 2 + 1):
+#
+# discovery.zen.minimum_master_nodes: 3
+#
+# For more information, see the documentation at:
+#
<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
+#
+# ---------------------------------- Gateway
-----------------------------------
+#
+# Block initial recovery after a full cluster restart until N nodes are
started:
+#
+# gateway.recover_after_nodes: 3
+#
+# For more information, see the documentation at:
+#
<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
+#
+# ---------------------------------- Various
-----------------------------------
+#
+# Disable starting multiple nodes on a single system:
+#
+# node.max_local_storage_nodes: 1
+#
+# Require explicit names when deleting indices:
+#
+# action.destructive_requires_name: true
+security.manager.enabled: false
diff --git a/elasticsearch/assets/config/logging.yml
b/elasticsearch/assets/config/logging.yml
--- a/elasticsearch/assets/config/logging.yml
+++ b/elasticsearch/assets/config/logging.yml
@@ -0,0 +1,85 @@
+# you can override this using by setting a system property, for example
-Des.logger.level=DEBUG
+es.logger.level: INFO
+rootLogger: ${es.logger.level}, console, file
+logger:
+ # log action execution errors for easier debugging
+ action: DEBUG
+
+ # deprecation logging, turn to DEBUG to see them
+ deprecation: INFO, deprecation_log_file
+
+ # reduce the logging for aws, too much is logged under the default INFO
+ com.amazonaws: WARN
+ # aws will try to do some sketchy JMX stuff, but its not needed.
+ com.amazonaws.jmx.SdkMBeanRegistrySupport: ERROR
+ com.amazonaws.metrics.AwsSdkMetrics: ERROR
+
+ org.apache.http: INFO
+
+ # gateway
+ #gateway: DEBUG
+ #index.gateway: DEBUG
+
+ # peer shard recovery
+ #indices.recovery: DEBUG
+
+ # discovery
+ #discovery: TRACE
+
+ index.search.slowlog: TRACE, index_search_slow_log_file
+ index.indexing.slowlog: TRACE, index_indexing_slow_log_file
+
+additivity:
+ index.search.slowlog: false
+ index.indexing.slowlog: false
+ deprecation: false
+
+appender:
+ console:
+ type: console
+ layout:
+ type: consolePattern
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
+
+ file:
+ type: dailyRollingFile
+ file: ${path.logs}/${cluster.name}.log
+ datePattern: "'.'yyyy-MM-dd"
+ layout:
+ type: pattern
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %.10000m%n"
+
+ # Use the following log4j-extras RollingFileAppender to enable gzip
compression of log files.
+ # For more information see
https://logging.apache.org/log4j/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
+ #file:
+ #type: extrasRollingFile
+ #file: ${path.logs}/${cluster.name}.log
+ #rollingPolicy: timeBased
+ #rollingPolicy.FileNamePattern:
${path.logs}/${cluster.name}.log.%d{yyyy-MM-dd}.gz
+ #layout:
+ #type: pattern
+ #conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
+
+ deprecation_log_file:
+ type: dailyRollingFile
+ file: ${path.logs}/${cluster.name}_deprecation.log
+ datePattern: "'.'yyyy-MM-dd"
+ layout:
+ type: pattern
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
+
+ index_search_slow_log_file:
+ type: dailyRollingFile
+ file: ${path.logs}/${cluster.name}_index_search_slowlog.log
+ datePattern: "'.'yyyy-MM-dd"
+ layout:
+ type: pattern
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
+
+ index_indexing_slow_log_file:
+ type: dailyRollingFile
+ file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
+ datePattern: "'.'yyyy-MM-dd"
+ layout:
+ type: pattern
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
diff --git a/elasticsearch/module.py b/elasticsearch/module.py
--- a/elasticsearch/module.py
+++ b/elasticsearch/module.py
@@ -0,0 +1,25 @@
+from osv.modules import api
+
+api.require('java')
+
+default = api.run(
+' --cwd=/elasticsearch '
+' /java.so '
+' -Xms256m '
+' -Xmx1g '
+' -Djava.awt.headless=true '
+' -XX:+UseParNewGC '
+' -XX:+UseConcMarkSweepGC '
+' -XX:CMSInitiatingOccupancyFraction=75 '
+' -XX:+UseCMSInitiatingOccupancyOnly '
+' -XX:+HeapDumpOnOutOfMemoryError '
+' -XX:+DisableExplicitGC '
+' -Dfile.encoding=UTF-8 '
+' -Dosv.java.diagnostics '
+' -Djna.nosys=true '
+' -Des.insecure.allow.root=true '
+' -Des.path.home=/elasticsearch '
+' -Des.foreground=true '
+' -cp /elasticsearch/lib/elasticsearch-2.4.0.jar:/elasticsearch/lib/* '
+' org.elasticsearch.bootstrap.Elasticsearch '
+' start ')
diff --git a/openjdk8-fedora-non-isolated/Makefile
b/openjdk8-fedora-non-isolated/Makefile
--- a/openjdk8-fedora-non-isolated/Makefile
+++ b/openjdk8-fedora-non-isolated/Makefile
@@ -31,7 +31,6 @@ module:
rm -rf $(jvm_dir)/java/jre/lib/security/cacerts
rm -rf $(jvm_dir)/java/jre/lib/audio/*
rpm2cpio upstream/$(tzdata_fullname) | (cd install && cpio -id)
- cp $(SRC)/java/runjava/target/runjava.jar
install/usr/lib/jvm/java/jre/lib/ext/
ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/
clean:
diff --git a/openjdk8-fedora-non-isolated/usr.manifest
b/openjdk8-fedora-non-isolated/usr.manifest
--- a/openjdk8-fedora-non-isolated/usr.manifest
+++ b/openjdk8-fedora-non-isolated/usr.manifest
@@ -17,4 +17,6 @@
/usr/lib/&/jni/tracepoint.so: java/&
/usr/lib/&/jni/power.so: java/&
/java.so: java/jvm/java_non_isolated.so
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
diff --git a/openjdk8-fedora/Makefile b/openjdk8-fedora/Makefile
--- a/openjdk8-fedora/Makefile
+++ b/openjdk8-fedora/Makefile
@@ -31,7 +31,6 @@ module:
rm -rf $(jvm_dir)/java/jre/lib/security/cacerts
rm -rf $(jvm_dir)/java/jre/lib/audio/*
rpm2cpio upstream/$(tzdata_fullname) | (cd install && cpio -id)
- cp $(SRC)/java/runjava/target/runjava.jar
install/usr/lib/jvm/java/jre/lib/ext/
ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/
clean:
diff --git a/openjdk8-fedora/usr.manifest b/openjdk8-fedora/usr.manifest
--- a/openjdk8-fedora/usr.manifest
+++ b/openjdk8-fedora/usr.manifest
@@ -17,4 +17,6 @@
/usr/lib/&/jni/tracepoint.so: java/&
/usr/lib/&/jni/power.so: java/&
/java.so: java/jvm/java.so
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
diff --git a/openjdk8-zulu-compact-common/common.gmk
b/openjdk8-zulu-compact-common/common.gmk
--- a/openjdk8-zulu-compact-common/common.gmk
+++ b/openjdk8-zulu-compact-common/common.gmk
@@ -28,7 +28,6 @@ module:
rm -rf $(jvm_dir)/java/jre/bin
rm -rf $(jvm_dir)/java/jre/lib/security/cacerts
rm -rf $(jvm_dir)/java/jre/lib/audio/*
- cp $(SRC)/java/runjava/target/runjava.jar
install/usr/lib/jvm/java/jre/lib/ext/
ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/
clean:
diff --git a/openjdk8-zulu-compact1/usr.manifest
b/openjdk8-zulu-compact1/usr.manifest
--- a/openjdk8-zulu-compact1/usr.manifest
+++ b/openjdk8-zulu-compact1/usr.manifest
@@ -18,3 +18,5 @@
/usr/lib/&/jni/power.so: java/&
/java.so: java/jvm/java_non_isolated.so
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
diff --git a/openjdk8-zulu-compact2/usr.manifest
b/openjdk8-zulu-compact2/usr.manifest
--- a/openjdk8-zulu-compact2/usr.manifest
+++ b/openjdk8-zulu-compact2/usr.manifest
@@ -18,3 +18,5 @@
/usr/lib/&/jni/power.so: java/&
/java.so: java/jvm/java_non_isolated.so
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
diff --git a/openjdk8-zulu-compact3/usr.manifest
b/openjdk8-zulu-compact3/usr.manifest
--- a/openjdk8-zulu-compact3/usr.manifest
+++ b/openjdk8-zulu-compact3/usr.manifest
@@ -18,3 +18,5 @@
/usr/lib/&/jni/power.so: java/&
/java.so: java/jvm/java_non_isolated.so
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
diff --git a/openjdk9-ea-java.base/Makefile b/openjdk9-ea-java.base/Makefile
--- a/openjdk9-ea-java.base/Makefile
+++ b/openjdk9-ea-java.base/Makefile
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2013 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+.PHONY: module clean
+
+jvm_dir=install/usr/lib/jvm
+
+java_version=$(shell ./latest.sh)
+java_dir=http://www.java.net/download/java/jdk9/archive/$(java_version)/binaries/
+java_fullname=jdk-9-ea+$(java_version)_linux-x64_bin.tar.gz
+
+jre_name=jdk-9-ea-$(java_version)-java-base
+linked_jre_dir=usr/lib/jvm/$(jre_name)
+
+SRC = $(shell readlink -f ../..)
+
+module:
+ cd $(SRC)/java && mvn package -q -DskipTests=true
+ mkdir -p upstream
+ wget -c -O upstream/$(java_fullname) $(java_dir)$(java_fullname)
+ rm -rf install
+ mkdir -p install/$(linked_jre_dir)
+ cd install && tar xfz ../upstream/$(java_fullname)
+ cd install && jdk-9/bin/jlink --module-path jdk-9/jmods --add-modules
java.base --output $(linked_jre_dir)/jre --strip-debug --compress=2
+ rm -rf install/jdk-9
+ ln -sf $(jre_name) $(jvm_dir)/java
+ rm -rf $(jvm_dir)/java/jre/lib/security/cacerts
+ rm -rf $(jvm_dir)/java/jre/lib/audio/*
+ ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/
+
+clean:
+ rm -rf upstream install
+ cd $(SRC)/java && mvn clean -q
+ -rm -f dependency-reduced-pom.xml
diff --git a/openjdk9-ea-java.base/latest.sh
b/openjdk9-ea-java.base/latest.sh
--- a/openjdk9-ea-java.base/latest.sh
+++ b/openjdk9-ea-java.base/latest.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+wget -qO- https://jdk9.java.net/download/ |
grep "document.getElementById(\"lin64JDKrpm\").href = \"http" | grep
-o "http://.*tar.gz" | grep -o "ea+[0-9]\+_linux" | grep -o "[0-9]\+"
diff --git a/openjdk9-ea-java.base/module.py
b/openjdk9-ea-java.base/module.py
--- a/openjdk9-ea-java.base/module.py
+++ b/openjdk9-ea-java.base/module.py
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2014 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+from osv.modules.filemap import FileMap
+from osv.modules import api
+import os, os.path
+
+provides = ['java']
+
+non_isolated_jvm = True
+
+api.require('fonts')
+api.require('ca-certificates')
+api.require('libz')
+api.require('josvsym')
+
+usr_files = FileMap()
+usr_files.add('${OSV_BASE}/apps/openjdk9-ea/install').to('/').allow_symlink()
+usr_files.add('${OSV_BASE}/apps/openjdk9-ea/install/usr/lib/jvm/java') \
+ .to('/usr/lib/jvm/java') \
+ .allow_symlink()
+usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre')
diff --git a/openjdk9-ea-java.base/usr.manifest
b/openjdk9-ea-java.base/usr.manifest
--- a/openjdk9-ea-java.base/usr.manifest
+++ b/openjdk9-ea-java.base/usr.manifest
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2013 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+[manifest]
+/usr/lib/libz.so.1: %(miscbase)s/usr/lib64/libz.so.1
+/usr/lib/&/libexpat.so.1: %(miscbase)s/usr/lib64/&
+/usr/lib/&/libjpeg.so.62: %(miscbase)s/usr/lib64/&
+/usr/lib/jni/balloon.so: java/jni/balloon.so
+/usr/lib/jni/monitor.so: java/jni/monitor.so
+/usr/lib/&/jni/elf-loader.so: java/&
+/usr/lib/&/jni/networking.so: java/&
+/usr/lib/&/jni/stty.so: java/&
+/usr/lib/&/jni/tracepoint.so: java/&
+/usr/lib/&/jni/power.so: java/&
+/java.so: java/jvm/java_non_isolated.so
+/java/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar
+/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
+/.java.policy: ${OSV_BASE}/modules/java/.java.policy
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.