Beispiel #1
0
def build(args):
    add_default = True
    if args.image_config[0] == "!":
        add_default = False
        args.image_config = args.image_config[1:]
    image_config_file = os.path.join(image_configs_dir,
                                     args.image_config + '.py')
    if os.path.exists(image_config_file):
        print("Using image config: %s" % image_config_file)
        config = resolve.local_import(image_config_file)
        run_list = config.get('run', [])
    else:
        # If images/image_config doesn't exist, assume image_config is a
        # comma-separated list of module names, and build an image from those
        # modules (and their dependencies). The command line to run is to
        # run each of the module's "default" command line, in parallel.
        # You can choose a module's non-default command line, with a dot,
        # e.g.: mgmt.shell use's mgmt's "shell" command line.
        print("No such image configuration: " + args.image_config +
              ". Assuming list of modules.")
        run_list = []
        disabled_modules = set()
        for module in args.image_config.split(","):
            if module[0] == '-':
                disabled_modules.add(module[1:])
        module_names = []
        config = resolve.read_config()
        if add_default and "default" in config:
            module_names += config["default"]
        module_names += args.image_config.split(",")
        for missing in list(disabled_modules - set(module_names)):
            raise Exception("Attempt to disable module %s but not enabled" %
                            missing)
        module_names = [i for i in module_names if not i in disabled_modules]
        for module in module_names:
            if module[0] == '-':
                continue
            a = module.split(".", 1)
            name = a[0]
            variant = a[1] if (len(a) > 1) else "default"
            mod = api.require(name)
            if hasattr(mod, variant):
                run_list.append(getattr(mod, variant))
            elif variant != "default" and variant != "none":
                raise Exception("Attribute %s not set in module %s" %
                                (variant, name))

    modules = resolve.get_required_modules()

    print("Modules:")
    if not modules:
        print("  None")
    for module in modules:
        print("  " + module.name)

    make_modules(modules, args)

    apps_to_run = get_basic_apps(run_list)
    generate_manifests(modules, apps_to_run)
    generate_cmdline(apps_to_run)
Beispiel #2
0
def build(args):
    add_default = True
    if args.image_config[0] == "!":
        add_default = False
        args.image_config = args.image_config[1:]
    image_config_file = os.path.join(image_configs_dir, args.image_config + '.py')
    if os.path.exists(image_config_file):
        print("Using image config: %s" % image_config_file)
        config = resolve.local_import(image_config_file)
        run_list = config.get('run', [])
    else:
        # If images/image_config doesn't exist, assume image_config is a
        # comma-separated list of module names, and build an image from those
        # modules (and their dependencies). The command line to run is to
        # run each of the module's "default" command line, in parallel.
        # You can choose a module's non-default command line, with a dot,
        # e.g.: mgmt.shell use's mgmt's "shell" command line.
        print("No such image configuration: " + args.image_config + ". Assuming list of modules.")
        run_list = []
        disabled_modules = set()
        for module in args.image_config.split(","):
            if module[0] == '-':
                disabled_modules.add(module[1:])
        module_names = []
        config = resolve.read_config()
        if add_default and "default" in config:
            module_names +=  config["default"]
        module_names += args.image_config.split(",")
        for missing in list(disabled_modules - set(module_names)):
            raise Exception("Attempt to disable module %s but not enabled" % missing)
        module_names = [i for i in module_names if not i in disabled_modules]
        for module in module_names:
            if module[0] == '-':
                continue
            a = module.split(".", 1)
            name = a[0]
            variant = a[1] if (len(a) > 1) else "default"
            mod = api.require(name)
            if hasattr(mod, variant):
                run_list.append(getattr(mod, variant))
            elif variant != "default" and variant != "none":
                raise Exception("Attribute %s not set in module %s" % (variant, name))

    modules = resolve.get_required_modules()

    print("Modules:")
    if not modules:
        print("  None")
    for module in modules:
        print("  " + module.name)

    make_modules(modules, args)

    apps_to_run = get_basic_apps(run_list)
    generate_manifests(modules, apps_to_run)
    generate_cmdline(apps_to_run)
Beispiel #3
0
from osv.modules.filemap import FileMap
from osv.modules import api
import os, os.path

api.require('java-cmd')
provides = ['java']

usr_files = FileMap()

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')
Beispiel #4
0
from osv.modules import api

