Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

java_wrapper (15) Versions 1.0.0

Library cookbook that exposes the java_wrapper LWRP for Installing / Configuring java_wrapper on a server.

Policyfile
Berkshelf
Knife
cookbook 'java_wrapper', '~> 1.0.0', :supermarket
cookbook 'java_wrapper', '~> 1.0.0'
knife supermarket install java_wrapper
knife supermarket download java_wrapper
README
Dependencies
Changelog
Quality 17%

java_wrapper Cookbook

Status

Build Status

Overview

This cookbook provides java_wrapper, a resource that wrap a java application
to be easily managed using start up scripts. It uses http://wrapper.tanukisoftware.com/.

Requirements

This cookbook has only be tested on linux system. Tanuki java wrapper works on
Windows system, but considering this cookbook has never been tested on Windows,
it most likely not work.

Attribute Parameters

Customize the attributes to suit your need, the following attributes
have to be provided:

  • app_name: the name of the application, if not provided, it uses the name of the resource.
  • classpath: the classpath of the application
  • app_parameters: the array of String that will be passed to the application
  • java_parameters: The array of java parameters
  • log_file_name: the file name where the logs will be stored. Use something relevant to your app_name, to make it clear what log you're readind.
  • wrapper_working_dir: configuring the Working Directory.

This attributes can be used to further customize the application:
- app_long_name: the long name used for the daemon
- app_dir: the directory in which the application is deployed, it defaults to /opt/#{app_name}
- bin_dir: the bin directory for the wrapper, it defaults to #{app_dir}/bin
- lib_idr: the lib directory for the wrapper, it defaults to #{app_dir}/lib
- conf_dir: the conf directory for the wrapper, it defaults to #{app_dir}/conf
- daemonize: Spawns a fork of the Wrapper process as a detached non-session group leader. This means that the process will continue to run even after the console from which the Wrapper process was launched has been closed.
- exit_timeout: the timeout the wrapper allows to the app for termination, in seconds. (defaults to 15).
- library_path: an array of paths, where the wrapper will look for (Wrapper.DLL or libwrapper.so)
- logs_dir: the log directory for the wrapper, it defaults to /var/log/#{name}
- init_mem_MB: the mininum memory in MB for the JVM, defaults to 3
- max_mem_MB: the maximum memory in MB for the JVM, defaults to 64
- native_library_dest_dir: convenience parameter for copying the native library to this folder
- permissions_owner: the system user who will be the owner of directories and files.
- permissions_group: the system group to which the directories and files will belong.
- run_as_user: the user running the wrapper, defaults to root
- startup_timeout: the timeout the wrapper allows between the time that the Wrapper launches the JVM process and the time that the JVM side of the Wrapper responds that the application has started. Setting this property value to "0" (zero) means never time out. The value is in seconds. (defaults to 30).
- wrapper_version: the version of the java wrapper, defaults to 3.5.21
- wrapper_os: the os for the java wrapper, defaults to linux
- wrapper_cpu: the cpu for the java wrapper, defaults to x86
- wrapper_bit: the architecture for the java wrapper, defaults to 64
- wrapper_extension: the extension for the java wrapper, defaults to tar.gz
- wrapper_url: the url to download the wrapper, defaults to "http://wrapper.tanukisoftware.com/download/#{wrapper_version}/wrapper-#{wrapper_os}-#{wrapper_cpu}-#{wrapper_bit}-#{wrapper_version}.#{wrapper_extension}"

Usage

You will find usage in the test recipe at https://github.com/arussel/chef-java-wrapper/blob/master/test/fixtures/cookbooks/test_java_wrapper/recipes/default.rb

java_wrapper 'jetty' do
app_parameters ["org.mortbay.start.Main"]
classpath ["/usr/local/jetty/start.jar"]
java_parameters ["-Djetty.home=/usr/local/jetty"]
end

java_wrapper 'play' do
classpath ["#{helloworld_dir}/target/staged/*"]
app_parameters ["play.core.server.NettyServer", "#{helloworld_dir}"]
java_parameters ["-Dhttp.port=9001"]
end

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Alexandre Russel, Yorgos Saslis

Dependent cookbooks

ark >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

java-wrapper CHANGELOG

This file is used to list changes made in each version of the java-wrapper cookbook.

1.0.0

  • Build passes on Travis CI, using Test Kitchen with kitchen-ec2 driver for IT tests using serverspec.
  • fixed rubocop and foodcritic warnings

0.6.0

  • Made test kitchen pass again, on both ubuntu 12.04 and ubuntu 14.04
  • separated enable & start actions for resource
  • Fixed missing run_as_user attribute

0.5.0

  • @gsaslis - Added configurable exit.timeout and startup.timeout. Also added .use_system_time=false and .request_thread_dump_on_failed_jvm_exit=TRUE as hard-coded values for now.

0.4.0

  • @gsaslis - Added support for wrapper.daemonize and parameterizable console name

0.3.0

  • @gsaslis - Bugfix: remove hard-coded path of /etc/init.d as location of executable wrapper file
  • @gsaslis - Add new capability of being able to extract native library as well upon setting an extra option

0.2.0

  • @gsaslis - Separated Create & Enable Actions, so you can now create, without enabling the service.
  • @gsaslis - Added a customizable log file name
  • @gsaslis - The wrapper.conf file name will now match your app name, so you can have multiple instances of the java wrapper configs, even in the same directory.
  • @gsaslis - The wrapper_url ignored version, so I've made it parameterizable, meaning you can now choose what wrapper version to install.
  • @gsaslis - Added owner and group attributes for filesystem permissions to the files & dirs

0.0.1

  • arussel - Initial release of java-wrapper

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Collaborator Number Metric
            

1.0.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

1.0.0 failed this metric

FC085: Resource using new_resource.updated_by_last_action to converge resource: java_wrapper/providers/default.rb:27
FC085: Resource using new_resource.updated_by_last_action to converge resource: java_wrapper/providers/default.rb:33
FC085: Resource using new_resource.updated_by_last_action to converge resource: java_wrapper/providers/default.rb:39
FC085: Resource using new_resource.updated_by_last_action to converge resource: java_wrapper/providers/default.rb:45
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

1.0.0 passed this metric

Testing File Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number