Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG NODE_VERSION=latest
ARG PYTHON_VERSION=3.7
ARG PYTHON_VERSION=3.7

#
# --- Build assets with NodeJS
Expand Down Expand Up @@ -72,7 +72,7 @@ RUN apt-get update && \
libsasl2-modules-gssapi-mit \
libssl1.0 && \
apt-get clean && \
tar xzf superset.tar.gz && \
tar xzf superset.tar.gz && \
pip install dist/*.tar.gz -r requirements-db.txt -r requirements.txt

# Create superset user
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

For a more detailed guide on how to deploy [Apache Superset (Incubating)](https://superset.incubator.apache.org/) on Google Cloud refere tho this [blog post](https://medium.com/@feroult/serverless-superset-on-google-cloud-87d3cf324845).

Two addtions to the blog post:

- Source all scripts so newly set environment variables are available for the next script:
*source ./scripts/...* instead of *./scripts/..*

- Run bigquery_setup as very last step, as the service account that has to be modified is not available before
9 changes: 9 additions & 0 deletions config/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ def randomString(stringLength=10):
SECRET_KEY = 'my-app-secret-123'
DATA_DIR = "/tmp/superset-" + randomString(20)

# Cookie policies
# https://github.com/apache/incubator-superset/issues/8382
SESSION_COOKIE_SAMESITE = None
SESSION_COOKIE_HTTPONLY = False


# Add a row limit
ROW_LIMIT = 5000

# Mapbox
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')

Expand Down
3 changes: 2 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ run() {
cat ../../requirements-db.txt >> requirements.txt
cp ../../../config/app.yaml .
cp ../../../config/superset_config.py .
gcloud app create --region=$REGION
gcloud app deploy -q
}

rm -rf .staging && mkdir .staging
(cd .staging && run)
(cd .staging && run)
2 changes: 1 addition & 1 deletion scripts/setup_bigquery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member "serviceAccount:${PROJECT_ID}@appspot.gserviceaccount.com" \
--role "roles/bigquery.dataViewer"

gcloud projects add-iam-policy-binding ${${PROJECT_ID}} \
gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member "serviceAccount:${PROJECT_ID}@appspot.gserviceaccount.com" \
--role "roles/bigquery.jobUser"
4 changes: 2 additions & 2 deletions scripts/superset_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ if ! gcloud compute instances list | grep ${ADMIN_INSTANCE_NAME}; then
create_admin_instance
fi

gcloud compute scp config/superset_config.py superset@${ADMIN_INSTANCE_NAME}:
gcloud compute scp config/superset_config.py --zone ${ZONE} superset@${ADMIN_INSTANCE_NAME}:

run_superset_command flask fab create-admin
run_superset_command superset db upgrade
run_superset_command superset init
run_superset_command superset load_examples

gcloud compute instances delete ${ADMIN_INSTANCE_NAME} -q
gcloud compute instances delete ${ADMIN_INSTANCE_NAME} -q --zone ${ZONE}