api.require('unknown-term')
default = api.run(cmdline="--env=TERM=unknown /python")
Beispiel #5
0
from osv.modules import api

api.require('erlang')
default = api.run(cmdline="/usr/lib64/erlang.so -env HOME / /etc/elixir/vm.args /etc/default/elixir/vm.args")
Beispiel #6
0
from osv.modules import api

api.require('java-tests')
api.require('dl_tests')
Beispiel #7
0
from osv.modules import api

api.require('ca-certificates')
api.require('libz')
Beispiel #8
0
from osv.modules import api

api.require('ruby')
default = api.run(cmdline="--cwd=/publify/ --env=GEM_HOME=/publify/vendor/bundle/ruby/2.1.0 /ruby.so ./bin/rails server -e production")
Beispiel #9
0
from osv.modules import api
api.require("lua")
default = api.run("/usr/lib/liblua.so /usr/lib/hello.lua")
Beispiel #10
0
from osv.modules import api

api.require('openssl')
Beispiel #11
0
from osv.modules import api

run = [ api.require('rogue').default ]
Beispiel #12
0
from osv.modules import api

api.require('golang')
default = api.run(cmdline="/go.so /hello.so")
Beispiel #13
0
from osv.modules import api

api.require("java-isolated")
Beispiel #14
0
        config = resolve.local_import(image_config_file)
        run_list = config.get("run", [])
    else:
        # If images/image_config doesn't exist, assume image_config is a
        # comma-separated list of module names, and build an image from those
        # modules (and their dependencies). The command line to run is to
        # run each of the module's "default" command line, in parallel.
        # You can choose a module's non-default command line, with a dot,
        # e.g.: mgmt.shell use's mgmt's "shell" command line.
        print "No such image configuration: " + args.image_config + ". Assuming list of modules."
        run_list = []
        for module in args.image_config.split(","):
            a = module.split(".", 1)
            name = a[0]
            variant = a[1] if (len(a) > 1) else "default"
            mod = api.require(name)
            if hasattr(mod, variant):
                run_list.append(getattr(mod, variant))
            elif variant != "default" and variant != "none":
                raise Exception("Attribute %s not set in module %s" % (variant, name))

    modules = resolve.get_required_modules()

    print "Modules:"
    if not modules:
        print "  None"
    for module in modules:
        print "  " + module.name

    make_modules(modules)
Beispiel #15
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/cloud-init'

usr_files = FileMap()
usr_files.add(os.path.join(_module, 'cloud-init.so')).to('/usr/mgmt/cloud-init.so')
usr_files.add(os.path.join(_module, 'cloud-init.yaml')).to('/usr/mgmt/cloud-init.yaml')
usr_files.add(os.path.join(_module, 'cmdline')).to('/init/00-cmdline')

api.require('httpserver')
api.require('libyaml')

#default = api.run('/usr/mgmt/cloud-init.so --skip-error --file /usr/mgmt/cloud-init.yaml')
default = ""
Beispiel #16
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/httpserver'

_exe = '/libhttpserver.so'

usr_files = FileMap()
usr_files.add(os.path.join(_module, 'libhttpserver.so')).to(_exe)
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')
usr_files.add(os.path.join(_module, 'swagger-ui', 'dist')).to('/usr/mgmt/swagger-ui/dist')
usr_files.add(os.path.join(_module, 'osv-gui/public')).to('/usr/mgmt/gui')

api.require('openssl')
api.require('libtools')
api.require('libyaml')

# only require next 3 modules if java (jre) is included in the list of modules
api.require_if_other_module_present('josvsym','java')
api.require_if_other_module_present('httpserver-jolokia-plugin','java')
api.require_if_other_module_present('httpserver-jvm-plugin','java')

# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
daemon = api.run_on_init(_exe + ' &!')

fg = api.run(_exe)

fg_ssl = api.run(_exe + ' --ssl')
Beispiel #17
0
provides = ['java']

from osv.modules.filemap import FileMap
from osv.modules import api

api.require('fonts')

usr_files = FileMap()

usr_files.add('${OSV_BASE}/apps/openjdk8/upstream/install/jvm/openjdk-1.8.0-internal').to('/usr/lib/jvm') \
    .include('lib/**') \
    .include('jre/**') \
    .exclude('jre/lib/security/cacerts') \
    .exclude('jre/lib/audio/**')
Beispiel #18
0
from osv.modules import api

#For a proper interactive python terminal
api.require('unknown-term')

#For sqlite3 and help()
api.require('sqlite')

default = api.run(cmdline="--env=TERM=unknown /python3")
Beispiel #19
0
from osv.modules import api
import subprocess

javac_with_version = subprocess.check_output(
    ['javac', '-version'], stderr=subprocess.STDOUT).decode('utf-8')

if javac_with_version.startswith('javac 1.8'):
    api.require('java-non-isolated')
    api.require('openjdk8-from-host')
else:
    api.require('openjdk9_1x-from-host')
Beispiel #20
0
from osv.modules import api

api.require('tests')
run = []
Beispiel #21
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/httpserver-html5-gui'

usr_files = FileMap()
usr_files.add(os.path.join(_module, 'swagger-ui',
                           'dist')).to('/usr/mgmt/swagger-ui/dist')
usr_files.add(os.path.join(_module, 'osv-gui/public')).to('/usr/mgmt/gui')
usr_files.add(os.path.join(_module,
                           'httpserver.conf')).to('/etc/httpserver.conf')

api.require('httpserver-api')

# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
_exe = '/libhttpserver-api.so --config-file=/etc/httpserver.conf'
daemon = api.run_on_init(_exe + ' &!')

fg = api.run(_exe)

fg_ssl = api.run(_exe + ' --ssl')
fg_cors = api.run(_exe + ' --access-allow=true')

default = daemon
Beispiel #22
0
#
# 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 import api

api.require('scala')

classpath = ['/usr/share/scala/lib/scala-library.jar', 'HelloWorld.jar']

default = api.run_java(classpath = classpath,
                       args = [
                           "HelloWorld",
                       ],
                   )
Beispiel #23
0
#
# 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']

api.require('fonts')
api.require('ca-certificates')
api.require('libz')
api.require('josvsym')
api.require('httpserver-jolokia-plugin')
api.require('httpserver-jvm-plugin')

usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/install').to('/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/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')
usr_files.link('/usr/lib/jvm/java/jre/lib/security/cacerts').to('/etc/pki/java/cacerts')
Beispiel #24
0
from osv.modules import api

api.require('libz')
Beispiel #25
0
from osv.modules import api

api.require('java-isolated')
api.require('openjdk7')
Beispiel #26
0
from osv.modules import api

api.require('java-tests')
Beispiel #27
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/cloud-init'

usr_files = FileMap()
usr_files.add(os.path.join(_module,
                           'cloud-init.yaml')).to('/usr/mgmt/cloud-init.yaml')
usr_files.add(os.path.join(_module, 'cmdline')).to('/init/00-cmdline')

api.require('httpserver')
api.require('libyaml')
api.require('libcdio')

#default = api.run('/usr/mgmt/cloud-init.so --skip-error --file /usr/mgmt/cloud-init.yaml')
default = ""
Beispiel #28
0
from osv.modules import api

api.require('java8')

_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)

Beispiel #29
0
        config = resolve.local_import(image_config_file)
        run_list = config.get('run', [])
    else:
        # If images/image_config doesn't exist, assume image_config is a
        # comma-separated list of module names, and build an image from those
        # modules (and their dependencies). The command line to run is to
        # run each of the module's "default" command line, in parallel.
        # You can choose a module's non-default command line, with a dot,
        # e.g.: mgmt.shell use's mgmt's "shell" command line.
        print "No such image configuration: " + args.image_config + ". Assuming list of modules."
        run_list = []
        for module in args.image_config.split(","):
            a = module.split(".", 1)
            name = a[0]
            variant = a[1] if (len(a) > 1) else "default"
            mod = api.require(name)
            if hasattr(mod, variant):
                run_list.append(getattr(mod, variant))
            elif variant != "default" and variant != "none":
                raise Exception("Attribute %s not set in module %s" %
                                (variant, name))

    modules = resolve.get_required_modules()

    print "Modules:"
    if not modules:
        print "  None"
    for module in modules:
        print "  " + module.name

    make_modules(modules)
Beispiel #30
0
from osv.modules import api

api.require('java-base')
provides = ['java-cmd']
Beispiel #31
0
Datei: module.py Projekt: 5kg/osv
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/cloud-init'

