diff --git a/luigi_metabase/README.md b/luigi_metabase/README.md index 8b5eb9d..625135c 100644 --- a/luigi_metabase/README.md +++ b/luigi_metabase/README.md @@ -30,10 +30,30 @@ git clone https://github.com/alibabacloud-howto/opensource_with_apsaradb.git cd opensource_with_apsaradb/luigi_metabase/ ``` +``` +cd ~/opensource_with_apsaradb/luigi_metabase/metabase +wget https://downloads.metabase.com/v0.40.3.1/metabase.jar +java -jar metabase.jar +``` + +Admin User: admin@somebusiness.com +Password: N1cetest +Business Owner user: owner@somebusiness.com +Password: N1cetest + + Execute the command to start luigi daemon. Once it is up and running, navigate to ``http://:8082/`` ``` luigid ``` +``` +cd ~/adbpg_client_package/bin +./psql -hpgm-3nsa364dun8rza5k168190.pg.rds.aliyuncs.com -p1921 -Udemo sales_dw +select tablename from pg_tables where schemaname='public'; +``` + + + This tutorial is modified based on [https://github.com/abhishekzambre/data-warehouse](https://github.com/abhishekzambre/data-warehouse) to running on Alibaba Cloud. \ No newline at end of file diff --git a/luigi_metabase/data_pipeline.py b/luigi_metabase/data_pipeline.py index 5a4daaf..0ba34af 100644 --- a/luigi_metabase/data_pipeline.py +++ b/luigi_metabase/data_pipeline.py @@ -22,8 +22,8 @@ class Config(luigi.Config): host = 'localhost' port = '1921' database = 'sales_dw' - user = 'abhishekzambre' - password = 'sky' + user = 'demo' + password = 'N1cetest' customer_info_table = 'customer_info' invoice_table = 'invoice' diff --git a/luigi_metabase/deployment/terraform/main.tf b/luigi_metabase/deployment/terraform/main.tf index 1b18b11..fe1a4c1 100644 --- a/luigi_metabase/deployment/terraform/main.tf +++ b/luigi_metabase/deployment/terraform/main.tf @@ -115,7 +115,7 @@ resource "alicloud_vswitch" "vswitch_1" { resource "alicloud_instance" "instance" { security_groups = alicloud_security_group.group.*.id - instance_type = "ecs.c5.large" # 2core 4GB + instance_type = "ecs.c5.xlarge" # 4core 8GB system_disk_category = "cloud_ssd" system_disk_name = "luigi_metabase_system_disk" system_disk_size = 40 diff --git a/luigi_metabase/sales_dw_ddl.sql b/luigi_metabase/sales_dw_ddl.sql new file mode 100644 index 0000000..cb30b83 --- /dev/null +++ b/luigi_metabase/sales_dw_ddl.sql @@ -0,0 +1,67 @@ +DROP TABLE IF EXISTS association_rules; +DROP TABLE IF EXISTS product_info; +DROP TABLE IF EXISTS invoice; +DROP TABLE IF EXISTS customer_info; +DROP TABLE IF EXISTS invoice_time; +DROP TABLE IF EXISTS invoice_outliers; + + +-- Table: Association Rules +CREATE TABLE association_rules ( + consequent_support Float, + leverage Float, + antecedent_support Float, + conviction Float, + lift Float, + antecedants Text, + confidence Float, + support Float, + consequents Text +); + + +-- Table: Product Info +CREATE TABLE product_info ( + description Text, + unit_price Float, + stock_code Text +); + +-- Table: Invoice +CREATE TABLE invoice ( + invoice_no Text, + quantity Integer, + invoice_date Text, + customer_id Integer, + stock_code Text +); + +-- Table: Customer Info +CREATE TABLE customer_info ( + customer_id Integer, + country Text, + country_code Text +); + +-- Table: Invoice Time +CREATE TABLE invoice_time ( + minute Integer, + year Integer, + month Text, + hour Integer, + dayofyear Integer, + weekofyear Integer, + dayofweek Integer, + day Integer, + quarter Integer, + invoice_date Text +); + +-- Table: Invoice Outliers +CREATE TABLE invoice_outliers ( + invoice_no Text, + quantity Integer, + invoice_date Text, + customer_id Integer, + stock_code Text +); \ No newline at end of file