-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable ssh tunneling using env variables for superset #60
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,10 @@ services: | |
superset: | ||
build: | ||
context: ./superset/ | ||
args: | ||
SUPERSET_PASSWORD: ${SUPERSET_PASSWORD:-password} | ||
SUPERSET_ADMIN_EMAIL: ${SUPERSET_ADMIN_EMAIL:[email protected]} | ||
environment: | ||
- SUPERSET_PASSWORD=${SUPERSET_PASSWORD:-password} | ||
- SUPERSET_ADMIN_EMAIL=${SUPERSET_ADMIN_EMAIL:[email protected]} | ||
- SUPERSET_SSH_TUNNELING=${SUPERSET_SSH_TUNNELING} | ||
ports: | ||
- 8080:8088 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ COUCHDB_SECURE=false | |
# superset: required environment variables for 'gamma', 'prod' and 'local' | ||
SUPERSET_PASSWORD=password | ||
[email protected] | ||
SUPERSET_SSH_TUNNELING=false | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
FROM apache/superset:2.0.0 | ||
FROM apache/superset:2.1.2 | ||
|
||
USER root | ||
|
||
ARG SUPERSET_PASSWORD=admin | ||
ARG [email protected] | ||
RUN pip install mysqlclient | ||
|
||
RUN pip install psycopg2-binary | ||
COPY ./superset-init.sh /superset-init.sh | ||
|
||
USER superset | ||
COPY superset_config.py /app/ | ||
ENV SUPERSET_CONFIG_PATH /app/superset_config.py | ||
|
||
RUN superset superset fab create-admin \ | ||
--username admin \ | ||
--firstname Superset \ | ||
--lastname Admin \ | ||
--email $SUPERSET_ADMIN_EMAIL \ | ||
--password $SUPERSET_PASSWORD | ||
RUN ["chmod", "+x", "/superset-init.sh"] | ||
|
||
RUN superset superset db upgrade | ||
RUN superset superset init | ||
USER superset | ||
ENTRYPOINT [ "/superset-init.sh" ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# create Admin user, you can read these values from env or anywhere else possible | ||
superset fab create-admin --username "admin" --firstname Superset --lastname Admin --email "$SUPERSET_ADMIN_EMAIL" --password "$SUPERSET_PASSWORD" | ||
|
||
# Upgrading Superset metastore | ||
superset db upgrade | ||
|
||
# setup roles and permissions | ||
superset superset init | ||
|
||
# Starting server | ||
/bin/sh -c /usr/bin/run-server.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import os | ||
|
||
FEATURE_FLAGS = { | ||
"ENABLE_TEMPLATE_PROCESSING": True, | ||
"SSH_TUNNELING": os.environ["SUPERSET_SSH_TUNNELING"], | ||
} | ||
|
||
ENABLE_PROXY_FIX = True | ||
SECRET_KEY = "YOUR_OWN_RANDOM_GENERATED_STRING" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there another way to set this secret key? Maybe to also use an environment variable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that should also be set with an env variable. I will make the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this setting:
SUPERSET_SSH_TUNNELING=false
in my .env file DBT container exits with errors.It works when I change this line to
SUPERSET_SSH_TUNNELING=False
Please add this detail to the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that. I will make the update.