superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] ejianu opened a new pull request #10771: [Helm] Automate datasource import
Date Wed, 02 Sep 2020 21:32:07 GMT

ejianu opened a new pull request #10771:
URL: https://github.com/apache/incubator-superset/pull/10771


   ### SUMMARY
   Helm chart change: Added 2 possible properties which will essentially automate the creation
of database connections in superset.
   
   Changes in the values file:
   `extraConfigs` to which we can pass a yaml file that we exported previously, that defines
a datasource.
   `extraConfigMountPath` location at which this file will be
   
   Changes in the chart:
   
   Added a configMap template file that only creates the ConfigMap if the `extraConfigs` is
set. 
   In the init-job file, the new "extra-config" volume is mounted only if `extraConfigs` is
set.
   
   In this way, the original approach should not be affected.
   
   ### TEST PLAN
   1. Make sure you create a datasource in the interface and export it to yaml, then delete
it and check it was deleted.
   2. In the values file set the yaml you exported, this is an example, but any datasource
exported yaml should do:
   ```
   extraConfigs: 
     datasources.yaml: | 
         databases:
         - allow_csv_upload: true
           allow_ctas: true
           allow_cvas: true
           database_name: presto
           extra: "{\r\n    \"metadata_params\": {},\r\n    \"engine_params\": {},\r\n   
\"\
             metadata_cache_timeout\": {},\r\n    \"schemas_allowed_for_csv_upload\": []\r\n\
             }"
           sqlalchemy_uri: presto://presto.whatever
           tables: []
   ```
   
   3. set the following property, the datasource file will be mounted at some location:
   `extraConfigMountPath: "/app/configs"`
   
   4. under the Init job configuration in the init script add a command that imports the file
we defined previously:
       echo "Initializing connection.... "
       superset import_datasources -p {{ .Values.extraConfigMountPath }}/datasources.yaml
   
   5. Check if the datasource was imported correctly.
   
   


----------------------------------------------------------------
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


Mime
View raw message