Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e0e6693
Merge pull request #1 from apache/master
azhar22k Sep 13, 2019
d9d124a
Allow connection pooling
azhar22k Sep 13, 2019
9a56908
Added peak customizations
azhar22k Sep 16, 2019
a6b4809
Added entry potnt setup script
azhar22k Sep 16, 2019
dc40816
Added docker configuration
azhar22k Sep 16, 2019
e514d50
Try using same secret key
azhar22k Sep 17, 2019
48b4b5d
Tenant specific secret key
azhar22k Sep 17, 2019
503750b
Fixed secret and entry poitn
azhar22k Sep 17, 2019
526bb66
Use CMD instead of ENTRYPOINT
azhar22k Sep 17, 2019
1bb397b
Fixed region and gevent
azhar22k Sep 17, 2019
8487e79
Added arg for AWS_DEFAULT_REGION
azhar22k Sep 17, 2019
6a0350f
Fexed docker env
azhar22k Sep 17, 2019
9ce7646
Allow post as well
azhar22k Sep 18, 2019
1527cd5
User superset user
azhar22k Sep 18, 2019
91ff8cd
Try without changing permissions
azhar22k Sep 18, 2019
ff06288
Try old config
azhar22k Sep 18, 2019
31bc62e
FIx typo
azhar22k Sep 18, 2019
0d54250
Fixed env vars
azhar22k Sep 18, 2019
1e30875
add guest user as well
azhar22k Sep 18, 2019
3bfad07
Fixed custom auth and added guest user
azhar22k Sep 18, 2019
1707101
Added user login duration
azhar22k Sep 19, 2019
47bcd80
Check access based on appId
azhar22k Sep 24, 2019
497899c
Add granular permissiong for gamma user
Shikhergarg Sep 24, 2019
c48e78c
change permissiong format
Shikhergarg Sep 24, 2019
2a68110
Sample pcv dash
azhar22k Sep 25, 2019
9782efc
always load examples
azhar22k Sep 25, 2019
93231b0
Allow oriogins
azhar22k Sep 25, 2019
11db62c
added monteserrat theme
Shikhergarg Sep 25, 2019
eb1f43d
added peak logo
Shikhergarg Sep 25, 2019
7500df6
Change logo size
Shikhergarg Sep 25, 2019
0f85085
Fixed image size
azhar22k Sep 25, 2019
d67d611
Merge pull request #4 from PeakBI/pe-3972-shikher
azhar22k Sep 25, 2019
de8be45
Minor config updates
azhar22k Sep 26, 2019
5284b76
Merge branch 'pe-3972-shikher' into pe-3972
azhar22k Sep 26, 2019
28b9395
Changed sesssion timing
azhar22k Sep 26, 2019
704a4ec
Incresed visualization limit
azhar22k Sep 26, 2019
d0904bf
Removed load examples
azhar22k Sep 26, 2019
0f85114
Merge pull request #3 from PeakBI/pe-3972
azhar22k Sep 27, 2019
c484af1
Always load examples db
azhar22k Sep 30, 2019
55876ce
revert slug changes
azhar22k Sep 30, 2019
21420ce
Merge branch 'master' into bugfix/db-tables
azhar22k Sep 30, 2019
44883dd
Added pcv data sources
azhar22k Oct 1, 2019
c96cf00
Added pcv dashboard
azhar22k Oct 1, 2019
9eefa5c
Load pcv dashboard at build time
azhar22k Oct 1, 2019
7ee91c9
Create user after permissions are fixed
azhar22k Oct 1, 2019
ae622c8
Merge pull request #5 from PeakBI/story/pe-4122/pcv-dashboard
azhar22k Oct 1, 2019
b69e77b
added charts only mode and remove margin
Shikhergarg Oct 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SQLALCHEMY_DATABASE_URI=
TENANT=
STAGE=
REDIS_ENDPOINT=
SQLALCHEMY_ENGINE_OPTIONS=
ADMIN_EMAIL=
ADMIN_PASSWORD=
GUEST_EMAIL=
GUEST_PASSWORD=
SUPERSET_ENV=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ apache-superset-*.tar.gz*

# Translation binaries
messages.mo
.env
75 changes: 75 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
FROM python:3.6-jessie

RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset

# Configure environment
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8

RUN apt-get update -y

# Install dependencies to fix `curl https support error` and `elaying package configuration warning`
RUN apt-get install -y apt-transport-https apt-utils


# Install superset dependencies
# https://superset.incubator.apache.org/installation.html#os-dependencies
RUN apt-get install -y build-essential libssl-dev \
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev

# Install extra useful tool for development
RUN apt-get install -y vim less postgresql-client redis-tools

# Install nodejs for custom build
# https://superset.incubator.apache.org/installation.html#making-your-own-build
# https://nodejs.org/en/download/package-manager/
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs


ARG SUPERSET_ENV=$SUPERSET_ENV
ARG SQLALCHEMY_DATABASE_URI=$SQLALCHEMY_DATABASE_URI
ARG TENANT=$TENANT
ARG STAGE=$STAGE
ARG REDIS_ENDPOINT=$REDIS_ENDPOINT
ARG SQLALCHEMY_ENGINE_OPTIONS=$SQLALCHEMY_ENGINE_OPTIONS
ARG ADMIN_EMAIL=$ADMIN_EMAIL
ARG ADMIN_PASSWORD=$ADMIN_PASSWORD
ARG GUEST_EMAIL=$GUEST_EMAIL
ARG GUEST_PASSWORD=$GUEST_PASSWORD
ARG AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION

ENV SUPERSET_ENV=${SUPERSET_ENV} \
SQLALCHEMY_DATABASE_URI=${SQLALCHEMY_DATABASE_URI} \
TENANT=${TENANT} \
STAGE=$STAGE \
REDIS_ENDPOINT=${REDIS_ENDPOINT} \
SQLALCHEMY_ENGINE_OPTIONS=${SQLALCHEMY_ENGINE_OPTIONS} \
ADMIN_EMAIL=${ADMIN_EMAIL} \
ADMIN_PASSWORD=${ADMIN_PASSWORD} \
GUEST_EMAIL=${GUEST_EMAIL} \
GUEST_PASSWORD=${GUEST_PASSWORD} \
AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}

WORKDIR /home/superset

COPY . /home/superset

RUN pip install --upgrade setuptools pip \
&& pip install -r requirements.txt -r requirements-dev.txt \
&& pip install -e . \
&& pip install gevent \
&& rm -rf /root/.cache/pip

RUN cd superset/assets \
&& npm ci \
&& npm run build \
&& rm -rf node_modules

RUN chmod +x docker_init.sh && ./docker_init.sh

RUN chmod +x docker_entrypoint.sh

EXPOSE 8088

CMD ["./docker_entrypoint.sh"]
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'
services:
superset:
container_name: ais-service-superset
build:
context: .
args:
SQLALCHEMY_DATABASE_URI: $SQLALCHEMY_DATABASE_URI
TENANT: $TENANT
STAGE: $STAGE
REDIS_ENDPOINT: $REDIS_ENDPOINT
SQLALCHEMY_ENGINE_OPTIONS: $SQLALCHEMY_ENGINE_OPTIONS
ADMIN_EMAIL: $ADMIN_EMAIL
ADMIN_PASSWORD: $ADMIN_PASSWORD
GUEST_EMAIL: $GUEST_EMAIL
GUEST_PASSWORD: $GUEST_PASSWORD
SUPERSET_ENV: $SUPERSET_ENV
restart: always
environment:
AWS_PROFILE: peak-dev
AWS_REGION: eu-west-1
env_file:
- .env
ports:
- 8088:8088
volumes:
- .:/home/superset
- $HOME/.aws:/root/.aws
tty: true
39 changes: 39 additions & 0 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/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.
#
export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
set -ex

if [ "$#" -ne 0 ]; then
exec "$@"
elif [ "$SUPERSET_ENV" = "development" ]; then
celery worker --app=superset.sql_lab:celery_app --pool=gevent -Ofair &
# needed by superset runserver
(cd superset/assets/ && npm ci)
(cd superset/assets/ && npm run dev) &
FLASK_ENV=development FLASK_APP=superset:app flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0
elif [ "$SUPERSET_ENV" = "production" ]; then
celery worker --app=superset.sql_lab:celery_app --pool=gevent -Ofair &
exec gunicorn --bind 0.0.0.0:8088 \
--workers $((2 * $(getconf _NPROCESSORS_ONLN) + 1)) \
--timeout 120 \
--limit-request-line 0 \
--limit-request-field_size 0 \
superset:app
else
superset --help
fi
49 changes: 49 additions & 0 deletions docker_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env 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.
#
set -ex

# Create an admin user
export FLASK_APP=superset:app
export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION

flask fab create-admin \
--username admin \
--firstname admin \
--lastname admin \
--email $ADMIN_EMAIL \
--password $ADMIN_PASSWORD

# Initialize the database
superset db upgrade

superset load_examples

# Load PCV datasources and dashboards at build time
superset import_datasources -p pcv_datasources.yml \
&& superset import_dashboards -p pcv_dashboard.json

# Create default roles and permissions
superset init

flask fab create-user \
--role Gamma \
--username guest \
--firstname guest \
--lastname guest \
--email $GUEST_EMAIL \
--password $GUEST_PASSWORD
Loading