You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2017/08/30 19:35:01 UTC
ambari git commit: AMBARI-21076. ADDENDUM. Delete the remaining DRUID
files after moving moving superset as an independent project. (Nishant
Bangarwa via Swapan Shridhar).
Repository: ambari
Updated Branches:
refs/heads/branch-2.6 39658e7dc -> fc52fc882
AMBARI-21076. ADDENDUM. Delete the remaining DRUID files after moving moving superset as an independent project. (Nishant Bangarwa via Swapan Shridhar).
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fc52fc88
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fc52fc88
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fc52fc88
Branch: refs/heads/branch-2.6
Commit: fc52fc882f5a789d6389ef3335d07fecf7801c2e
Parents: 39658e7
Author: Nishant <ni...@gmail.com>
Authored: Wed Aug 30 23:43:56 2017 +0530
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Wed Aug 30 12:34:46 2017 -0700
----------------------------------------------------------------------
.../0.9.2/configuration/druid-superset-env.xml | 130 --------------
.../0.9.2/configuration/druid-superset.xml | 178 -------------------
.../DRUID/0.9.2/package/scripts/superset.py | 167 -----------------
.../DRUID/0.9.2/package/templates/superset.sh | 95 ----------
.../0.15.0/configuration/superset-env.xml | 130 ++++++++++++++
.../SUPERSET/0.15.0/configuration/superset.xml | 178 +++++++++++++++++++
.../SUPERSET/0.15.0/package/scripts/superset.py | 167 +++++++++++++++++
.../0.15.0/package/templates/superset.sh | 95 ++++++++++
8 files changed, 570 insertions(+), 570 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset-env.xml b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset-env.xml
deleted file mode 100644
index 71fa3b6..0000000
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset-env.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<configuration>
- <property>
- <name>superset_log_dir</name>
- <value>/var/log/superset</value>
- <display-name>Superset log dir</display-name>
- <description>Superset log directory.</description>
- <value-attributes>
- <type>directory</type>
- </value-attributes>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_pid_dir</name>
- <value>/var/run/superset</value>
- <display-name>Superset pid dir</display-name>
- <description>Superset pid directory.</description>
- <value-attributes>
- <type>directory</type>
- </value-attributes>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_admin_user</name>
- <value>admin</value>
- <display-name>Superset Admin Username</display-name>
- <description>
- Superset Username. This value cannot be modified by Ambari
- except on initial install. Please make sure the username change in
- Superset is reflected in Ambari.
- </description>
- <value-attributes>
- <type>db_user</type>
- <overridable>false</overridable>
- </value-attributes>
- <on-ambari-upgrade add="true"/>
- </property>
- <property require-input="true">
- <name>superset_admin_password</name>
- <value/>
- <property-type>PASSWORD</property-type>
- <display-name>Superset Admin Password</display-name>
- <description>
- Superset password. This value cannot be modified by Ambari
- except on initial install. Please make sure the password change in
- Superset is reflected back in Ambari.
- </description>
- <value-attributes>
- <overridable>false</overridable>
- <type>password</type>
- </value-attributes>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_admin_firstname</name>
- <value></value>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_admin_lastname</name>
- <value></value>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_admin_email</name>
- <value></value>
- <on-ambari-upgrade add="true"/>
- </property>
- <property>
- <name>superset_user</name>
- <display-name>Superset User</display-name>
- <value>superset</value>
- <property-type>USER</property-type>
- <description></description>
- <value-attributes>
- <type>user</type>
- <overridable>false</overridable>
- </value-attributes>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>content</name>
- <display-name>superset-env template</display-name>
- <value>
- # Set environment variables here.
-
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
-
- # Superset Home Dir
- export SUPERSET_CONFIG_DIR={{superset_config_dir}}
-
- # Superset Log Dir
- export SUPERSET_LOG_DIR={{superset_log_dir}}
-
- # Superset Log Dir
- export SUPERSET_BIN_DIR={{superset_bin_dir}}
-
- # Superset PID Dir
- export SUPERSET_PID_DIR={{superset_pid_dir}}
-
- # Add superset_config.py to PYTHONPATH
- export PYTHONPATH=$PYTHONPATH:{{superset_config_dir}}
-
- export SUPERSET_WEBSERVER_PORT={{superset_webserver_port}}
- export SUPERSET_WEBSERVER_ADDRESS={{superset_webserver_address}}
- export SUPERSET_TIMEOUT={{superset_timeout}}
- export SUPERSET_WORKERS={{superset_workers}}
- </value>
- <on-ambari-upgrade add="true"/>
- </property>
-</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset.xml b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset.xml
deleted file mode 100644
index 2fff10a..0000000
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-superset.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
- <property>
- <name>ROW_LIMIT</name>
- <value>5000</value>
- <value-attributes>
- <type>int</type>
- <minimum>0</minimum>
- </value-attributes>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_WORKERS</name>
- <value>4</value>
- <value-attributes>
- <type>int</type>
- <minimum>0</minimum>
- </value-attributes>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_WEBSERVER_PORT</name>
- <value>9088</value>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_WEBSERVER_ADDRESS</name>
- <value>0.0.0.0</value>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_TIMEOUT</name>
- <value>60</value>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property require-input="true">
- <name>SUPERSET_DATABASE_TYPE</name>
- <display-name>Superset Database type</display-name>
- <value>sqlite</value>
- <value-attributes>
- <overridable>false</overridable>
- <type>value-list</type>
- <entries>
- <entry>
- <value>mysql</value>
- <label>MYSQL</label>
- </entry>
- <entry>
- <value>sqlite</value>
- <label>SQLITE</label>
- </entry>
- <entry>
- <value>postgresql</value>
- <label>POSTGRESQL</label>
- </entry>
- </entries>
- </value-attributes>
- <description>Type of the Database. Note that sqlite db will be installed on the node where superset is installed.
- Use mysql or postgred when installing superset on multiple nodes.
- mysql installed by ambari is only for development and not suitable for production use cases due to it being not HA.
- </description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_NAME</name>
- <value>superset</value>
- <display-name>Superset Database name</display-name>
- <description>Superset Database name</description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_PASSWORD</name>
- <value></value>
- <property-type>PASSWORD</property-type>
- <display-name>Superset Database password</display-name>
- <description>Password for the database.</description>
- <value-attributes>
- <type>password</type>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_USER</name>
- <value>superset</value>
- <display-name>Superset Database user</display-name>
- <description>Superset Database user</description>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_PORT</name>
- <value></value>
- <display-name>Superset Database port</display-name>
- <description>Superset Database port</description>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
- <depends-on>
- <property>
- <type>superset</type>
- <name>SUPERSET_DATABASE_TYPE</name>
- </property>
- </depends-on>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_NAME</name>
- <value>superset</value>
- <display-name>Superset Database name</display-name>
- <description>Superset Database name</description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SUPERSET_DATABASE_HOSTNAME</name>
- <value>localhost</value>
- <display-name>Database hostname</display-name>
- <description>Database hostname</description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>WTF_CSRF_ENABLED</name>
- <value>True</value>
- <description></description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>ENABLE_PROXY_FIX</name>
- <value>True</value>
- <description>When using Superset beind a Proxy server set this to True.</description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>MAPBOX_API_KEY</name>
- <value></value>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
- <description>API key to enable Mapbox visualizations</description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>SECRET_KEY</name>
- <value></value>
- <value-attributes>
- <type>password</type>
- </value-attributes>
- <description>Secret Key used to encrypt user passwords. A Long Random String is recommended.</description>
- <on-ambari-upgrade add="false"/>
- </property>
-</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py
deleted file mode 100644
index adbe739..0000000
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py
+++ /dev/null
@@ -1,167 +0,0 @@
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-import os
-
-from resource_management import Script
-from resource_management.core.logger import Logger
-from resource_management.core.resources import File
-from resource_management.core.resources.system import Directory
-from resource_management.core.resources.system import Execute
-from resource_management.core.source import InlineTemplate
-from resource_management.core.source import Template
-from resource_management.libraries.functions import StackFeature
-from resource_management.libraries.functions import stack_select
-from resource_management.libraries.functions.check_process_status import check_process_status
-from resource_management.libraries.functions.format import format
-from resource_management.libraries.functions.show_logs import show_logs
-from resource_management.libraries.functions.stack_features import check_stack_feature
-from resource_management.libraries.resources.properties_file import PropertiesFile
-
-class Superset(Script):
-
- def get_component_name(self):
- return format("superset")
-
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env, upgrade_type=None):
- import params
- Directory(
- [params.superset_pid_dir, params.superset_log_dir, params.superset_config_dir, params.superset_home_dir],
- mode=0755,
- cd_access='a',
- owner=params.superset_user,
- group=params.user_group,
- create_parents=True,
- recursive_ownership=True
- )
-
- File(format("{params.superset_config_dir}/superset-env.sh"),
- mode=0755,
- owner=params.superset_user,
- group=params.user_group,
- content=InlineTemplate(params.superset_env_sh_template)
- )
-
- File(os.path.join(params.superset_bin_dir, 'superset.sh'),
- owner=params.superset_user,
- group=params.user_group,
- mode=0755,
- content=Template("superset.sh")
- )
- superset_config = mutable_config_dict(params.config["configurations"]["superset"])
-
- if params.superset_db_uri:
- superset_config["SQLALCHEMY_DATABASE_URI"] = params.superset_db_uri
-
- PropertiesFile("superset_config.py",
- dir=params.superset_config_dir,
- properties=quote_string_values(superset_config),
- owner=params.superset_user,
- group=params.user_group
- )
-
- # Initialize DB and create admin user.
- Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset db upgrade"),
- user=params.superset_user)
- Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password!p}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"),
- user=params.superset_user)
- Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset init"),
- user=params.superset_user)
-
- # Configure Druid Cluster in superset DB
- if len(params.druid_coordinator_hosts) > 0 :
- Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset configure_druid_cluster --name druid-ambari --coordinator-host {params.druid_coordinator_host} --coordinator-port {params.druid_coordinator_port} --broker-host {params.druid_router_host} --broker-port {params.druid_router_port} --coordinator-endpoint druid/coordinator/v1/metadata --broker-endpoint druid/v2"),
- user=params.superset_user)
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- Logger.info("Executing superset Upgrade pre-restart")
- import params
-
- env.set_params(params)
-
- if params.stack_version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.stack_version):
- stack_select.select_packages(params.version)
-
- def start(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env, upgrade_type=upgrade_type)
- daemon_cmd = self.get_daemon_cmd(params, "start")
- try:
- Execute(daemon_cmd,
- user=params.superset_user
- )
- except:
- show_logs(params.superset_log_dir, params.superset_user)
- raise
-
- def stop(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env, upgrade_type=upgrade_type)
- daemon_cmd = self.get_daemon_cmd(params, "stop")
- try:
- Execute(daemon_cmd,
- user=params.superset_user
- )
- except:
- show_logs(params.superset_log_dir, params.superset_user)
- raise
-
- def status(self, env):
- import status_params
- env.set_params(status_params)
- pid_file = status_params.superset_pid_dir + '/superset.pid'
- check_process_status(pid_file)
-
- def get_log_folder(self):
- import params
- return params.superset_log_dir
-
- def get_user(self):
- import params
- return params.superset_user
-
- def get_daemon_cmd(self, params=None, command=None):
- return format('source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset.sh {command}')
-
-def mutable_config_dict(config):
- rv = {}
- for key, value in config.iteritems():
- rv[key] = value
- return rv
-
-def quote_string_values(config):
- rv = {}
- for key, value in config.iteritems():
- rv[key] = quote_string_value(value)
- return rv
-
-def quote_string_value(value):
- if value.lower() == "true" or value.lower() == "false" or value.isdigit():
- return value
- else:
- return "'{0}'".format(value)
-
-
-
-if __name__ == "__main__":
- Superset().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/templates/superset.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/templates/superset.sh b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/templates/superset.sh
deleted file mode 100644
index ffef1fe..0000000
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/templates/superset.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-## Runs superset as a daemon
-## Environment Variables used by this script -
-## SUPERSET_CONFIG_DIR - directory having superset config files
-## SUPERSET_LOG_DIR - directory used to store superset logs
-## SUPERSET_PID_DIR - directory used to store pid file
-
-usage="Usage: superset.sh (start|stop|status)"
-
-if [ $# -le 0 ]; then
- echo $usage
- exit 1
-fi
-
-command=$1
-
-CONF_DIR="${SUPERSET_CONFIG_DIR:=/etc/superset/conf}"
-LOG_DIR="${SUPERSET_LOG_DIR:=/var/log/superset}"
-PID_DIR="${SUPERSET_PID_DIR:=/var/run/superset}"
-TIMEOUT="${SUPERSET_TIMEOUT:=60}"
-WEBSERVER_ADDRESS="${SUPERSET_WEBSERVER_ADDRESS:=0.0.0.0}"
-WEBSERVER_PORT="${SUPERSET_WEBSERVER_PORT:=9088}"
-WORKERS="${SUPERSET_WORKERS:=4}"
-BIN_DIR="${SUPERSET_BIN_DIR}"
-
-pid=$PID_DIR/superset.pid
-
-case $command in
- (start)
-
- if [ -f $pid ]; then
- if kill -0 `cat $pid| head -n 1` > /dev/null 2>&1; then
- echo Superset node running as process `cat $pid | head -n 1`. Stop it first.
- exit 1
- fi
- fi
-
- $BIN_DIR/gunicorn -D --workers $WORKERS -p $pid --log-file $LOG_DIR/superset.log -t $TIMEOUT -b $WEBSERVER_ADDRESS:$WEBSERVER_PORT --limit-request-line 0 --limit-request-field_size 0 superset:app
-
- echo "Started Superset"
- ;;
-
- (stop)
-
- if [ -f $pid ]; then
- TARGET_PID=`cat $pid | head -n 1`
- if kill -0 $TARGET_PID > /dev/null 2>&1; then
- echo Stopping process `cat $pid | head -n 1`...
- kill $TARGET_PID
- else
- echo No superset node to stop
- fi
- rm -f $pid
- else
- echo No superset node to stop
- fi
- ;;
-
- (status)
- if [ -f $pid ]; then
- if kill -0 `cat $pid | head -n 1` > /dev/null 2>&1; then
- echo RUNNING
- exit 0
- else
- echo STOPPED
- fi
- else
- echo STOPPED
- fi
- ;;
-
- (*)
- echo $usage
- exit 1
- ;;
-esac
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset-env.xml b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset-env.xml
new file mode 100644
index 0000000..71fa3b6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset-env.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<configuration>
+ <property>
+ <name>superset_log_dir</name>
+ <value>/var/log/superset</value>
+ <display-name>Superset log dir</display-name>
+ <description>Superset log directory.</description>
+ <value-attributes>
+ <type>directory</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_pid_dir</name>
+ <value>/var/run/superset</value>
+ <display-name>Superset pid dir</display-name>
+ <description>Superset pid directory.</description>
+ <value-attributes>
+ <type>directory</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_admin_user</name>
+ <value>admin</value>
+ <display-name>Superset Admin Username</display-name>
+ <description>
+ Superset Username. This value cannot be modified by Ambari
+ except on initial install. Please make sure the username change in
+ Superset is reflected in Ambari.
+ </description>
+ <value-attributes>
+ <type>db_user</type>
+ <overridable>false</overridable>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property require-input="true">
+ <name>superset_admin_password</name>
+ <value/>
+ <property-type>PASSWORD</property-type>
+ <display-name>Superset Admin Password</display-name>
+ <description>
+ Superset password. This value cannot be modified by Ambari
+ except on initial install. Please make sure the password change in
+ Superset is reflected back in Ambari.
+ </description>
+ <value-attributes>
+ <overridable>false</overridable>
+ <type>password</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_admin_firstname</name>
+ <value></value>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_admin_lastname</name>
+ <value></value>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_admin_email</name>
+ <value></value>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>superset_user</name>
+ <display-name>Superset User</display-name>
+ <value>superset</value>
+ <property-type>USER</property-type>
+ <description></description>
+ <value-attributes>
+ <type>user</type>
+ <overridable>false</overridable>
+ </value-attributes>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>content</name>
+ <display-name>superset-env template</display-name>
+ <value>
+ # Set environment variables here.
+
+ export LC_ALL=en_US.UTF-8
+ export LANG=en_US.UTF-8
+
+ # Superset Home Dir
+ export SUPERSET_CONFIG_DIR={{superset_config_dir}}
+
+ # Superset Log Dir
+ export SUPERSET_LOG_DIR={{superset_log_dir}}
+
+ # Superset Log Dir
+ export SUPERSET_BIN_DIR={{superset_bin_dir}}
+
+ # Superset PID Dir
+ export SUPERSET_PID_DIR={{superset_pid_dir}}
+
+ # Add superset_config.py to PYTHONPATH
+ export PYTHONPATH=$PYTHONPATH:{{superset_config_dir}}
+
+ export SUPERSET_WEBSERVER_PORT={{superset_webserver_port}}
+ export SUPERSET_WEBSERVER_ADDRESS={{superset_webserver_address}}
+ export SUPERSET_TIMEOUT={{superset_timeout}}
+ export SUPERSET_WORKERS={{superset_workers}}
+ </value>
+ <on-ambari-upgrade add="true"/>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset.xml b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset.xml
new file mode 100644
index 0000000..2fff10a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/configuration/superset.xml
@@ -0,0 +1,178 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+ <property>
+ <name>ROW_LIMIT</name>
+ <value>5000</value>
+ <value-attributes>
+ <type>int</type>
+ <minimum>0</minimum>
+ </value-attributes>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_WORKERS</name>
+ <value>4</value>
+ <value-attributes>
+ <type>int</type>
+ <minimum>0</minimum>
+ </value-attributes>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_WEBSERVER_PORT</name>
+ <value>9088</value>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_WEBSERVER_ADDRESS</name>
+ <value>0.0.0.0</value>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_TIMEOUT</name>
+ <value>60</value>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property require-input="true">
+ <name>SUPERSET_DATABASE_TYPE</name>
+ <display-name>Superset Database type</display-name>
+ <value>sqlite</value>
+ <value-attributes>
+ <overridable>false</overridable>
+ <type>value-list</type>
+ <entries>
+ <entry>
+ <value>mysql</value>
+ <label>MYSQL</label>
+ </entry>
+ <entry>
+ <value>sqlite</value>
+ <label>SQLITE</label>
+ </entry>
+ <entry>
+ <value>postgresql</value>
+ <label>POSTGRESQL</label>
+ </entry>
+ </entries>
+ </value-attributes>
+ <description>Type of the Database. Note that sqlite db will be installed on the node where superset is installed.
+ Use mysql or postgred when installing superset on multiple nodes.
+ mysql installed by ambari is only for development and not suitable for production use cases due to it being not HA.
+ </description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_NAME</name>
+ <value>superset</value>
+ <display-name>Superset Database name</display-name>
+ <description>Superset Database name</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_PASSWORD</name>
+ <value></value>
+ <property-type>PASSWORD</property-type>
+ <display-name>Superset Database password</display-name>
+ <description>Password for the database.</description>
+ <value-attributes>
+ <type>password</type>
+ <empty-value-valid>true</empty-value-valid>
+ </value-attributes>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_USER</name>
+ <value>superset</value>
+ <display-name>Superset Database user</display-name>
+ <description>Superset Database user</description>
+ <value-attributes>
+ <empty-value-valid>true</empty-value-valid>
+ </value-attributes>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_PORT</name>
+ <value></value>
+ <display-name>Superset Database port</display-name>
+ <description>Superset Database port</description>
+ <value-attributes>
+ <empty-value-valid>true</empty-value-valid>
+ </value-attributes>
+ <depends-on>
+ <property>
+ <type>superset</type>
+ <name>SUPERSET_DATABASE_TYPE</name>
+ </property>
+ </depends-on>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_NAME</name>
+ <value>superset</value>
+ <display-name>Superset Database name</display-name>
+ <description>Superset Database name</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SUPERSET_DATABASE_HOSTNAME</name>
+ <value>localhost</value>
+ <display-name>Database hostname</display-name>
+ <description>Database hostname</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>WTF_CSRF_ENABLED</name>
+ <value>True</value>
+ <description></description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>ENABLE_PROXY_FIX</name>
+ <value>True</value>
+ <description>When using Superset beind a Proxy server set this to True.</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>MAPBOX_API_KEY</name>
+ <value></value>
+ <value-attributes>
+ <empty-value-valid>true</empty-value-valid>
+ </value-attributes>
+ <description>API key to enable Mapbox visualizations</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>SECRET_KEY</name>
+ <value></value>
+ <value-attributes>
+ <type>password</type>
+ </value-attributes>
+ <description>Secret Key used to encrypt user passwords. A Long Random String is recommended.</description>
+ <on-ambari-upgrade add="false"/>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/scripts/superset.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/scripts/superset.py b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/scripts/superset.py
new file mode 100644
index 0000000..adbe739
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/scripts/superset.py
@@ -0,0 +1,167 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+import os
+
+from resource_management import Script
+from resource_management.core.logger import Logger
+from resource_management.core.resources import File
+from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import Execute
+from resource_management.core.source import InlineTemplate
+from resource_management.core.source import Template
+from resource_management.libraries.functions import StackFeature
+from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.show_logs import show_logs
+from resource_management.libraries.functions.stack_features import check_stack_feature
+from resource_management.libraries.resources.properties_file import PropertiesFile
+
+class Superset(Script):
+
+ def get_component_name(self):
+ return format("superset")
+
+ def install(self, env):
+ self.install_packages(env)
+
+ def configure(self, env, upgrade_type=None):
+ import params
+ Directory(
+ [params.superset_pid_dir, params.superset_log_dir, params.superset_config_dir, params.superset_home_dir],
+ mode=0755,
+ cd_access='a',
+ owner=params.superset_user,
+ group=params.user_group,
+ create_parents=True,
+ recursive_ownership=True
+ )
+
+ File(format("{params.superset_config_dir}/superset-env.sh"),
+ mode=0755,
+ owner=params.superset_user,
+ group=params.user_group,
+ content=InlineTemplate(params.superset_env_sh_template)
+ )
+
+ File(os.path.join(params.superset_bin_dir, 'superset.sh'),
+ owner=params.superset_user,
+ group=params.user_group,
+ mode=0755,
+ content=Template("superset.sh")
+ )
+ superset_config = mutable_config_dict(params.config["configurations"]["superset"])
+
+ if params.superset_db_uri:
+ superset_config["SQLALCHEMY_DATABASE_URI"] = params.superset_db_uri
+
+ PropertiesFile("superset_config.py",
+ dir=params.superset_config_dir,
+ properties=quote_string_values(superset_config),
+ owner=params.superset_user,
+ group=params.user_group
+ )
+
+ # Initialize DB and create admin user.
+ Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset db upgrade"),
+ user=params.superset_user)
+ Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/fabmanager create-admin --app superset --username '{params.superset_admin_user}' --password '{params.superset_admin_password!p}' --firstname '{params.superset_admin_firstname}' --lastname '{params.superset_admin_lastname}' --email '{params.superset_admin_email}'"),
+ user=params.superset_user)
+ Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset init"),
+ user=params.superset_user)
+
+ # Configure Druid Cluster in superset DB
+ if len(params.druid_coordinator_hosts) > 0 :
+ Execute(format("source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset configure_druid_cluster --name druid-ambari --coordinator-host {params.druid_coordinator_host} --coordinator-port {params.druid_coordinator_port} --broker-host {params.druid_router_host} --broker-port {params.druid_router_port} --coordinator-endpoint druid/coordinator/v1/metadata --broker-endpoint druid/v2"),
+ user=params.superset_user)
+
+ def pre_upgrade_restart(self, env, upgrade_type=None):
+ Logger.info("Executing superset Upgrade pre-restart")
+ import params
+
+ env.set_params(params)
+
+ if params.stack_version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.stack_version):
+ stack_select.select_packages(params.version)
+
+ def start(self, env, upgrade_type=None):
+ import params
+ env.set_params(params)
+ self.configure(env, upgrade_type=upgrade_type)
+ daemon_cmd = self.get_daemon_cmd(params, "start")
+ try:
+ Execute(daemon_cmd,
+ user=params.superset_user
+ )
+ except:
+ show_logs(params.superset_log_dir, params.superset_user)
+ raise
+
+ def stop(self, env, upgrade_type=None):
+ import params
+ env.set_params(params)
+ self.configure(env, upgrade_type=upgrade_type)
+ daemon_cmd = self.get_daemon_cmd(params, "stop")
+ try:
+ Execute(daemon_cmd,
+ user=params.superset_user
+ )
+ except:
+ show_logs(params.superset_log_dir, params.superset_user)
+ raise
+
+ def status(self, env):
+ import status_params
+ env.set_params(status_params)
+ pid_file = status_params.superset_pid_dir + '/superset.pid'
+ check_process_status(pid_file)
+
+ def get_log_folder(self):
+ import params
+ return params.superset_log_dir
+
+ def get_user(self):
+ import params
+ return params.superset_user
+
+ def get_daemon_cmd(self, params=None, command=None):
+ return format('source {params.superset_config_dir}/superset-env.sh ; {params.superset_bin_dir}/superset.sh {command}')
+
+def mutable_config_dict(config):
+ rv = {}
+ for key, value in config.iteritems():
+ rv[key] = value
+ return rv
+
+def quote_string_values(config):
+ rv = {}
+ for key, value in config.iteritems():
+ rv[key] = quote_string_value(value)
+ return rv
+
+def quote_string_value(value):
+ if value.lower() == "true" or value.lower() == "false" or value.isdigit():
+ return value
+ else:
+ return "'{0}'".format(value)
+
+
+
+if __name__ == "__main__":
+ Superset().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/fc52fc88/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/templates/superset.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/templates/superset.sh b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/templates/superset.sh
new file mode 100644
index 0000000..ffef1fe
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SUPERSET/0.15.0/package/templates/superset.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+## Runs superset as a daemon
+## Environment Variables used by this script -
+## SUPERSET_CONFIG_DIR - directory having superset config files
+## SUPERSET_LOG_DIR - directory used to store superset logs
+## SUPERSET_PID_DIR - directory used to store pid file
+
+usage="Usage: superset.sh (start|stop|status)"
+
+if [ $# -le 0 ]; then
+ echo $usage
+ exit 1
+fi
+
+command=$1
+
+CONF_DIR="${SUPERSET_CONFIG_DIR:=/etc/superset/conf}"
+LOG_DIR="${SUPERSET_LOG_DIR:=/var/log/superset}"
+PID_DIR="${SUPERSET_PID_DIR:=/var/run/superset}"
+TIMEOUT="${SUPERSET_TIMEOUT:=60}"
+WEBSERVER_ADDRESS="${SUPERSET_WEBSERVER_ADDRESS:=0.0.0.0}"
+WEBSERVER_PORT="${SUPERSET_WEBSERVER_PORT:=9088}"
+WORKERS="${SUPERSET_WORKERS:=4}"
+BIN_DIR="${SUPERSET_BIN_DIR}"
+
+pid=$PID_DIR/superset.pid
+
+case $command in
+ (start)
+
+ if [ -f $pid ]; then
+ if kill -0 `cat $pid| head -n 1` > /dev/null 2>&1; then
+ echo Superset node running as process `cat $pid | head -n 1`. Stop it first.
+ exit 1
+ fi
+ fi
+
+ $BIN_DIR/gunicorn -D --workers $WORKERS -p $pid --log-file $LOG_DIR/superset.log -t $TIMEOUT -b $WEBSERVER_ADDRESS:$WEBSERVER_PORT --limit-request-line 0 --limit-request-field_size 0 superset:app
+
+ echo "Started Superset"
+ ;;
+
+ (stop)
+
+ if [ -f $pid ]; then
+ TARGET_PID=`cat $pid | head -n 1`
+ if kill -0 $TARGET_PID > /dev/null 2>&1; then
+ echo Stopping process `cat $pid | head -n 1`...
+ kill $TARGET_PID
+ else
+ echo No superset node to stop
+ fi
+ rm -f $pid
+ else
+ echo No superset node to stop
+ fi
+ ;;
+
+ (status)
+ if [ -f $pid ]; then
+ if kill -0 `cat $pid | head -n 1` > /dev/null 2>&1; then
+ echo RUNNING
+ exit 0
+ else
+ echo STOPPED
+ fi
+ else
+ echo STOPPED
+ fi
+ ;;
+
+ (*)
+ echo $usage
+ exit 1
+ ;;
+esac
\ No newline at end of file