From 7360a14bbc9b5a566b9bafb30653507f302800dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20G=C3=B3mez=20Buceta?= Date: Tue, 7 Nov 2023 10:58:07 +0100 Subject: [PATCH] Inicio de repositorio --- .gitignore | 42 +++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 22 +++++++++++++++++++ docker-compose.yml | 14 +++++++++++++ superset/dockerfile | 17 +++++++++++++++ superset/superset-init.sh | 13 ++++++++++++ superset/superset_config.py | 9 ++++++++ 6 files changed, 117 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 docker-compose.yml create mode 100644 superset/dockerfile create mode 100755 superset/superset-init.sh create mode 100644 superset/superset_config.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a314d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,linux + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux + +# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cf65612 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#1a1a1a", + "activityBar.background": "#1a1a1a", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "activityBarBadge.background": "#606020", + "activityBarBadge.foreground": "#e7e7e7", + "commandCenter.border": "#e7e7e799", + "sash.hoverBorder": "#1a1a1a", + "statusBar.background": "#000000", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#1a1a1a", + "statusBarItem.remoteBackground": "#000000", + "statusBarItem.remoteForeground": "#e7e7e7", + "titleBar.activeBackground": "#000000", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#00000099", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.color": "#000" +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..58cbe10 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + superset: + build: + context: ./superset + dockerfile: dockerfile + container_name: superset + environment: + - ADMIN_USERNAME=admin + - ADMIN_EMAIL=admin@superset.com + - ADMIN_PASSWORD=admin + ports: + - '8088:8088' \ No newline at end of file diff --git a/superset/dockerfile b/superset/dockerfile new file mode 100644 index 0000000..160b67a --- /dev/null +++ b/superset/dockerfile @@ -0,0 +1,17 @@ +FROM apache/superset:3.0.1 + +USER root + +RUN pip install mysqlclient + +ENV ADMIN_USERNAME $ADMIN_USERNAME +ENV ADMIN_EMAIL $ADMIN_EMAIL +ENV ADMIN_PASSWORD $ADMIN_PASSWORD + +COPY ./superset-init.sh /superset-init.sh + +COPY superset_config.py /app/ +ENV SUPERSET_CONFIG_PATH /app/superset_config.py + +USER superset +ENTRYPOINT [ "/superset-init.sh" ] \ No newline at end of file diff --git a/superset/superset-init.sh b/superset/superset-init.sh new file mode 100755 index 0000000..0c1e659 --- /dev/null +++ b/superset/superset-init.sh @@ -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_USERNAME" --firstname Superset --lastname Admin --email "$ADMIN_EMAIL" --password "$ADMIN_PASSWORD" + +# Upgrading Superset metastore +superset db upgrade + +# setup roles and permissions +superset superset init + +# Starting server +/bin/sh -c /usr/bin/run-server.sh \ No newline at end of file diff --git a/superset/superset_config.py b/superset/superset_config.py new file mode 100644 index 0000000..737a78b --- /dev/null +++ b/superset/superset_config.py @@ -0,0 +1,9 @@ +FEATURE_FLAGS = { + "ENABLE_TEMPLATE_PROCESSING": True, +} +ENABLE_PROXY_FIX = True +SECRET_KEY = "PIT3IXGyp2PvjwY9bSCzPM9Duq6g94dnf9UUxheDGJytXjVRWrFvPvYNjfLAbxyR" +LANGUAGES = { + "en": {"flag": "us", "name": "English"}, + "es": {"flag": "es", "name": "EspaƱol"}, +}