-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support building and running Java apps in non-isolated mode
Added new java-non-isolated module and refactored scripts/module.py to provide isolated_jvm and non_isolated_jvm as a way to build and run java apps in isolated (old default) and non-isolated mode. The non-isolated mode gets enabled by module.py that detects if selected java module (provides = ['java']) has following attribute set to true like so: non_isolated_jvm = True Example to build an image with isolated JVM (default): ./scripts/build image=java,java-example Example to build an image with non-isolated JVM: ./scripts/build image=java-non-isolated,java-example Fixes #800 Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com> Message-Id: <1476475985-1980-1-git-send-email-jwkozaczuk@gmail.com>
- Loading branch information
Showing
4 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# TODO: need to move compilation of $(java-targets) from the main makefile | ||
# to here. Unfortunately, compiling with OSv header files is a big mess, | ||
# and much easier to do it in the main OSv makefile :-( | ||
SRC = $(shell readlink -f ../..) | ||
module: | ||
cd $(SRC)/java && mvn package -DskipTests=true | ||
|
||
clean: | ||
cd $(SRC)/java && mvn clean | ||
-rm -f dependency-reduced-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from osv.modules.filemap import FileMap | ||
from osv.modules import api | ||
import os, os.path | ||
|
||
usr_files = FileMap() | ||
|
||
provides = ['java'] | ||
|
||
non_isolated_jvm = True | ||
|
||
api.require('fonts') | ||
api.require('ca-certificates') | ||
api.require('libz') | ||
api.require('josvsym') | ||
api.require('httpserver-jolokia-plugin') | ||
api.require('httpserver-jvm-plugin') | ||
|
||
jdkdir = os.path.basename(os.path.expandvars('${jdkbase}')) | ||
|
||
usr_files.add('${jdkbase}').to('/usr/lib/jvm/java') \ | ||
.include('lib/**') \ | ||
.include('jre/**') \ | ||
.exclude('jre/lib/security/cacerts') \ | ||
.exclude('jre/lib/audio/**') | ||
|
||
usr_files.link('/usr/lib/jvm/' + jdkdir).to('java') | ||
usr_files.link('/usr/lib/jvm/jre').to('java/jre') | ||
usr_files.link('/usr/lib/jvm/java/jre/lib/security/cacerts').to('/etc/pki/java/cacerts') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# Copyright (C) 2013-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. | ||
# | ||
|
||
[manifest] | ||
/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 | ||
/usr/lib/libosv.so: libosv.so | ||
/usr/lib/jvm/java/jre/lib/ext/runjava.jar: ${OSV_BASE}/java/runjava/target/runjava.jar | ||
/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters