Apache SuperSet: Working Fast Installation

Apache Superset in a Docker configuration can be a dogs breakfast to try to configure in a production enviroment. This actually works fast.

Apache SuperSet: Working Fast Installation

Apache Superset in a Docker configuration can be a dogs breakfast to try to configure in a production enviroment.   I found that docker was holding previous settings. Completely wiping all images was not fixing it! Somehow the next installation was still holding the sour settings which was creating database connection errors.  The guides were not very explicit.  It required more and more aggressive cleaning until docker itself was being completley wiped.  Finally it worked after about the 20th try.  This will work in a debian-based environment.  

  • Working docker superset walkthoughs are almost non-existent this is the only one I could find.
  • It will also require a subdirectory with mysql with a docker-compose.yml as in:
  • You must set 4 things (whever a password / port  /host is needed - see below)
  • You may need to set your root sql permissions as in:
mysql -u root -p -h <host>
mysql> CREATE USER 'root'@'%' IDENTIFIED BY '<password>';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '<password>'; 
version: '2.1'

services:
  mysql:
    image: mysql:8.0
    restart: always
    ports:
      - 3306:3306
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: '<mysqlpassword>'

<This script> (aka build.sh) will do a clean fast build and also install a mysql on the side.  To accomplish this note it completely wipes and reinstalls docker itself!

export COLOR_BLUE='+++++'
export COLOR_NC=''
export COLOR_RED=''

echo "${COLOR_BLUE}     Executing :: ${COLOR_RED} rebuilding mysql\n"
cd mysql

echo "${COLOR_BLUE}     Executing :: ${COLOR_RED} docker-compose -f docker-compose.yml -p mysql up -d\n"
docker-compose -f docker-compose.yml up -d
cd ..

echo "${COLOR_BLUE}     Executing :: ${COLOR_RED} docker inspect mysql ${COLOR_NC}\n"
docker inspect mysql

echo "${COLOR_BLUE}     Executing :: ${COLOR_RED}git clone https://github.com/apache/superset.git.. ${COLOR_NC}\n"
git clone https://github.com/apache/superset.git

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export DATABASE_DIALECT=mysql${COLOR_NC}\n" 
export DATABASE_DIALECT=mysql

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export DATABASE_USER=root${COLOR_NC}\n"
export DATABASE_USER=root

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export DATABASE_PASSWORD=...${COLOR_NC}\n"
export DATABASE_PASSWORD=<SET PASSWORD>

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export DATABASE_HOST=<set host>.. ${COLOR_NC}\n"
export DATABASE_HOST=<SET HOST>

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export DATABASE_PORT=3306.. ${COLOR_NC}\n"
export DATABASE_PORT=3306

echo "${COLOR_BLUE}    Set export :: ${COLOR_RED}export SUPERSET_SECRET_KEY.. ${COLOR_NC}\n"
export SUPERSET_SECRET_KEY='{some random secret key}'

cd superset
echo "${COLOR_BLUE}docker-compose :: ${COLOR_RED} docker-compose -f docker-compose-non-dev.yml up -d ${COLOR_NC}\n"
docker-compose -f docker-compose-non-dev.yml up -d


After this it successfully was able to finally connect to a database as in:

Then select your database connection (socket)  type:

Once this is working you will be able to build your datasets...

Linux Rocks Every Day