usr_files = FileMap()
usr_files.add(os.path.join('${OSV_BASE}', 'external/x64/misc.bin/usr/lib64/libyaml-cpp.so.0.5.1')).to('/usr/lib/libyaml-cpp.so.0.5')
usr_files.add(os.path.join(_module, 'cloud-init.so')).to('/usr/mgmt/cloud-init.so')
usr_files.add(os.path.join(_module, 'cloud-init.yaml')).to('/usr/mgmt/cloud-init.yaml')
usr_files.add(os.path.join(_module, 'cmdline')).to('/init/00-cmdline')

api.require('httpserver')

#default = api.run('/usr/mgmt/cloud-init.so --skip-error --file /usr/mgmt/cloud-init.yaml')
default = ""
Beispiel #32
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

_module = '${OSV_BASE}/modules/httpserver-api'

_exe = '/libhttpserver.so'

usr_files = FileMap()
usr_files.add(os.path.join(_module, 'libhttpserver-api.so')).to(_exe)
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')

api.require('openssl')
api.require('libtools')
api.require('libyaml')

# only require next 3 modules if java (jre) is included in the list of modules
api.require_if_other_module_present('josvsym','java')
api.require_if_other_module_present('httpserver-jolokia-plugin','java')
api.require_if_other_module_present('httpserver-jvm-plugin','java')

# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
daemon = api.run_on_init(_exe + ' &!')

fg = api.run(_exe)

fg_ssl = api.run(_exe + ' --ssl')

default = daemon
Beispiel #33
0
from osv.modules import api

api.require('ruby')
default = api.run(
    cmdline="--cwd=/sinatra/ --env=GEM_HOME=/sinatra/gems /ruby.so ./example.rb"
)
Beispiel #34
0
from osv.modules import api

api.require('open-mpi')
# default = api.run("/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_latency -h")
Beispiel #35
0
#
# 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

api.require('java-cmd')
provides = ['java']

usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/install').to(
    '/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/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')
Beispiel #36
0
from osv.modules import api

api.require("libz")

default = api.run("/ffmpeg.so -formats")
video_details = api.run(
    '/ffmpeg.so -i http://clips.vorwaerts-gmbh.de/VfE_html5.mp4')
video_subclip = api.run(
    '/ffmpeg.so -i http://clips.vorwaerts-gmbh.de/VfE_html5.mp4 -ss 00:00:10 -codec copy -t 10 output.mp4'
)
video_extract_png = api.run(
    '/ffmpeg.so -i http://clips.vorwaerts-gmbh.de/VfE_html5.mp4 -r 1 -f image2 image-%2d.png'
)
video_transcode = api.run(
    '/ffmpeg.so -i http://clips.vorwaerts-gmbh.de/VfE_html5.mp4 -c:v libx265 -crf 28 -an -f mpegts tcp://192.168.122.1:12345'
)
Beispiel #37
0
from osv.modules import api

api.require('node')

default = api.run(cmdline="--cwd=/sails/ /libnode.so ./example/app.js")
Beispiel #38
0
#
# 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']

api.require('fonts')
api.require('ca-certificates')
api.require('libz')
api.require('josvsym')
api.require('httpserver-jolokia-plugin')
api.require('httpserver-jvm-plugin')

usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/install').to(
    '/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/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')
Beispiel #39
0
from osv.modules.filemap import FileMap
from osv.modules import api
import os, os.path

usr_files = FileMap()

api.require('fonts')
api.require('ca-certificates')
api.require('libz')
api.require('josvsym')

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')
Beispiel #40
0
from osv.modules import api

api.require('httpserver-html5-gui')
api.require('httpserver-html5-cli')

_exe = '/libhttpserver-api.so --config-file=/etc/httpserver.conf'
daemon = api.run_on_init(_exe + ' &!')

fg = api.run(_exe)

fg_ssl = api.run(_exe + ' --ssl')
fg_cors = api.run(_exe + ' --access-allow=true')

default = daemon
Beispiel #41
0
from osv.modules import api
from osv.modules.filemap import FileMap

api.require('java')

_jar = '/tests/java/tests.jar'
_isolates_jar = '/tests/java/isolates.jar'

usr_files = FileMap()
usr_files.add('${OSV_BASE}/java/tests/target/runjava-tests.jar').to(_jar)
usr_files.add('${OSV_BASE}/java/tests-isolates/target/tests-isolates-jar-with-dependencies.jar').to(_isolates_jar)

