diff --git a/assets/client_user_data.sh b/assets/client_user_data.sh index 7aeaa42..5451382 100644 --- a/assets/client_user_data.sh +++ b/assets/client_user_data.sh @@ -11,12 +11,13 @@ cat <<'EOF' >/opt/certs/server.key ${key_pem} EOF -### Redash +### Redash export COMPOSE_INTERACTIVE_NO_CLI=1 cd /opt/redash + sudo -E docker-compose exec -T server ./manage.py users create_root admin@redash admin --password "${admin_password}" -sudo -E docker-compose exec -T server ./manage.py ds new presto --type presto --options '{"host": "${presto_coordinator_host}", "username": "admin"}' +sudo -E docker-compose exec -T server ./manage.py ds new trino --type trino --options '{"host": "${presto_coordinator_host}", "username": "admin"}' # Redash OAuth setup # See https://redash.io/help/open-source/admin-guide/google-developer-account-setup @@ -65,19 +66,38 @@ sudo chown zeppelin:zeppelin /opt/zeppelin/conf -R sudo service zeppelin restart ### Apache Superset -. /etc/environment -. /opt/superset/venv/bin/activate - -superset db upgrade -export FLASK_APP=superset -flask fab create-admin --username admin --password ${admin_password} --firstname "" --lastname "" --email "" -superset init # Create presto datasource sudo sed -i -E "s/PRESTO_COORDINATOR_HOST/${presto_coordinator_host}/g" /opt/superset/config/presto-datasource.yaml -superset import_datasources -p /opt/superset/config/presto-datasource.yaml +sudo sed -ie '/^x-superset-volumes/a \ +\ \ - /opt/superset/config/presto-datasource.yaml:/tmp/presto-datasource.yaml\ +' /opt/superset/docker-compose-non-dev.yml + +#superset import datasources and gunicorn - not yet active +cd /opt/superset +sudo docker-compose -f docker-compose-non-dev.yml up -d +# sudo docker exec -it superset_app superset import-datasources -p /tmp/presto-datasource.yaml sudo rm /opt/superset/config/presto-datasource.yaml + + +# SUPERSET_VENV_PATH="/opt/superset/venv" +# apt-get install python3-venv +# python3 -m venv $SUPERSET_VENV_PATH +# . $SUPERSET_VENV_PATH/bin/activate +# +# pip install --upgrade setuptools pip +# pip install gevent +# nohup gunicorn -w 10 \ +# -k gevent \ +# --timeout 120 \ +# -b localhost:6000 \ +# --limit-request-line 0 \ +# --limit-request-field_size 0 \ +# --forwarded-allow-ips="*" \ +# superset:app & + + # Presto OAuth setup # See https://superset.incubator.apache.org/faq.html?highlight=oauth#how-can-i-configure-oauth-authentication-and-authorization #cat <<'EOF' >>/opt/superset/config/superset_config.py @@ -130,13 +150,6 @@ sudo rm /opt/superset/config/presto-datasource.yaml #] #EOF -nohup gunicorn -w 10 \ - -k gevent \ - --timeout 120 \ - -b localhost:6000 \ - --limit-request-line 0 \ - --limit-request-field_size 0 \ - --forwarded-allow-ips="*" \ - superset:app & -sudo systemctl restart nginx.service \ No newline at end of file + +sudo systemctl restart nginx.service diff --git a/packer/prestoclients.json b/packer/prestoclients.json index 0a34d0c..9fbc139 100644 --- a/packer/prestoclients.json +++ b/packer/prestoclients.json @@ -6,7 +6,7 @@ "ami_name": "prestoclients-{{isotime | clean_resource_name}}", "availability_zone": "{{user `aws_az`}}", "iam_instance_profile": "packer", - "instance_type": "t2.small", + "instance_type": "t2.medium", "region": "{{user `aws_region`}}", "run_tags": { "role": "packer" diff --git a/packer/prestoclients/install-superset.sh b/packer/prestoclients/install-superset.sh index 4c4faa0..99a4c00 100644 --- a/packer/prestoclients/install-superset.sh +++ b/packer/prestoclients/install-superset.sh @@ -1,9 +1,9 @@ SUPERSET_CONFIG_PATH="/opt/superset/config" -sudo mkdir -p $SUPERSET_CONFIG_PATH - git clone https://github.com/apache/superset.git /opt/superset +sudo mkdir -p $SUPERSET_CONFIG_PATH + cat <<'EOF' >$SUPERSET_CONFIG_PATH/presto-datasource.yaml databases: - database_name: trino @@ -22,4 +22,3 @@ EOF cd /opt/superset docker-compose -f docker-compose-non-dev.yml pull -docker-compose -f docker-compose-non-dev.yml up -d