You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/03/22 08:46:50 UTC

[GitHub] [incubator-superset] fbalicchia opened a new pull request #9346: improve helm chart

fbalicchia opened a new pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346
 
 
   ### CATEGORY
   
   - [x ] Enhancement (new features, refinement)
   
   ### SUMMARY
   Improve Superset chart
   
   ### ADDITIONAL INFORMATION
   Hi please review my PR, with this PR I've add possibility to 
   
   * Configure superset_config.py in values using configmap
   * Enable/disable Postgres and Redis deploy
   * Possibility to add postStart hook for Superset config like create user etc.ect
   
   This is for SupersetNode I will working soon on worker. 
   
   Thanks for your great work
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia commented on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia commented on issue #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-605590664
 
 
   Hi @ChethanUK  with superset node i mean frontend layer not worker. The name come from here
   https://github.com/apache/incubator-superset/blob/master/docker-compose.yml#L70 but if have a more appropriate, any suggestion are wellcome

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r398669965
 
 

 ##########
 File path: install/helm/superset/values.yaml
 ##########
 @@ -54,6 +54,184 @@ resources: {}
   # requests:
   #   cpu: 100m
   #   memory: 128Mi
+#Superset node configuration
+supersetNode:
+  config: |
+    import os
+
+    from werkzeug.contrib.cache import RedisCache
+    MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
+    CACHE_CONFIG = {
+        'CACHE_TYPE': 'redis',
+        'CACHE_DEFAULT_TIMEOUT': 300,
+        'CACHE_KEY_PREFIX': 'superset_',
+        'CACHE_REDIS_HOST': 'superset-redis-headless',
+        'CACHE_REDIS_PORT': 6379,
+        'CACHE_REDIS_DB': 1,
+        'CACHE_REDIS_URL': 'redis://superset-redis-headless:6379/1'}
+    SQLALCHEMY_DATABASE_URI = \
+        'postgresql+psycopg2://superset:superset@superset-postgresql:5432/superset'
+    SQLALCHEMY_TRACK_MODIFICATIONS = True
+    SECRET_KEY = 'thisISaSECRET_1234'
+    
+    # Flask-WTF flag for CSRF
+    WTF_CSRF_ENABLED = True
+    # Add endpoints that need to be exempt from CSRF protection
+    WTF_CSRF_EXEMPT_LIST = []
+    # A CSRF token that expires in 1 year
+    WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
+    
+    class CeleryConfig(object):
+        BROKER_URL = 'redis://superset-redis-headless:6379/0'
+        CELERY_IMPORTS = ('superset.sql_lab', )
+        CELERY_RESULT_BACKEND = 'redis://superset-redis-headless:6379/0'
+        CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}
+
+    CELERY_CONFIG = CeleryConfig
+    RESULTS_BACKEND = RedisCache(
+        host='redis',
+        port=6379,
+        key_prefix='superset_results'
+    )
+  #hooks: {}
+  hooks: 
+    ## (string) Script to execute prior the client pod stops.
+    # preStop: |-
+
+    ## (string) Script to execute after the client pod starts.
+    postStart: |-
+      #!/usr/bin/env bash
 
 Review comment:
   Maybe drop this in a script inside the files folder?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r398666729
 
 

 ##########
 File path: install/helm/superset/templates/deployment.yaml
 ##########
 @@ -42,6 +42,17 @@ spec:
           volumeMounts:
             - name: superset-config
               mountPath: /etc/superset/
+    {{- if .Values.supersetNode.hooks.postStart }}
+            - name: superset-config
+              mountPath: /superset_init.sh
+              subPath: superset_init.sh
+    {{- end }}
+          lifecycle:
+    {{- if .Values.supersetNode.hooks.postStart }}
+            postStart:
 
 Review comment:
   Rather than using k8s hooks on the deployment level, you should instead spin a Job up which runs the init script. That way, users can safely tune their replica count up/down without re-triggering the init.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r399205927
 
 

 ##########
 File path: install/helm/superset/templates/deployment.yaml
 ##########
 @@ -42,6 +42,17 @@ spec:
           volumeMounts:
             - name: superset-config
               mountPath: /etc/superset/
