dcos-3254 Implement package create
@@ -3,73 +3,82 @@ Install and manage DCOS packages
|
||||
Usage:
|
||||
dcos package --config-schema
|
||||
dcos package --info
|
||||
dcos package bundle [--output-directory=<output-directory>]
|
||||
<package-directory>
|
||||
dcos package describe [--app --cli --config]
|
||||
[--render]
|
||||
[--package-versions]
|
||||
[--options=<file>]
|
||||
[--package-version=<package_version>]
|
||||
<package_name>
|
||||
<package-name>
|
||||
dcos package install [--cli | [--app --app-id=<app_id>]]
|
||||
[--package-version=<package_version>]
|
||||
[--options=<file>] [--yes] <package_name>
|
||||
dcos package list [--json --endpoints --app-id=<app-id> <package_name>]
|
||||
[--options=<file>]
|
||||
[--yes]
|
||||
<package-name>
|
||||
dcos package list [--json --endpoints --app-id=<app-id> <package-name>]
|
||||
dcos package search [--json <query>]
|
||||
dcos package sources
|
||||
dcos package uninstall [--cli | [--app --app-id=<app-id> --all]]
|
||||
<package_name>
|
||||
<package-name>
|
||||
dcos package update [--validate]
|
||||
|
||||
Options:
|
||||
--all Apply the operation to all matching packages
|
||||
--all
|
||||
Apply the operation to all matching packages
|
||||
|
||||
--app Apply the operation only to the package's
|
||||
Marathon application
|
||||
--app
|
||||
Apply the operation only to the package's Marathon application
|
||||
|
||||
--app-id=<app-id> The application id
|
||||
--app-id=<app-id>
|
||||
The application id
|
||||
|
||||
--cli Apply the operation only to the package's CLI
|
||||
command
|
||||
--cli
|
||||
Apply the operation only to the package's CLI command
|
||||
|
||||
--config Print the package's config.json, which contains
|
||||
the configurable properties for marathon.json
|
||||
and command.json
|
||||
--config
|
||||
Print the package's config.json, which contains the configurable
|
||||
properties for marathon.json and command.json
|
||||
|
||||
-h, --help Show this screen
|
||||
-h, --help
|
||||
Show this screen
|
||||
|
||||
--info Show a short description of this subcommand
|
||||
--info
|
||||
Show a short description of this subcommand
|
||||
|
||||
--options=<file> Path to a JSON file containing package
|
||||
installation options
|
||||
--options=<file>
|
||||
Path to a JSON file containing package installation options
|
||||
|
||||
--package-version=<package_version> Package version to install
|
||||
--output-directory=<output-directory>
|
||||
Directory path where the DCOS package will be created. By default the
|
||||
package will be created in the current working directory
|
||||
|
||||
--package-versions Print all versions for this package
|
||||
--package-version=<package_version>
|
||||
Package version to install
|
||||
|
||||
--render Render the package's marathon.json or
|
||||
command.json template with the values from
|
||||
config.json and --options. If not provided,
|
||||
print the raw templates.
|
||||
--package-versions
|
||||
Print all versions for this package
|
||||
|
||||
--validate Validate package content when updating sources
|
||||
--render
|
||||
Render the package's marathon.json or command.json template with the
|
||||
values from config.json and --options. If not provided, print the raw
|
||||
templates.
|
||||
|
||||
--version Show version
|
||||
--validate
|
||||
Validate package content when updating sources
|
||||
|
||||
--yes Assume "yes" is the answer to all prompts and
|
||||
run non-interactively
|
||||
--version
|
||||
Show version
|
||||
|
||||
Configuration:
|
||||
[package]
|
||||
# Path to the local package cache.
|
||||
cache_dir = "/var/dcos/cache"
|
||||
--yes
|
||||
Assume "yes" is the answer to all prompts and run non-interactively
|
||||
|
||||
# List of package sources, in search order.
|
||||
#
|
||||
# Three protocols are supported:
|
||||
# - Local file
|
||||
# - HTTPS
|
||||
# - Git
|
||||
sources = [
|
||||
"file:///Users/me/test-registry",
|
||||
"https://my.org/registry",
|
||||
"git://github.com/mesosphere/universe.git"
|
||||
]
|
||||
Positional Arguments:
|
||||
<package-directory>
|
||||
Path to the directory containing the DCOS package
|
||||
|
||||
<package-name>
|
||||
Name of the DCOS package
|
||||
|
||||
<query>
|
||||
Pattern to use for searching for package
|
||||
|
||||
20
cli/dcoscli/data/universe-schema/command.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema#",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pip": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": "Embedded Requirements File",
|
||||
"description": "An array of strings representing of the requirements file to use for installing the subcommand for Pip. Each item is interpreted as a line in the requirements file."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["pip"]
|
||||
}
|
||||
]
|
||||
}
|
||||
150
cli/dcoscli/data/universe-schema/config.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"id": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "Core schema meta-schema",
|
||||
"definitions": {
|
||||
"schemaArray": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": { "$ref": "#" }
|
||||
},
|
||||
"positiveInteger": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"positiveIntegerDefault0": {
|
||||
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
|
||||
},
|
||||
"simpleTypes": {
|
||||
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
|
||||
},
|
||||
"stringArray": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": {},
|
||||
"multipleOf": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"exclusiveMinimum": true
|
||||
},
|
||||
"maximum": {
|
||||
"type": "number"
|
||||
},
|
||||
"exclusiveMaximum": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"minimum": {
|
||||
"type": "number"
|
||||
},
|
||||
"exclusiveMinimum": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"maxLength": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"format": "regex"
|
||||
},
|
||||
"additionalItems": {
|
||||
"anyOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "$ref": "#" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#" },
|
||||
{ "$ref": "#/definitions/schemaArray" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"maxItems": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"uniqueItems": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"required": { "$ref": "#/definitions/stringArray" },
|
||||
"additionalProperties": {
|
||||
"anyOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "$ref": "#" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"definitions": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"patternProperties": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#" },
|
||||
{ "$ref": "#/definitions/stringArray" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"enum": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/definitions/simpleTypes" },
|
||||
{
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/simpleTypes" },
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"allOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"not": { "$ref": "#" }
|
||||
},
|
||||
"dependencies": {
|
||||
"exclusiveMaximum": [ "maximum" ],
|
||||
"exclusiveMinimum": [ "minimum" ]
|
||||
},
|
||||
"default": {}
|
||||
}
|
||||
78
cli/dcoscli/data/universe-schema/package.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
},
|
||||
"scm": {
|
||||
"type": "string"
|
||||
},
|
||||
"maintainer": {
|
||||
"type": "string"
|
||||
},
|
||||
"website": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"framework": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "True if this package installs a new Mesos framework."
|
||||
},
|
||||
"preInstallNotes": {
|
||||
"type": "string",
|
||||
"description": "Pre installation notes that would be useful to the user of this package."
|
||||
},
|
||||
"postInstallNotes": {
|
||||
"type": "string",
|
||||
"description": "Post installation notes that would be useful to the user of this package."
|
||||
},
|
||||
"postUninstallNotes": {
|
||||
"type": "string",
|
||||
"description": "Post uninstallation notes that would be useful to the user of this package."
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^[^\\s]+$"
|
||||
}
|
||||
},
|
||||
"licenses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the license. For example one of [Apache License Version 2.0 | MIT License | BSD License | Proprietary]"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"pattern": "((?<=\\()[A-Za-z][A-Za-z0-9\\+\\.\\-]*:([A-Za-z0-9\\.\\-_~:/\\?#\\[\\]@!\\$&'\\(\\)\\*\\+,;=]|%[A-Fa-f0-9]{2})+(?=\\)))|([A-Za-z][A-Za-z0-9\\+\\.\\-]*:([A-Za-z0-9\\.\\-_~:/\\?#\\[\\]@!\\$&'\\(\\)\\*\\+,;=]|%[A-Fa-f0-9]{2})+)",
|
||||
"description": "The URL where the license can be accessed"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"version",
|
||||
"maintainer",
|
||||
"description",
|
||||
"tags"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
import dcoscli
|
||||
import docopt
|
||||
import pkg_resources
|
||||
from dcos import (cmds, emitting, http, marathon, options, package, subcommand,
|
||||
util)
|
||||
from dcos import (cmds, emitting, errors, http, marathon, options, package,
|
||||
subcommand, util)
|
||||
from dcos.errors import DCOSException
|
||||
from dcoscli import tables
|
||||
from dcoscli.main import decorate_docopt_usage
|
||||
@@ -60,20 +63,20 @@ def _cmds():
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package', 'describe'],
|
||||
arg_keys=['<package_name>', '--app', '--cli', '--options',
|
||||
arg_keys=['<package-name>', '--app', '--cli', '--options',
|
||||
'--render', '--package-versions', '--package-version',
|
||||
'--config'],
|
||||
function=_describe),
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package', 'install'],
|
||||
arg_keys=['<package_name>', '--package-version', '--options',
|
||||
arg_keys=['<package-name>', '--package-version', '--options',
|
||||
'--app-id', '--cli', '--app', '--yes'],
|
||||
function=_install),
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package', 'list'],
|
||||
arg_keys=['--json', '--endpoints', '--app-id', '<package_name>'],
|
||||
arg_keys=['--json', '--endpoints', '--app-id', '<package-name>'],
|
||||
function=_list),
|
||||
|
||||
cmds.Command(
|
||||
@@ -83,9 +86,14 @@ def _cmds():
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package', 'uninstall'],
|
||||
arg_keys=['<package_name>', '--all', '--app-id', '--cli', '--app'],
|
||||
arg_keys=['<package-name>', '--all', '--app-id', '--cli', '--app'],
|
||||
function=_uninstall),
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package', 'bundle'],
|
||||
arg_keys=['<package-directory>', '--output-directory'],
|
||||
function=_bundle),
|
||||
|
||||
cmds.Command(
|
||||
hierarchy=['package'],
|
||||
arg_keys=['--config-schema', '--info'],
|
||||
@@ -517,3 +525,211 @@ def _uninstall(package_name, remove_all, app_id, cli, app):
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def _bundle(package_directory, output_directory):
|
||||
"""
|
||||
:param package_directory: directory containing the package
|
||||
:type package_directory: str
|
||||
:param output_directory: directory where to save the package zip file
|
||||
:type output_directory: str
|
||||
:returns: process status
|
||||
:rtype: int
|
||||
"""
|
||||
|
||||
if output_directory is None:
|
||||
output_directory = os.getcwd()
|
||||
logger.debug('Using [%s] as the ouput directory', output_directory)
|
||||
|
||||
# Find package.json file and parse it
|
||||
if not os.path.exists(os.path.join(package_directory, 'package.json')):
|
||||
raise DCOSException(
|
||||
('The file package.json is required in the package directory '
|
||||
'[{}]').format(package_directory))
|
||||
|
||||
package_json = _validate_json_file(
|
||||
os.path.join(package_directory, 'package.json'))
|
||||
|
||||
with tempfile.NamedTemporaryFile() as temp_file:
|
||||
with zipfile.ZipFile(
|
||||
temp_file.name,
|
||||
mode='w',
|
||||
compression=zipfile.ZIP_DEFLATED,
|
||||
allowZip64=True) as zip_file:
|
||||
# list through package directory and add files zip archive
|
||||
for filename in sorted(os.listdir(package_directory)):
|
||||
fullpath = os.path.join(package_directory, filename)
|
||||
if filename == 'marathon.json.mustache':
|
||||
zip_file.write(fullpath, arcname=filename)
|
||||
elif filename in ['config.json', 'command.json',
|
||||
'package.json']:
|
||||
# schema check the config and command json file
|
||||
_validate_json_file(fullpath)
|
||||
zip_file.write(fullpath, arcname=filename)
|
||||
elif filename == 'assets' and os.path.isdir(fullpath):
|
||||
_bundle_assets(fullpath, zip_file)
|
||||
elif filename == 'images' and os.path.isdir(fullpath):
|
||||
_bundle_images(fullpath, zip_file)
|
||||
else:
|
||||
# anything else is an error
|
||||
raise DCOSException(
|
||||
('Error bundling package. Extra file in package '
|
||||
'directory [{}]').format(fullpath))
|
||||
|
||||
# Compute the name of the package file
|
||||
zip_file_name = os.path.join(
|
||||
output_directory,
|
||||
'{}-{}-{}.zip'.format(
|
||||
package_json['name'],
|
||||
package_json['version'],
|
||||
_hashfile(temp_file.name)))
|
||||
|
||||
if os.path.exists(zip_file_name):
|
||||
raise DCOSException(
|
||||
'Output file [{}] already exists'.format(
|
||||
zip_file_name))
|
||||
|
||||
# rename with digest
|
||||
util.sh_copy(temp_file.name, zip_file_name)
|
||||
|
||||
# Print the full path to the file
|
||||
emitter.publish(
|
||||
errors.DefaultError(
|
||||
'Created DCOS Universe package [{}].'.format(zip_file_name)))
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def _validate_json_file(fullpath):
|
||||
"""Validates the content of the file against its schema. Throws an
|
||||
exception if the file is not valid.
|
||||
|
||||
:param fullpath: full path to the file.
|
||||
:type fullpath: str
|
||||
:return: json object if it is a special file
|
||||
:rtype: dict
|
||||
"""
|
||||
|
||||
filename = os.path.basename(fullpath)
|
||||
if filename in ['command.json', 'config.json', 'package.json']:
|
||||
schema_path = 'data/universe-schema/{}'.format(filename)
|
||||
else:
|
||||
raise DCOSException(
|
||||
('Error bundling package. Unknown file in package '
|
||||
'directory [{}]').format(fullpath))
|
||||
|
||||
special_schema = util.load_jsons(
|
||||
pkg_resources.resource_string('dcoscli', schema_path).decode('utf-8'))
|
||||
|
||||
with util.open_file(fullpath) as special_file:
|
||||
special_json = util.load_json(special_file)
|
||||
|
||||
errs = util.validate_json(special_json, special_schema)
|
||||
if errs:
|
||||
emitter.publish(
|
||||
errors.DefaultError(
|
||||
'Error validating JSON file [{}]'.format(fullpath)))
|
||||
raise DCOSException(util.list_to_err(errs))
|
||||
|
||||
return special_json
|
||||
|
||||
|
||||
def _hashfile(filename):
|
||||
"""Calculates the sha256 of a file
|
||||
|
||||
:param filename: path to the file to sum
|
||||
:type filename: str
|
||||
:returns: digest in hexadecimal
|
||||
:rtype: str
|
||||
"""
|
||||
|
||||
hasher = hashlib.sha256()
|
||||
with open(filename, 'rb') as f:
|
||||
for chunk in iter(lambda: f.read(4096), b''):
|
||||
hasher.update(chunk)
|
||||
return hasher.hexdigest()
|
||||
|
||||
|
||||
def _bundle_assets(assets_directory, zip_file):
|
||||
"""Bundle the assets directory
|
||||
|
||||
:param assets_directory: path to the assets directory
|
||||
:type assets_directory: str
|
||||
:param zip_file: zip file object
|
||||
:type zip_file: zipfile.ZipFile
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
for filename in sorted(os.listdir(assets_directory)):
|
||||
fullpath = os.path.join(assets_directory, filename)
|
||||
if filename == 'uris' and os.path.isdir(fullpath):
|
||||
_bundle_uris(fullpath, zip_file)
|
||||
else:
|
||||
# anything else is an error
|
||||
raise DCOSException(
|
||||
('Error bundling package. Extra file in package '
|
||||
'directory [{}]').format(fullpath))
|
||||
|
||||
|
||||
def _bundle_uris(uris_directory, zip_file):
|
||||
"""Bundle the uris directory
|
||||
|
||||
:param uris_directory: path to the uris directory
|
||||
:type uris_directory: str
|
||||
:param zip_file: zip file object
|
||||
:type zip_file: zipfile.ZipFile
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
for filename in sorted(os.listdir(uris_directory)):
|
||||
fullpath = os.path.join(uris_directory, filename)
|
||||
|
||||
zip_file.write(fullpath, arcname='assets/uris/{}'.format(filename))
|
||||
|
||||
|
||||
def _bundle_images(images_directory, zip_file):
|
||||
"""Bundle the images directory
|
||||
|
||||
:param images_directory: path to the images directory
|
||||
:type images_directory: str
|
||||
:param zip_file: zip file object
|
||||
:type zip_file: zipfile.ZipFile
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
for filename in sorted(os.listdir(images_directory)):
|
||||
fullpath = os.path.join(images_directory, filename)
|
||||
if (filename == 'icon-small.png' or
|
||||
filename == 'icon-medium.png' or
|
||||
filename == 'icon-large.png'):
|
||||
|
||||
util.validate_png(fullpath)
|
||||
|
||||
zip_file.write(fullpath, arcname='images/{}'.format(filename))
|
||||
elif filename == 'screenshots' and os.path.isdir(fullpath):
|
||||
_bundle_screenshots(fullpath, zip_file)
|
||||
else:
|
||||
# anything else is an error
|
||||
raise DCOSException(
|
||||
('Error bundling package. Extra file in package '
|
||||
'directory [{}]').format(fullpath))
|
||||
|
||||
|
||||
def _bundle_screenshots(screenshot_directory, zip_file):
|
||||
"""Bundle the screenshots directory
|
||||
|
||||
:param screenshot_directory: path to the screenshots directory
|
||||
:type screenshot_directory: str
|
||||
:param zip_file: zip file object
|
||||
:type zip_file: zipfile.ZipFile
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
for filename in sorted(os.listdir(screenshot_directory)):
|
||||
fullpath = os.path.join(screenshot_directory, filename)
|
||||
|
||||
util.validate_png(fullpath)
|
||||
|
||||
zip_file.write(
|
||||
fullpath,
|
||||
arcname='images/screenshots/{}'.format(filename))
|
||||
|
||||
@@ -83,6 +83,7 @@ setup(
|
||||
'data/*.json',
|
||||
'data/help/*.txt',
|
||||
'data/config-schema/*.json',
|
||||
'data/universe-schema/*.json',
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -3,73 +3,82 @@ Install and manage DCOS packages
|
||||
Usage:
|
||||
dcos package --config-schema
|
||||
dcos package --info
|
||||
dcos package bundle [--output-directory=<output-directory>]
|
||||
<package-directory>
|
||||
dcos package describe [--app --cli --config]
|
||||
[--render]
|
||||
[--package-versions]
|
||||
[--options=<file>]
|
||||
[--package-version=<package_version>]
|
||||
<package_name>
|
||||
<package-name>
|
||||
dcos package install [--cli | [--app --app-id=<app_id>]]
|
||||
[--package-version=<package_version>]
|
||||
[--options=<file>] [--yes] <package_name>
|
||||
dcos package list [--json --endpoints --app-id=<app-id> <package_name>]
|
||||
[--options=<file>]
|
||||
[--yes]
|
||||
<package-name>
|
||||
dcos package list [--json --endpoints --app-id=<app-id> <package-name>]
|
||||
dcos package search [--json <query>]
|
||||
dcos package sources
|
||||
dcos package uninstall [--cli | [--app --app-id=<app-id> --all]]
|
||||
<package_name>
|
||||
<package-name>
|
||||
dcos package update [--validate]
|
||||
|
||||
Options:
|
||||
--all Apply the operation to all matching packages
|
||||
--all
|
||||
Apply the operation to all matching packages
|
||||
|
||||
--app Apply the operation only to the package's
|
||||
Marathon application
|
||||
--app
|
||||
Apply the operation only to the package's Marathon application
|
||||
|
||||
--app-id=<app-id> The application id
|
||||
--app-id=<app-id>
|
||||
The application id
|
||||
|
||||
--cli Apply the operation only to the package's CLI
|
||||
command
|
||||
--cli
|
||||
Apply the operation only to the package's CLI command
|
||||
|
||||
--config Print the package's config.json, which contains
|
||||
the configurable properties for marathon.json
|
||||
and command.json
|
||||
--config
|
||||
Print the package's config.json, which contains the configurable
|
||||
properties for marathon.json and command.json
|
||||
|
||||
-h, --help Show this screen
|
||||
-h, --help
|
||||
Show this screen
|
||||
|
||||
--info Show a short description of this subcommand
|
||||
--info
|
||||
Show a short description of this subcommand
|
||||
|
||||
--options=<file> Path to a JSON file containing package
|
||||
installation options
|
||||
--options=<file>
|
||||
Path to a JSON file containing package installation options
|
||||
|
||||
--package-version=<package_version> Package version to install
|
||||
--output-directory=<output-directory>
|
||||
Directory path where the DCOS package will be created. By default the
|
||||
package will be created in the current working directory
|
||||
|
||||
--package-versions Print all versions for this package
|
||||
--package-version=<package_version>
|
||||
Package version to install
|
||||
|
||||
--render Render the package's marathon.json or
|
||||
command.json template with the values from
|
||||
config.json and --options. If not provided,
|
||||
print the raw templates.
|
||||
--package-versions
|
||||
Print all versions for this package
|
||||
|
||||
--validate Validate package content when updating sources
|
||||
--render
|
||||
Render the package's marathon.json or command.json template with the
|
||||
values from config.json and --options. If not provided, print the raw
|
||||
templates.
|
||||
|
||||
--version Show version
|
||||
--validate
|
||||
Validate package content when updating sources
|
||||
|
||||
--yes Assume "yes" is the answer to all prompts and
|
||||
run non-interactively
|
||||
--version
|
||||
Show version
|
||||
|
||||
Configuration:
|
||||
[package]
|
||||
# Path to the local package cache.
|
||||
cache_dir = "/var/dcos/cache"
|
||||
--yes
|
||||
Assume "yes" is the answer to all prompts and run non-interactively
|
||||
|
||||
# List of package sources, in search order.
|
||||
#
|
||||
# Three protocols are supported:
|
||||
# - Local file
|
||||
# - HTTPS
|
||||
# - Git
|
||||
sources = [
|
||||
"file:///Users/me/test-registry",
|
||||
"https://my.org/registry",
|
||||
"git://github.com/mesosphere/universe.git"
|
||||
]
|
||||
Positional Arguments:
|
||||
<package-directory>
|
||||
Path to the directory containing the DCOS package
|
||||
|
||||
<package-name>
|
||||
Name of the DCOS package
|
||||
|
||||
<query>
|
||||
Pattern to use for searching for package
|
||||
|
||||
BIN
cli/tests/data/package/cassandra.zip
Normal file
229
cli/tests/data/package/create-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
BIN
cli/tests/data/package/create-directory/images/icon-large.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
cli/tests/data/package/create-directory/images/icon-medium.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
cli/tests/data/package/create-directory/images/icon-small.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
18
cli/tests/data/package/create-directory/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
229
cli/tests/data/package/extra-assets-files-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
229
cli/tests/data/package/extra-files-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
18
cli/tests/data/package/extra-files-directory/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
229
cli/tests/data/package/extra-icons-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
18
cli/tests/data/package/extra-icons-directory/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
Install and manage DCOS packages
|
||||
|
||||
Usage:
|
||||
dcos package --config-schema
|
||||
dcos package --info
|
||||
dcos package describe [--app --cli --config]
|
||||
[--render]
|
||||
[--package-versions]
|
||||
[--options=<file>]
|
||||
[--package-version=<package_version>]
|
||||
<package_name>
|
||||
dcos package install [--cli | [--app --app-id=<app_id>]]
|
||||
[--package-version=<package_version>]
|
||||
[--options=<file>] [--yes] <package_name>
|
||||
dcos package list [--json --endpoints --app-id=<app-id> <package_name>]
|
||||
dcos package search [--json <query>]
|
||||
dcos package sources
|
||||
dcos package uninstall [--cli | [--app --app-id=<app-id> --all]]
|
||||
<package_name>
|
||||
dcos package update [--validate]
|
||||
|
||||
Options:
|
||||
--all Apply the operation to all matching packages
|
||||
|
||||
--app Apply the operation only to the package's
|
||||
Marathon application
|
||||
|
||||
--app-id=<app-id> The application id
|
||||
|
||||
--cli Apply the operation only to the package's CLI
|
||||
command
|
||||
|
||||
--config Print the package's config.json, which contains
|
||||
the configurable properties for marathon.json
|
||||
and command.json
|
||||
|
||||
-h, --help Show this screen
|
||||
|
||||
--info Show a short description of this subcommand
|
||||
|
||||
--options=<file> Path to a JSON file containing package
|
||||
installation options
|
||||
|
||||
--package-version=<package_version> Package version to install
|
||||
|
||||
--package-versions Print all versions for this package
|
||||
|
||||
--render Render the package's marathon.json or
|
||||
command.json template with the values from
|
||||
config.json and --options. If not provided,
|
||||
print the raw templates.
|
||||
|
||||
--validate Validate package content when updating sources
|
||||
|
||||
--version Show version
|
||||
|
||||
--yes Assume "yes" is the answer to all prompts and
|
||||
run non-interactively
|
||||
|
||||
Configuration:
|
||||
[package]
|
||||
# Path to the local package cache.
|
||||
cache_dir = "/var/dcos/cache"
|
||||
|
||||
# List of package sources, in search order.
|
||||
#
|
||||
# Three protocols are supported:
|
||||
# - Local file
|
||||
# - HTTPS
|
||||
# - Git
|
||||
sources = [
|
||||
"file:///Users/me/test-registry",
|
||||
"https://my.org/registry",
|
||||
"git://github.com/mesosphere/universe.git"
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"apt-get": "invalid command"
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
229
cli/tests/data/package/invalid-config-json-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": 42,
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"]
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
229
cli/tests/data/package/non-png-icons-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
18
cli/tests/data/package/non-png-icons-directory/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
229
cli/tests/data/package/non-png-screenshots-directory/config.json
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mesos": {
|
||||
"description": "Mesos specific configuration properties",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"master": {
|
||||
"default": "zk://master.mesos:2181/mesos",
|
||||
"description": "The URL of the Mesos master. The format is a comma-delimited list of hosts like zk://host1:port,host2:port/mesos. If using ZooKeeper, pay particular attention to the leading zk:// and trailing /mesos! If not using ZooKeeper, standard host:port patterns, like localhost:5050 or 10.0.0.5:5050,10.0.0.6:5050, are also acceptable.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"master"
|
||||
]
|
||||
},
|
||||
"cassandra": {
|
||||
"description": "Cassandra Framework Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"framework": {
|
||||
"description": "Framework Scheduler specific Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"failover-timeout-seconds": {
|
||||
"description": "The failover_timeout for Mesos in seconds. If the framework instance has not re-registered with Mesos this long after a failover, Mesos will shut down all running tasks started by the framework.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 604800
|
||||
},
|
||||
"cpus": {
|
||||
"default": 0.5,
|
||||
"description": "CPU shares to allocate to each Cassandra framework instance.",
|
||||
"type": "number"
|
||||
},
|
||||
"mem": {
|
||||
"default": 512.0,
|
||||
"description": "Memory (MB) to allocate to each Cassandra framework instance.",
|
||||
"minimum": 512.0,
|
||||
"type": "number"
|
||||
},
|
||||
"instances": {
|
||||
"default": 1,
|
||||
"description": "Number of Cassandra framework instances to run.",
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"role": {
|
||||
"description": "Mesos role for this framework.",
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
},
|
||||
"authentication": {
|
||||
"description": "Framework Scheduler Authentication Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether framework authentication should be used",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"principal": {
|
||||
"description": "The Mesos principal used for authentication.",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The path to the Mesos secret file containing the authentication secret.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instances",
|
||||
"cpus",
|
||||
"mem",
|
||||
"failover-timeout-seconds",
|
||||
"role",
|
||||
"authentication"
|
||||
]
|
||||
},
|
||||
"cluster-name": {
|
||||
"description": "The name of the framework to register with mesos. Will also be used as the cluster name in Cassandra",
|
||||
"type": "string",
|
||||
"default": "dcos"
|
||||
},
|
||||
"zk": {
|
||||
"description": "ZooKeeper URL for storing state. Format: zk://host1:port1,host2:port2,.../path (can have nested directories)",
|
||||
"type": "string"
|
||||
},
|
||||
"zk-timeout-ms": {
|
||||
"description": "Timeout for ZooKeeper in milliseconds.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 10000
|
||||
},
|
||||
"node-count": {
|
||||
"description": "The number of nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 3
|
||||
},
|
||||
"seed-count": {
|
||||
"description": "The number of seed nodes in the ring for the framework to run.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 2
|
||||
},
|
||||
"health-check-interval-seconds": {
|
||||
"description": "The interval in seconds that the framework should check the health of each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 60
|
||||
},
|
||||
"bootstrap-grace-time-seconds": {
|
||||
"description": "The minimum number of seconds to wait between starting each node. Setting this too low could result in the ring not bootstrapping correctly.",
|
||||
"type": "integer",
|
||||
"minimum": 15,
|
||||
"default": 120
|
||||
},
|
||||
"data-directory": {
|
||||
"description": "The location on disk where Cassandra will be configured to write it's data.",
|
||||
"type": "string",
|
||||
"default": "."
|
||||
},
|
||||
"resources": {
|
||||
"description": "Cassandra Server Resources Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpus": {
|
||||
"description": "CPU shares to allocate to each Cassandra Server Instance.",
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"default": 0.1
|
||||
},
|
||||
"mem": {
|
||||
"description": "Memory (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 768
|
||||
},
|
||||
"disk": {
|
||||
"description": "Disk (MB) to allocate to each Cassandra Server instance.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 16
|
||||
},
|
||||
"heap-mb": {
|
||||
"description": "The amount of memory in MB that are allocated to each Cassandra Server Instance. This value should be smaller than 'cassandra.resources.mem'. The remaining difference will be used for memory mapped files and other off-heap memory requirements.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpus",
|
||||
"mem",
|
||||
"disk"
|
||||
]
|
||||
},
|
||||
"dc": {
|
||||
"description": "Cassandra multi Datacenter Configuration Properties",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default-dc": {
|
||||
"description": "Default value to be set for dc name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "DC1"
|
||||
},
|
||||
"default-rack": {
|
||||
"description": "Default value to be set for rack name in the GossipingPropertyFileSnitch",
|
||||
"type": "string",
|
||||
"default": "RAC1"
|
||||
},
|
||||
"external-dcs": {
|
||||
"description": "Name and URL for another instance of Cassandra DCOS Service",
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default-dc",
|
||||
"default-rack"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"framework",
|
||||
"cluster-name",
|
||||
"zk-timeout-ms",
|
||||
"node-count",
|
||||
"seed-count",
|
||||
"health-check-interval-seconds",
|
||||
"bootstrap-grace-time-seconds",
|
||||
"data-directory",
|
||||
"resources"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mesos",
|
||||
"cassandra"
|
||||
]
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"id": "/cassandra/{{cassandra.cluster-name}}",
|
||||
"cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
|
||||
"instances": {{cassandra.framework.instances}},
|
||||
"cpus": {{cassandra.framework.cpus}},
|
||||
"mem": {{cassandra.framework.mem}},
|
||||
"uris": [
|
||||
"{{package.assets.uris.cassandra-mesos.tar.gz}}",
|
||||
"{{package.assets.uris.jre-linux.tar.gz}}"
|
||||
],
|
||||
"ports": [
|
||||
0
|
||||
],
|
||||
"healthChecks": [
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 15,
|
||||
"maxConsecutiveFailures": 0,
|
||||
"path": "/health/cluster",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
},
|
||||
{
|
||||
"gracePeriodSeconds": 120,
|
||||
"intervalSeconds": 30,
|
||||
"maxConsecutiveFailures": 3,
|
||||
"path": "/health/process",
|
||||
"portIndex": 0,
|
||||
"protocol": "HTTP",
|
||||
"timeoutSeconds": 5
|
||||
}
|
||||
],
|
||||
"labels": {
|
||||
"DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
|
||||
},
|
||||
"env": {
|
||||
"MESOS_ZK": "{{mesos.master}}"
|
||||
,"JAVA_OPTS": "-Xms256m -Xmx256m"
|
||||
,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
|
||||
,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
|
||||
,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
|
||||
,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
|
||||
,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
|
||||
,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
|
||||
,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
|
||||
,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
|
||||
,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
|
||||
,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
|
||||
,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
|
||||
,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
|
||||
,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
|
||||
,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
|
||||
,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
|
||||
{{#cassandra.dc.external-dcs}}
|
||||
,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
|
||||
{{/cassandra.dc.external-dcs}}
|
||||
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
|
||||
,"CASSANDRA_ZK": "{{cassandra.zk}}"
|
||||
{{/cassandra.zk}}
|
||||
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
|
||||
,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
|
||||
{{/cassandra.zk}}
|
||||
{{#cassandra.resource.heap-mb}}
|
||||
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
|
||||
{{/cassandra.resource.heap-mb}}
|
||||
{{#cassandra.framework.authentication.principal}}
|
||||
,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
|
||||
{{/cassandra.framework.authentication.principal}}
|
||||
{{#cassandra.framework.authentication.secret}}
|
||||
,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
|
||||
{{/cassandra.framework.authentication.secret}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Apache Cassandra running on Apache Mesos",
|
||||
"framework": true,
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Apache License Version 2.0",
|
||||
"url": "https://github.com/mesosphere/cassandra-mesos/blob/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"maintainer": "support@mesosphere.io",
|
||||
"name": "cassandra",
|
||||
"postInstallNotes": "Thank you for installing the Apache Cassandra DCOS Service.\n\n\tDocumentation: http://mesosphere.github.io/cassandra-mesos/\n\tIssues: https://github.com/mesosphere/cassandra-mesos/issues",
|
||||
"postUninstallNotes": "The Apache Cassandra DCOS Service has been uninstalled and will no longer run.\nPlease follow the instructions at http://docs.mesosphere.com/services/cassandra/#uninstall to clean up any persisted state",
|
||||
"preInstallNotes":"The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.\nThe default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.",
|
||||
"scm": "https://github.com/mesosphere/cassandra-mesos.git",
|
||||
"tags": ["mesosphere", "framework", "data", "database"],
|
||||
"version": "0.2.0-1"
|
||||
}
|
||||
@@ -81,7 +81,7 @@ cli-test-2.zip",
|
||||
def test_package():
|
||||
stdout = pkg_resources.resource_string(
|
||||
'tests',
|
||||
'data/package/help.txt')
|
||||
'data/help/package.txt')
|
||||
assert_command(['dcos', 'package', '--help'],
|
||||
stdout=stdout)
|
||||
|
||||
|
||||
206
cli/tests/integrations/test_package_bundle.py
Normal file
@@ -0,0 +1,206 @@
|
||||
import contextlib
|
||||
import glob
|
||||
import os
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
from tests.integrations import common
|
||||
|
||||
_PACKAGE_NAME_GLOB = '/tmp/cassandra-0.2.0-1-*'
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _clean_package_file(pattern):
|
||||
for name in glob.glob(pattern):
|
||||
os.remove(name)
|
||||
|
||||
yield
|
||||
|
||||
for name in glob.glob(pattern):
|
||||
os.remove(name)
|
||||
|
||||
|
||||
def test_bundle_good_package():
|
||||
with _clean_package_file(_PACKAGE_NAME_GLOB):
|
||||
returncode, stdout, stderr = common.exec_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/create-directory'])
|
||||
|
||||
assert returncode == 0
|
||||
assert stdout == b''
|
||||
assert stderr.decode('utf-8').startswith(
|
||||
'Created DCOS Universe package ')
|
||||
|
||||
with zipfile.ZipFile(
|
||||
'tests/data/package/cassandra.zip',
|
||||
'r') as expected:
|
||||
with zipfile.ZipFile(
|
||||
glob.glob(_PACKAGE_NAME_GLOB)[0],
|
||||
'r') as actual:
|
||||
|
||||
for expected_file, actual_file in zip(
|
||||
sorted(
|
||||
expected.infolist(),
|
||||
key=lambda x: x.filename),
|
||||
sorted(
|
||||
actual.infolist(),
|
||||
key=lambda x: x.filename)):
|
||||
assert expected_file.filename == actual_file.filename
|
||||
assert expected_file.file_size == actual_file.file_size
|
||||
|
||||
|
||||
def test_bundle_fail_missing_package_json():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/missing-package-json-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'The file package.json is required in the package directory '
|
||||
b'[tests/data/package/missing-package-json-directory]\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_invalid_package_json():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/invalid-package-json-directory'],
|
||||
returncode=1,
|
||||
stderr=(b"Error validating JSON file [tests/data/package/"
|
||||
b"invalid-package-json-directory/package.json]\n"
|
||||
b"Error: missing required property 'version'.\n"))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_invalid_config_json():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/invalid-config-json-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Error validating JSON file [tests/data/package/'
|
||||
b'invalid-config-json-directory/config.json]\n'
|
||||
b'Error: 42 is not valid under any of the given schemas\n'
|
||||
b'Path: type\n'
|
||||
b'Value: 42\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_invalid_command_json():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/invalid-command-json-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Error validating JSON file [tests/data/package/'
|
||||
b'invalid-command-json-directory/command.json]\n'
|
||||
b'Error: {\'apt-get\': \'invalid command\'} is not valid '
|
||||
b'under any of the given schemas\n'
|
||||
b'Value: {"apt-get": "invalid command"}\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_overwrite_existing_file():
|
||||
with _clean_package_file(_PACKAGE_NAME_GLOB):
|
||||
returncode, stdout, stderr = common.exec_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/create-directory'])
|
||||
|
||||
assert returncode == 0
|
||||
assert stdout == b''
|
||||
assert stderr.decode('utf-8').startswith(
|
||||
'Created DCOS Universe package ')
|
||||
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/create-directory'],
|
||||
returncode=1,
|
||||
stderr='Output file [{}] already exists\n'.format(
|
||||
glob.glob(_PACKAGE_NAME_GLOB)[0]).encode('utf-8'))
|
||||
|
||||
|
||||
def test_bundle_fail_extra_files():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/extra-files-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Error bundling package. Extra file in package directory '
|
||||
b'[tests/data/package/extra-files-directory/extra-file]\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_extra_files_in_assets():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/extra-assets-files-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Error bundling package. Extra file in package directory '
|
||||
b'[tests/data/package/extra-assets-files-directory/assets/'
|
||||
b'extra-file]\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_non_png_icons():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/non-png-icons-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Unable to validate [tests/data/package/'
|
||||
b'non-png-icons-directory/images/icon-large.png] as a PNG '
|
||||
b'file\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_extra_icons():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/extra-icons-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Error bundling package. Extra file in package directory '
|
||||
b'[tests/data/package/extra-icons-directory/images/non-png]\n')
|
||||
)
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_non_png_screenshots():
|
||||
common.assert_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/tmp',
|
||||
'tests/data/package/non-png-screenshots-directory'],
|
||||
returncode=1,
|
||||
stderr=(b'Unable to validate [tests/data/package/'
|
||||
b'non-png-screenshots-directory/images/screenshots/'
|
||||
b'non-png.png] as a PNG file\n'))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_missing_output_directory():
|
||||
returncode, stdout, stderr = common.exec_command(
|
||||
['dcos', 'package', 'bundle', '--output-directory=/temp',
|
||||
'tests/data/package/create-directory'])
|
||||
|
||||
assert returncode == 1
|
||||
assert stdout == b''
|
||||
assert stderr.decode('utf-8').startswith(
|
||||
'No such file or directory: /temp/cassandra-0.2.0-1-')
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
|
||||
|
||||
def test_bundle_fail_output_not_directory():
|
||||
with tempfile.NamedTemporaryFile() as temp_file:
|
||||
returncode, stdout, stderr = common.exec_command(
|
||||
['dcos', 'package', 'bundle',
|
||||
'--output-directory={}'.format(temp_file.name),
|
||||
'tests/data/package/create-directory'])
|
||||
|
||||
assert returncode == 1
|
||||
assert stdout == b''
|
||||
assert stderr.decode('utf-8').startswith(
|
||||
'Not a directory: {}/cassandra-0.2.0-1-'.format(temp_file.name))
|
||||
|
||||
assert not glob.glob(_PACKAGE_NAME_GLOB)
|
||||
@@ -4,6 +4,7 @@ import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from dcos import constants, util
|
||||
from dcos.errors import DCOSException
|
||||
@@ -365,19 +366,18 @@ def _install_with_pip(
|
||||
if _execute_install(cmd) != 0:
|
||||
raise _generic_error(package_name)
|
||||
|
||||
with util.temptext() as text_file:
|
||||
fd, requirement_path = text_file
|
||||
|
||||
with tempfile.NamedTemporaryFile() as temp_file:
|
||||
# Write the requirements to the file
|
||||
with os.fdopen(fd, 'w') as requirements_file:
|
||||
for line in requirements:
|
||||
print(line, file=requirements_file)
|
||||
for line in requirements:
|
||||
temp_file.write((line + os.linesep).encode('utf-8'))
|
||||
# Make sure that we flush the file before passing it to pip
|
||||
temp_file.flush()
|
||||
|
||||
cmd = [
|
||||
os.path.join(env_directory, BIN_DIRECTORY, 'pip'),
|
||||
'install',
|
||||
'--requirement',
|
||||
requirement_path,
|
||||
temp_file.name,
|
||||
]
|
||||
|
||||
if _execute_install(cmd) != 0:
|
||||
|
||||
57
dcos/util.py
@@ -13,6 +13,7 @@ import time
|
||||
|
||||
import concurrent.futures
|
||||
import jsonschema
|
||||
import png
|
||||
import pystache
|
||||
import six
|
||||
from dcos import constants
|
||||
@@ -49,29 +50,29 @@ def tempdir():
|
||||
shutil.rmtree(tmpdir, ignore_errors=True)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def temptext():
|
||||
"""A context manager for temporary files.
|
||||
def sh_copy(src, dst):
|
||||
"""Copy file src to the file or directory dst.
|
||||
|
||||
The lifetime of the returned temporary file corresponds to the
|
||||
lexical scope of the returned file descriptor.
|
||||
|
||||
:return: reference to a temporary file
|
||||
:rtype: (fd, str)
|
||||
:param src: source file
|
||||
:type src: str
|
||||
:param dst: destination file or directory
|
||||
:type dst: str
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
fd, path = tempfile.mkstemp()
|
||||
try:
|
||||
yield (fd, path)
|
||||
finally:
|
||||
# Close the file descriptor and ignore errors
|
||||
try:
|
||||
os.close(fd)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# delete the path
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
shutil.copy(src, dst)
|
||||
except EnvironmentError as e:
|
||||
logger.exception('Unable to copy [%s] to [%s]', src, dst)
|
||||
if e.strerror:
|
||||
if e.filename:
|
||||
raise DCOSException("{}: {}".format(e.strerror, e.filename))
|
||||
else:
|
||||
raise DCOSException(e.strerror)
|
||||
else:
|
||||
raise DCOSException(e)
|
||||
except Exception as e:
|
||||
logger.exception('Unknown error while coping [%s] to [%s]', src, dst)
|
||||
raise DCOSException(e)
|
||||
|
||||
|
||||
def ensure_dir_exists(directory):
|
||||
@@ -658,4 +659,20 @@ def get_ssh_options(config_file, options):
|
||||
return ssh_options
|
||||
|
||||
|
||||
def validate_png(filename):
|
||||
"""Validate file as a png image. Throws a DCOSException if it is not an PNG
|
||||
|
||||
:param filename: path to the image
|
||||
:type filename: str
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
try:
|
||||
png.Reader(filename=filename).validate_signature()
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
raise DCOSException(
|
||||
'Unable to validate [{}] as a PNG file'.format(filename))
|
||||
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
10
setup.py
@@ -65,19 +65,17 @@ setup(
|
||||
# requirements files see:
|
||||
# https://packaging.python.org/en/latest/requirements.html
|
||||
install_requires=[
|
||||
'futures>=3.0, <4.0',
|
||||
'gitpython>=1.0, <2.0',
|
||||
|
||||
# pin the exact version, because jsonschema 2.5 broke py3
|
||||
'jsonschema==2.4',
|
||||
|
||||
'jsonschema==2.4', # pin the exact version, jsonschema 2.5 broke py3
|
||||
'pager>=3.3, <4.0',
|
||||
'portalocker>=0.5, <1.0',
|
||||
'prettytable>=0.7, <1.0',
|
||||
'pygments>=2.0, <3.0',
|
||||
'pypng==0.0.18',
|
||||
'pystache>=0.5, <1.0',
|
||||
'requests>=2.6, <3.0',
|
||||
'six>=1.9, <2.0',
|
||||
'toml>=0.9, <1.0',
|
||||
'futures>=3.0, <4.0',
|
||||
'prettytable>=0.7, <1.0',
|
||||
],
|
||||
)
|
||||
|
||||