wiki:Superset

Version 6 (modified by krit, 12 months ago) (diff)

--

Superset

  • 1. start container
    docker run -d -p 8080:8088 -e "SUPERSET_SECRET_KEY=krit_Superset" --name superset apache/superset
    
  • 2. setup local admin account
    docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
    
  • 3. migrate locad DB to latest
    docker exec -it superset superset db upgrade
    
  • 4. Load Examples
    docker exec -it superset superset load_examples
    
  • 5. Setup roles
    docker exec -it superset superset init
    

Login and take a look -- navigate to http://localhost:8080/login/ -- u/p: [admin/admin]

  • Note to access dashboard with out login just change config file app/superset/config.py.
    • 1. Uncomment #AUTH_ROLE_PUBLIC = 'Public"
    • 2. PUBLIC_ROLE_LIKE: Optional[str] = 'Gamma'
      AUTH_ROLE_PUBLIC = 'Public'
      PUBLIC_ROLE_LIKE: Optional[str] = 'Gamma'
      
    • 3. re int superset with
      docker exec -it superset superset init
      
    • 4. Then edit role on menu Public to remove access on database/dashboard/ ... etc

sqlite create table

sqlite> CREATE TABLE npk (id int primary key autoincrement, dt datetime default current_timestamp, site_id TEXT, lat REAL, lon REAL, temp REAL, ph REAL, humd REAL, ec REAL, n REAL, p REAL, k REAL, sal REAL);

insert data to table

sqlite> INSERT INTO npk ( dt, site_id, lat, lon, temp, ph, humd, ec, n, p, k, sal ) VALUES(DateTime('now', 'localtime'), "stv_1",13.84366667, 100.50775, 25, 7.0, 53.0, 0.1, 76, 82, 93, 1.4);