+    {{- if .Values.supersetNode.hooks.postStart }}
+            - name: superset-config
+              mountPath: /superset_init.sh
+              subPath: superset_init.sh
+    {{- end }}
+          lifecycle:
+    {{- if .Values.supersetNode.hooks.postStart }}
+            postStart:
 
 Review comment:
   Thanks, Jobs in Kubernetes will run to completion once they are created. I' will make configurable enable/disable of init job and in the init containers of job image I'll wait for db Do you see any drawback ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r399206717
 
 

 ##########
 File path: install/helm/superset/templates/configmap.yaml
 ##########
 @@ -24,4 +24,14 @@ metadata:
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 data:
-{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
+  {{- $defaultConf := .Files.Get "files/superset_config.py" |  nindent 4 }}
+  superset_config.py: |-
 
 Review comment:
   Ok

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] ChethanUK commented on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
ChethanUK commented on issue #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-605488271
 
 
   > SupersetNode
   
   What is SupersetNode?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r398671011
 
 

 ##########
 File path: install/helm/superset/templates/configmap.yaml
 ##########
 @@ -24,4 +24,14 @@ metadata:
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 data:
-{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
+  {{- $defaultConf := .Files.Get "files/superset_config.py" |  nindent 4 }}
+  superset_config.py: |-
 
 Review comment:
   Also, pipe the outputs to `tpl` so that end users can use template syntax in their overrides

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r405701435
 
 

 ##########
 File path: install/helm/superset/values.yaml
 ##########
 @@ -54,6 +54,132 @@ resources: {}
   # requests:
   #   cpu: 100m
   #   memory: 128Mi
+#Superset node configuration
+supersetNode:
+  connections: 
+    redis_host: superset-redis-headless
+    redis_port: "6379"
+    db_host: superset-postgresql
+    db_port: "5432"
+    db_user: superset
+    db_pass: superset
+    db_name: superset
+
+# -----------------------------------------------------------------------------
+# Miscellaneous parameters
+# -----------------------------------------------------------------------------
+
+init:
+  enabled: true
+  waitImage:
+    repository: busybox
+    tag: latest
+    pullPolicy: IfNotPresent
+  initscript: |-
+    superset fab create-admin \
 
 Review comment:
   I think you got things a bit out of order here. Should be:
   
   ```
   superset db upgrade
   superset init
   superset fab create-admin ...
   ```
   
   Also, please add `|| true` to the end of the fab admin command as to make it idempotent. We want this thing to run for each upgrade of Superset so that the DB stays up to date.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r405697535
 
 

 ##########
 File path: install/helm/superset/templates/init-job.yaml
 ##########
 @@ -0,0 +1,80 @@
+#
+# 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.
+#
+{{- if .Values.init.enabled  }}
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: {{ template "superset.name" . }}-init-db
+  annotations:
+spec:
+  template:
+    metadata:
+      name: {{ template "superset.name" . }}-init-db
+    spec:
+      initContainers:
+      {{- include "superset.wait-for-postgres" . | nindent 6 }}
 
 Review comment:
   Rather than doing this via a helper, you should define the `initContainers` block in `values.yaml` and then just use 
   ```
   {{ toYaml | tpl }}
   ```
   here. This way, consumers of this chart can pick their metadata store backend. (some use MySQL, for instance)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r398668123
 
 

 ##########
 File path: install/helm/superset/templates/configmap.yaml
 ##########
 @@ -24,4 +24,14 @@ metadata:
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 data:
-{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
+  {{- $defaultConf := .Files.Get "files/superset_config.py" |  nindent 4 }}
+  superset_config.py: |-
 
 Review comment:
   This config should really be in a secret. Although the current config has nothing "secret" in it, if a user were to try and use this in a production-like environment, they would likely have secrets in their configs

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] codecov-io commented on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-602176951
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=h1) Report
   > Merging [#9346](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ccf21f6f1b51dd7eaa3f7d23861ba7d1820ab99d&el=desc) will **not change** coverage by `%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9346/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9346   +/-   ##
   =======================================
     Coverage   58.96%   58.96%           
   =======================================
     Files         374      374           
     Lines       12137    12137           
     Branches     2992     2992           
   =======================================
     Hits         7156     7156           
     Misses       4802     4802           
     Partials      179      179           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=footer). Last update [ccf21f6...d791822](https://codecov.io/gh/apache/incubator-superset/pull/9346?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] garfieldcoked commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
garfieldcoked commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r405303670
 
 

 ##########
 File path: install/helm/superset/templates/deployment.yaml
 ##########
 @@ -42,6 +42,17 @@ spec:
           volumeMounts:
             - name: superset-config
               mountPath: /etc/superset/
+    {{- if .Values.supersetNode.hooks.postStart }}
+            - name: superset-config
+              mountPath: /superset_init.sh
+              subPath: superset_init.sh
+    {{- end }}
+          lifecycle:
+    {{- if .Values.supersetNode.hooks.postStart }}
+            postStart:
 
 Review comment:
   If a job fails another instance will be created until the job is completed or max retries reached. I think if the job fails because the database could not be reached and a new instance created after, this could be an alternative to adding logic in the container for waiting on db to be ready.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia commented on a change in pull request #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia commented on a change in pull request #9346: improve helm chart
URL: https://github.com/apache/incubator-superset/pull/9346#discussion_r399206717
 
 

 ##########
 File path: install/helm/superset/templates/configmap.yaml
 ##########
 @@ -24,4 +24,14 @@ metadata:
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 data:
-{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
+  {{- $defaultConf := .Files.Get "files/superset_config.py" |  nindent 4 }}
+  superset_config.py: |-
 
 Review comment:
   Ok

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia edited a comment on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia edited a comment on issue #9346:
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-617617223


   Thanks, @craig-rueda  rebase done. but I think that at moment of writing master is stuck too,
   Please tell me if  I can do something else


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia commented on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia commented on issue #9346:
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-617617223


   Thanks, @craig-rueda  rebase done. but I think that at moment of writing master is stuck too


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fbalicchia edited a comment on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
fbalicchia edited a comment on issue #9346:
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-617617223


   Thanks, @craig-rueda  rebase done. but I think that at moment of writing master is stuck too,
   Please tell me if can do something else


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] craig-rueda commented on issue #9346: improve helm chart

Posted by GitBox <gi...@apache.org>.
craig-rueda commented on issue #9346:
URL: https://github.com/apache/incubator-superset/pull/9346#issuecomment-617448651


   @fbalicchia - can you rebase with master? Looks like GH Actions are stuck. I will merge once status is reporting properly...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org