usr_files.add('${OSV_BASE}/java/tests/target/classes/tests/ClassPutInRoot.class').to('/tests/ClassPutInRoot.class')

usr_files.add('${OSV_BASE}/java/tests-jre-extension/target/tests-jre-extension.jar') \
    .to('/usr/lib/jvm/java/jre/lib/ext/tests-jre-extension.jar')

default = api.run_java(classpath=[_jar, _isolates_jar],
    args=['-Disolates.jar=' + _isolates_jar, 'org.junit.runner.JUnitCore', 'io.osv.AllTests'])
Beispiel #42
0
from osv.modules import api

api.require('perl')

default = api.run(cmdline="/osv/bin/perl hello.pl")
Beispiel #43
0
from osv.modules import api
from osv.modules.filemap import FileMap

api.require('java')

_jar = '/tests/java/tests.jar'
_isolates_jar = '/tests/java/isolates.jar'

usr_files = FileMap()
usr_files.add('${OSV_BASE}/java/tests/target/runjava-tests.jar').to(_jar)
usr_files.add(
    '${OSV_BASE}/java/tests-isolates/target/tests-isolates-jar-with-dependencies.jar'
).to(_isolates_jar)

usr_files.add(
    '${OSV_BASE}/java/tests/target/classes/tests/ClassPutInRoot.class').to(
        '/tests/ClassPutInRoot.class')

usr_files.add('${OSV_BASE}/java/tests-jre-extension/target/tests-jre-extension.jar') \
    .to('/usr/lib/jvm/java/jre/lib/ext/tests-jre-extension.jar')

default = api.run_java(classpath=[_jar, _isolates_jar],
                       args=[
                           '-Disolates.jar=' + _isolates_jar,
                           'org.junit.runner.JUnitCore', 'io.osv.AllTests'
                       ])
Beispiel #44
0
from osv.modules import api

api.require('java8')

_catalina_base = "/usr/tomcat"
_catalina_home = _catalina_base
_catalina_tmpdir = "/tmp/catalina"

_classpath = [_catalina_home + "/bin/bootstrap.jar"]

_logging_config = [
    "-Djava.util.logging.config.file=%s/conf/logging.properties" %
    _catalina_base,
    "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
]
_classpath.append("%s/bin/tomcat-juli.jar" % _catalina_base)

default = api.run_java(classpath=_classpath,
                       args=_logging_config + [
                           "-Dcatalina.base=%s" % _catalina_base,
                           "-Dcatalina.home=%s" % _catalina_base,
                           "-Djava.io.tmpdir=%s" % _catalina_tmpdir,
                           "org.apache.catalina.startup.Bootstrap", "start"
                       ])
Beispiel #45
0
#
# 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

api.require('java-non-isolated')
provides = ['java', 'java8', 'java9', 'java10']

usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk10-java-base/install').to(
    '/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk10-java-base/install/usr/lib/jvm/java') \
    .to('/usr/lib/jvm/java') \
    .allow_symlink()
Beispiel #46
0
from osv.modules import api

api.require('libz')

default = api.run(
    '--env=HOSTNAME=localhost /elasticsearch/java/bin/java'
    '  -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly '
    '  -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true '
    '  -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true '
    '  -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp '
    '  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data '
    '  -Djava.locale.providers=COMPAT -Dio.netty.allocator.type=unpooled -XX:MaxDirectMemorySize=536870912 '
    '  -Des.path.home=/elasticsearch -Des.path.conf=/elasticsearch/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true '
    '  -cp /elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch !')
Beispiel #47
0
#
# Copyright (C) 2016 Waldemar Kozaczuk
#
# 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

api.require('java-non-isolated')
provides = ['java','java8']

usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact2/install').to('/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact2/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')
Beispiel #48
0
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api

provides = ['httpserver-api']

_module = '${OSV_BASE}/modules/httpserver-monitoring-api'

_exe = '/libhttpserver-api.so'

usr_files = FileMap()
usr_files.link(_exe).to('/usr/lib/libhttpserver-api.so')
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')

api.require('libtools')

# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
daemon = api.run_on_init(_exe + ' --access-allow=true &!')

fg = api.run(_exe + ' --access-allow=true')

default = daemon