Code Monkey home page Code Monkey logo

paradime-dbt's Introduction

  1. Create a new gcp account and activate 90 days trial

    [email protected]
    boxwood-academy-373200
    
  2. Switch default project to the newly created one

    gcloud auth login
    gcloud config configurations list
    gcloud config set project boxwood-academy-373200
    
  3. Create 2 buckets

    # boxwood-academy-inbound
    # boxwood-academy-archive
    # boxwood-academy-source
    
    gsutil mb gs://boxwood-academy-inbound
    gsutil mb gs://boxwood-academy-archive
    gsutil mb gs://boxwood-academy-source
    
  4. Create BQ dataset for raw data

    bq mk raw
    
  5. Create new dbt profile Add new profile (create new)

    vi ~/.dbt/profiles.yml
    
     paradime:
         outputs:
             dev:
             dataset: dev
             fixed_retries: 1
             location: US
             method: service-account
             keyfile: /Users/vasilii.surov/vscode/paradime-dbt/docker/dbt-paradime.json
             priority: interactive
             project: boxwood-academy-373200
             threads: 5
             timeout_seconds: 300
             type: bigquery
    
             prod:
             dataset: prod
             fixed_retries: 1
             location: US
             method: service-account
             keyfile: /Users/vasilii.surov/vscode/paradime-dbt/docker/dbt-paradime.json
             priority: interactive
             project: boxwood-academy-373200
             threads: 5
             timeout_seconds: 300
             type: bigquery
    
     target: dev
    
  6. Create and authenticate new dbt project

    dbt init --adapter bigquery paradime
    gcloud auth application-default login --scopes=https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/drive.readonly
    
  7. Check out dbt configuration

    dbt debug
    
  8. Initialize git

    git init
    
  9. dbt-utils package

    dbt deps
    
  10. Download all csv data locally

    /home/sova/.venv/dbt/bin/python3 /home/sova/IdeaProjects/dbt/sunrun/scripts/download.py
    
  11. Recompressing with gzip

    unzip \*.zip
    gzip *.csv
    
  12. Upload all files to source bucket

    gsutil -m cp *.csv.gz gs://boxwood-academy-source/citibike/
    
  13. Load test volume of data into inbound bucket

    gsutil -m cp gs://boxwood-academy-source/citibike//2018*.gz gs://boxwood-academy-inbound/citibike/
    
  14. Load files from gcs into BQ

    ./scripts/bq_load.sh
    
  15. Build dbt models: chains start [end == start] [end == start] .. end

  16. Composer jobs dbt_compile.py

  17. Models: see dbt docs

    dbt docs generate
    dbt docs serve
    

paradime-dbt's People

Contributors

vasiliisurov avatar zendesk-sova avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.