pax_global_header00006660000000000000000000000064127635052660014526gustar00rootroot0000000000000052 comment=9e58aef5e0a7b742d09ede04fa18163f2630c281 sahara-4.1.0/000077500000000000000000000000001276350526600127675ustar00rootroot00000000000000sahara-4.1.0/.coveragerc000066400000000000000000000002371276350526600151120ustar00rootroot00000000000000[run] branch = True source = sahara omit = */openstack/common/* .tox/* sahara/tests/* [paths] source = sahara [report] ignore_errors = True precision = 3 sahara-4.1.0/.gitignore000066400000000000000000000005301276350526600147550ustar00rootroot00000000000000*.egg-info *.egg[s] *.log *.py[co] .coverage .testrepository .tox .venv AUTHORS ChangeLog build cover develop-eggs dist doc/build doc/html eggs etc/sahara.conf etc/sahara/*.conf etc/sahara/*.topology sdist target tools/lintstack.head.py tools/pylint_exceptions doc/source/sample.config # Files created by releasenotes build releasenotes/build sahara-4.1.0/.gitreview000066400000000000000000000001471276350526600147770ustar00rootroot00000000000000[gerrit] host=review.openstack.org port=29418 project=openstack/sahara.git defaultbranch=stable/mitaka sahara-4.1.0/.mailmap000066400000000000000000000011121276350526600144030ustar00rootroot00000000000000# Format is: # # Sergey Lukjanov Dmitry Mescheryakov Nikita Konovalov Vadim Rovachev Xiang Hui Ivan Berezovskiy Denny Zhang Kazuki Oikawa Andrey Pavlov Sofiia Kostiuchenko Yevgen Runts sahara-4.1.0/.testr.conf000077500000000000000000000005431276350526600150620ustar00rootroot00000000000000[DEFAULT] test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ ${PYTHON:-python} -m subunit.run discover $DISCOVER_DIRECTORY $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list group_regex=([^\.]+\.)+ sahara-4.1.0/CONTRIBUTING.rst000066400000000000000000000012601276350526600154270ustar00rootroot00000000000000If you would like to contribute to the development of OpenStack, you must follow the steps in this page: http://docs.openstack.org/infra/manual/developers.html You can find more Sahara-specific info in our How To Participate guide: http://docs.openstack.org/developer/sahara/devref/how_to_participate.html Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/sahara sahara-4.1.0/HACKING.rst000066400000000000000000000027121276350526600145670ustar00rootroot00000000000000Sahara Style Commandments ========================== - Step 1: Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ - Step 2: Read on Sahara Specific Commandments ----------------------------- Commit Messages --------------- Using a common format for commit messages will help keep our git history readable. Follow these guidelines: - [S365] First, provide a brief summary of 50 characters or less. Summaries of greater then 72 characters will be rejected by the gate. - [S364] The first line of the commit message should provide an accurate description of the change, not just a reference to a bug or blueprint. Imports ------- - [S366, S367] Organize your imports according to the ``Import order`` Dictionaries/Lists ------------------ - [S360] Ensure default arguments are not mutable. - [S368] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs. For more information, please refer to http://legacy.python.org/dev/peps/pep-0274/ ======= Logs ---- - [S369] Check LOG.info translations - [S370] Check LOG.error translations - [S371] Check LOG.warning translations - [S372] Check LOG.critical translation - [S373] LOG.debug never used for translations - [S374] You used a deprecated log level Importing json -------------- - [S375] It's more preferable to use ``jsonutils`` from ``oslo_serialization`` instead of ``json`` for operating with ``json`` objects. sahara-4.1.0/LICENSE000066400000000000000000000236361276350526600140060ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. sahara-4.1.0/README.rst000066400000000000000000000012151276350526600144550ustar00rootroot00000000000000OpenStack Data Processing ("Sahara") project ============================================ Sahara at wiki.openstack.org: https://wiki.openstack.org/wiki/Sahara Launchpad project: https://launchpad.net/sahara Sahara docs site: http://docs.openstack.org/developer/sahara Roadmap: https://wiki.openstack.org/wiki/Sahara/Roadmap Quickstart guide: http://docs.openstack.org/developer/sahara/devref/quickstart.html How to participate: http://docs.openstack.org/developer/sahara/devref/how_to_participate.html Source: http://git.openstack.org/cgit/openstack/sahara License ------- Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 sahara-4.1.0/babel.cfg000066400000000000000000000000201276350526600145050ustar00rootroot00000000000000[python: **.py] sahara-4.1.0/bandit.yaml000066400000000000000000000116241276350526600151200ustar00rootroot00000000000000# optional: after how many files to update progress #show_progress_every: 100 # optional: plugins directory name #plugins_dir: 'plugins' # optional: plugins discovery name pattern plugin_name_pattern: '*.py' # optional: terminal escape sequences to display colors #output_colors: # DEFAULT: '\033[0m' # HEADER: '\033[95m' # LOW: '\033[94m' # WARN: '\033[93m' # ERROR: '\033[91m' # optional: log format string #log_format: "[%(module)s]\t%(levelname)s\t%(message)s" # globs of files which should be analyzed include: - '*.py' - '*.pyw' # a list of strings, which if found in the path will cause files to be excluded # for example /tests/ - to remove all all files in tests directory exclude_dirs: profiles: sahara_default: include: - general_hardcoded_password - blacklist_calls - blacklist_imports - subprocess_popen_with_shell_equals_true - subprocess_without_shell_equals_true - any_other_function_with_shell_equals_true - start_process_with_a_shell - start_process_with_no_shell - hardcoded_sql_expressions - jinja2_autoescape_false - use_of_mako_templates blacklist_calls: bad_name_sets: - pickle: qualnames: [pickle.loads, pickle.load, pickle.Unpickler, cPickle.loads, cPickle.load, cPickle.Unpickler] message: "Pickle library appears to be in use, possible security issue." - marshal: qualnames: [marshal.load, marshal.loads] message: "Deserialization with the marshal module is possibly dangerous." - md5: qualnames: [hashlib.md5] message: "Use of insecure MD5 hash function." - mktemp_q: qualnames: [tempfile.mktemp] message: "Use of insecure and deprecated function (mktemp)." - eval: qualnames: [eval] message: "Use of possibly insecure function - consider using safer ast.literal_eval." - mark_safe: qualnames: [mark_safe] message: "Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed." - httpsconnection: qualnames: [httplib.HTTPSConnection] message: "Use of HTTPSConnection does not provide security, see https://wiki.openstack.org/wiki/OSSN/OSSN-0033" - yaml_load: qualnames: [yaml.load] message: "Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load()." - urllib_urlopen: qualnames: [urllib.urlopen, urllib.urlretrieve, urllib.URLopener, urllib.FancyURLopener, urllib2.urlopen, urllib2.Request] message: "Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected." shell_injection: # Start a process using the subprocess module, or one of its wrappers. subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output, utils.execute, utils.execute_with_timeout] # Start a process with a function vulnerable to shell injection. shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3, popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput] # Start a process with a function that is not vulnerable to shell injection. no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv,os.execve, os.execvp, os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve, os.spawnvp, os.spawnvpe, os.startfile] blacklist_imports: bad_import_sets: - telnet: imports: [telnetlib] level: ERROR message: "Telnet is considered insecure. Use SSH or some other encrypted protocol." - info_libs: imports: [pickle, cPickle, subprocess, Crypto] level: LOW message: "Consider possible security implications associated with {module} module." hardcoded_tmp_directory: tmp_dirs: [/tmp, /var/tmp, /dev/shm] hardcoded_password: word_list: "wordlist/default-passwords" ssl_with_bad_version: bad_protocol_versions: - 'PROTOCOL_SSLv2' - 'SSLv2_METHOD' - 'SSLv23_METHOD' - 'PROTOCOL_SSLv3' # strict option - 'PROTOCOL_TLSv1' # strict option - 'SSLv3_METHOD' # strict option - 'TLSv1_METHOD' # strict option password_config_option_not_marked_secret: function_names: - oslo.config.cfg.StrOpt - oslo_config.cfg.StrOpt execute_with_run_as_root_equals_true: function_names: - ceilometer.utils.execute - cinder.utils.execute - neutron.agent.linux.utils.execute - nova.utils.execute - nova.utils.trycmd try_except_pass: check_typed_exception: True sahara-4.1.0/devstack/000077500000000000000000000000001276350526600145735ustar00rootroot00000000000000sahara-4.1.0/devstack/README.rst000066400000000000000000000007201276350526600162610ustar00rootroot00000000000000====================== Enabling in Devstack ====================== 1. Download DevStack 2. Add this repo as an external repository in ``local.conf`` .. sourcecode:: bash [[local|localrc]] enable_plugin sahara git://git.openstack.org/openstack/sahara Optionally, a git refspec may be provided as follows: .. sourcecode:: bash [[local|localrc]] enable_plugin sahara git://git.openstack.org/openstack/sahara 3. run ``stack.sh`` sahara-4.1.0/devstack/exercise.sh000066400000000000000000000027201276350526600167370ustar00rootroot00000000000000#!/usr/bin/env bash # Sanity check that Sahara started if enabled echo "*********************************************************************" echo "Begin DevStack Exercise: $0" echo "*********************************************************************" # This script exits on an error so that errors don't compound and you see # only the first error that occurred. set -o errexit # Print the commands being run so that we can see the command that triggers # an error. It is also useful for following allowing as the install occurs. set -o xtrace # Settings # ======== # Keep track of the current directory EXERCISE_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=$(cd $EXERCISE_DIR/..; pwd) # Import common functions source $TOP_DIR/functions # Import configuration source $TOP_DIR/openrc # Import exercise configuration source $TOP_DIR/exerciserc is_service_enabled sahara || exit 55 if is_ssl_enabled_service "sahara" ||\ is_ssl_enabled_service "sahara-api" ||\ is_service_enabled tls-proxy; then SAHARA_SERVICE_PROTOCOL="https" fi SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} $CURL_GET $SAHARA_SERVICE_PROTOCOL://$SERVICE_HOST:8386/ 2>/dev/null \ | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!" set +o xtrace echo "*********************************************************************" echo "SUCCESS: End DevStack Exercise: $0" echo "*********************************************************************" sahara-4.1.0/devstack/plugin.sh000066400000000000000000000170401276350526600164270ustar00rootroot00000000000000#!/bin/bash # # lib/sahara # Dependencies: # ``functions`` file # ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined # ``stack.sh`` calls the entry points in this order: # # install_sahara # install_python_saharaclient # configure_sahara # start_sahara # stop_sahara # cleanup_sahara # Save trace setting XTRACE=$(set +o | grep xtrace) set +o xtrace # Functions # --------- # create_sahara_accounts() - Set up common required sahara accounts # # Tenant User Roles # ------------------------------ # service sahara admin function create_sahara_accounts { create_service_user "sahara" if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then get_or_create_service "sahara" \ "data-processing" \ "Sahara Data Processing" get_or_create_endpoint "data-processing" \ "$REGION_NAME" \ "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" fi } # cleanup_sahara() - Remove residual data files, anything left over from # previous runs that would need to clean up. function cleanup_sahara { # Cleanup auth cache dir sudo rm -rf $SAHARA_AUTH_CACHE_DIR } # configure_sahara() - Set config files, create data dirs, etc function configure_sahara { sudo install -d -o $STACK_USER $SAHARA_CONF_DIR if [[ -f $SAHARA_DIR/etc/sahara/policy.json ]]; then cp -p $SAHARA_DIR/etc/sahara/policy.json $SAHARA_CONF_DIR fi cp -p $SAHARA_DIR/etc/sahara/api-paste.ini $SAHARA_CONF_DIR # Create auth cache dir sudo install -d -o $STACK_USER -m 700 $SAHARA_AUTH_CACHE_DIR rm -rf $SAHARA_AUTH_CACHE_DIR/* configure_auth_token_middleware \ $SAHARA_CONF_FILE sahara $SAHARA_AUTH_CACHE_DIR # Set admin user parameters needed for trusts creation iniset $SAHARA_CONF_FILE \ keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME iniset $SAHARA_CONF_FILE keystone_authtoken admin_user sahara iniset $SAHARA_CONF_FILE \ keystone_authtoken admin_password $SERVICE_PASSWORD iniset_rpc_backend sahara $SAHARA_CONF_FILE DEFAULT # Set configuration to send notifications if is_service_enabled ceilometer; then iniset $SAHARA_CONF_FILE oslo_messaging_notifications enable "true" iniset $SAHARA_CONF_FILE oslo_messaging_notifications driver "messaging" fi iniset $SAHARA_CONF_FILE DEFAULT verbose True iniset $SAHARA_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $SAHARA_CONF_FILE DEFAULT plugins $SAHARA_ENABLED_PLUGINS iniset $SAHARA_CONF_FILE \ database connection `database_connection_url sahara` if is_service_enabled neutron; then iniset $SAHARA_CONF_FILE DEFAULT use_neutron true if is_ssl_enabled_service "neutron" \ || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE neutron ca_file $SSL_BUNDLE_FILE fi else iniset $SAHARA_CONF_FILE DEFAULT use_neutron false fi if is_ssl_enabled_service "heat" || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE heat ca_file $SSL_BUNDLE_FILE fi if is_ssl_enabled_service "cinder" || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE cinder ca_file $SSL_BUNDLE_FILE fi if is_ssl_enabled_service "nova" || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE nova ca_file $SSL_BUNDLE_FILE fi if is_ssl_enabled_service "swift" || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE swift ca_file $SSL_BUNDLE_FILE fi if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then iniset $SAHARA_CONF_FILE keystone ca_file $SSL_BUNDLE_FILE fi # Register SSL certificates if provided if is_ssl_enabled_service sahara; then ensure_certificates SAHARA iniset $SAHARA_CONF_FILE ssl cert_file "$SAHARA_SSL_CERT" iniset $SAHARA_CONF_FILE ssl key_file "$SAHARA_SSL_KEY" fi iniset $SAHARA_CONF_FILE DEFAULT use_syslog $SYSLOG # Format logging if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then setup_colorized_logging $SAHARA_CONF_FILE DEFAULT fi if is_service_enabled tls-proxy; then # Set the service port for a proxy to take the original iniset $SAHARA_CONF_FILE DEFAULT port $SAHARA_SERVICE_PORT_INT fi if [ "$SAHARA_ENABLE_DISTRIBUTED_PERIODICS" == "True" ]; then # Enable distributed periodic tasks iniset $SAHARA_CONF_FILE DEFAULT periodic_coordinator_backend_url\ $SAHARA_PERIODIC_COORDINATOR_URL fi recreate_database sahara $SAHARA_BIN_DIR/sahara-db-manage \ --config-file $SAHARA_CONF_FILE upgrade head } # install_sahara() - Collect source and prepare function install_sahara { setup_develop $SAHARA_DIR } # install_python_saharaclient() - Collect source and prepare function install_python_saharaclient { if use_library_from_git "python-saharaclient"; then git_clone $SAHARACLIENT_REPO $SAHARACLIENT_DIR $SAHARACLIENT_BRANCH setup_develop $SAHARACLIENT_DIR fi } # start_sahara() - Start running processes, including screen function start_sahara { local service_port=$SAHARA_SERVICE_PORT local service_protocol=$SAHARA_SERVICE_PROTOCOL if is_service_enabled tls-proxy; then service_port=$SAHARA_SERVICE_PORT_INT service_protocol="http" fi run_process sahara-all "$SAHARA_BIN_DIR/sahara-all \ --config-file $SAHARA_CONF_FILE" run_process sahara-api "$SAHARA_BIN_DIR/sahara-api \ --config-file $SAHARA_CONF_FILE" run_process sahara-eng "$SAHARA_BIN_DIR/sahara-engine \ --config-file $SAHARA_CONF_FILE" echo "Waiting for Sahara to start..." if ! wait_for_service $SERVICE_TIMEOUT \ $service_protocol://$SAHARA_SERVICE_HOST:$service_port; then die $LINENO "Sahara did not start" fi # Start proxies if enabled if is_service_enabled tls-proxy; then start_tls_proxy '*' $SAHARA_SERVICE_PORT \ $SAHARA_SERVICE_HOST \ $SAHARA_SERVICE_PORT_INT & fi } # stop_sahara() - Stop running processes function stop_sahara { # Kill the Sahara screen windows stop_process sahara-all stop_process sahara-api stop_process sahara-eng } # is_sahara_enabled. This allows is_service_enabled sahara work # correctly throughout devstack. function is_sahara_enabled { if is_service_enabled sahara-api || \ is_service_enabled sahara-eng || \ is_service_enabled sahara-all; then return 0 else return 1 fi } # Dispatcher for Sahara plugin if is_service_enabled sahara; then if [[ "$1" == "stack" && "$2" == "install" ]]; then echo_summary "Installing sahara" install_sahara install_python_saharaclient cleanup_sahara elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then echo_summary "Configuring sahara" configure_sahara create_sahara_accounts elif [[ "$1" == "stack" && "$2" == "extra" ]]; then echo_summary "Initializing sahara" start_sahara fi if [[ "$1" == "unstack" ]]; then stop_sahara fi if [[ "$1" == "clean" ]]; then cleanup_sahara fi fi # Restore xtrace $XTRACE # Local variables: # mode: shell-script # End: sahara-4.1.0/devstack/settings000066400000000000000000000026761276350526600163710ustar00rootroot00000000000000#!/bin/bash # Settings needed for the Sahara plugin # ------------------------------------- # Set up default directories SAHARACLIENT_DIR=$DEST/python-saharaclient SAHARA_DIR=$DEST/sahara SAHARACLIENT_REPO=${SAHARACLIENT_REPO:-\ ${GIT_BASE}/openstack/python-saharaclient.git} SAHARACLIENT_BRANCH=${SAHARACLIENT_BRANCH:-master} SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara} SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf # TODO(slukjanov): Should we append sahara to SSL_ENABLED_SERVICES? if is_ssl_enabled_service "sahara" || is_service_enabled tls-proxy; then SAHARA_SERVICE_PROTOCOL="https" fi SAHARA_SERVICE_HOST=${SAHARA_SERVICE_HOST:-$SERVICE_HOST} SAHARA_SERVICE_PORT=${SAHARA_SERVICE_PORT:-8386} SAHARA_SERVICE_PORT_INT=${SAHARA_SERVICE_PORT_INT:-18386} SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} SAHARA_AUTH_CACHE_DIR=${SAHARA_AUTH_CACHE_DIR:-/var/cache/sahara} SAHARA_ENABLED_PLUGINS=${SAHARA_ENABLED_PLUGINS:-\ vanilla,hdp,cdh,mapr,spark,storm,fake} SAHARA_BIN_DIR=$(get_python_exec_prefix) SAHARA_ENABLE_DISTRIBUTED_PERIODICS=${SAHARA_ENABLE_DISTRIBUTED_PERIODICS:-\ True} SAHARA_PERIODIC_COORDINATOR_URL=${SAHARA_PERIODIC_COORDINATOR_URL:-\ kazoo://127.0.0.1:2181} # Tell Tempest this project is present TEMPEST_SERVICES+=,sahara enable_service sahara-api sahara-eng enable_service heat h-eng h-api h-api-cfn h-api-cw if [ "$SAHARA_ENABLE_DISTRIBUTED_PERIODICS" == "True" ]; then enable_service zookeeper fi sahara-4.1.0/devstack/upgrade/000077500000000000000000000000001276350526600162225ustar00rootroot00000000000000sahara-4.1.0/devstack/upgrade/cluster-create.json000066400000000000000000000003231276350526600220350ustar00rootroot00000000000000{ "name": "cluster-grenade", "plugin_name": "fake", "hadoop_version": "0.1", "cluster_template_id" : "CLUSTER_TEMPLATE_ID", "user_keypair_id": "KEYPAIR", "default_image_id": "IMAGE_ID" } sahara-4.1.0/devstack/upgrade/cluster-template.json000066400000000000000000000003711276350526600224100ustar00rootroot00000000000000{ "name": "cluster-template-grenade", "plugin_name": "fake", "hadoop_version": "0.1", "node_groups": [ { "name": "allinone", "node_group_template_id": "NG_ID", "count": 1 } ] } sahara-4.1.0/devstack/upgrade/from-liberty/000077500000000000000000000000001276350526600206355ustar00rootroot00000000000000sahara-4.1.0/devstack/upgrade/from-liberty/upgrade-sahara000066400000000000000000000004461276350526600234500ustar00rootroot00000000000000#!/usr/bin/env bash # ``upgrade-sahara`` function configure_sahara_upgrade { XTRACE=$(set +o | grep xtrace) set -o xtrace # Copy api-paste.ini to configuration directory cp -p $SAHARA_DIR/etc/sahara/api-paste.ini $SAHARA_CONF_DIR # reset to previous state $XTRACE } sahara-4.1.0/devstack/upgrade/ng-template.json000066400000000000000000000004741276350526600213370ustar00rootroot00000000000000{ "name": "ng-template-grenade", "flavor_id": "FLAVOR_ID", "plugin_name": "fake", "hadoop_version": "0.1", "node_processes": ["jobtracker", "namenode", "tasktracker", "datanode"], "auto_security_group": true, "security_groups": ["SEC_GROUP"], "floating_ip_pool": "FLOATING_IP_POOL" } sahara-4.1.0/devstack/upgrade/resources.sh000077500000000000000000000174561276350526600206100ustar00rootroot00000000000000#!/bin/bash set -o errexit source $GRENADE_DIR/grenaderc source $GRENADE_DIR/functions source $TOP_DIR/openrc admin admin set -o xtrace SAHARA_USER=sahara_grenade SAHARA_PROJECT=sahara_grenade SAHARA_PASS=pass SAHARA_SERVER=sahara_server1 SAHARA_KEY=sahara_key SAHARA_KEY_FILE=$SAVE_DIR/sahara_key.pem JSON_PATH=`dirname $BASH_SOURCE` PUBLIC_NETWORK_NAME=${PUBLIC_NETWORK_NAME:-public} PRIVATE_NETWORK_NAME=${PRIVATE_NETWORK_NAME:-private} # cirros image is not appropriate for cluster creation SAHARA_IMAGE_NAME=${SAHARA_IMAGE_NAME:-fedora-heat-test-image} SAHARA_IMAGE_USER=${SAHARA_IMAGE_USER:-fedora} # custom flavor parameters SAHARA_FLAVOR_NAME=${SAHARA_FLAVOR_NAME:-sahara_flavor} SAHARA_FLAVOR_RAM=${SAHARA_FLAVOR_RAM:-1024} SAHARA_FLAVOR_DISK=${SAHARA_FLAVOR_DISK:-10} function _sahara_set_user { OS_TENANT_NAME=$SAHARA_PROJECT OS_USERNAME=$SAHARA_USER OS_PASSWORD=$SAHARA_PASS } function register_image { eval $(openstack --os-image-api-version 1 image show -f \ shell -c id $SAHARA_IMAGE_NAME) resource_save sahara image_id $id sahara image-register --id $id --username $SAHARA_IMAGE_USER sahara image-add-tag --id $id --tag fake sahara image-add-tag --id $id --tag 0.1 echo $id } # args: