Giter Site home page Giter Site logo

tanduong / airflow-gcp-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexvanboxel/airflow-gcp-examples

0.0 1.0 0.0 193 KB

Repository with examples and smoke tests for the GCP Airflow operators and hooks

License: Apache License 2.0

Python 100.00%

airflow-gcp-examples's Introduction

airflow-gcp-examples

Repository with examples and smoke tests for the GCP Airflow operators and hooks.

Setup

This Google Cloud Examples does assume you will have a standard Airflow setup up and running. This tutorial does work perfectly locally as in a production setup because the only requirement is that you have a service key, that we'll explain next. But first a quick rundown of what you need:

  • Running Airflow (as of this writing you need Airflow master branch!!!)
  • Create a service account (Cloud Console)
  • Setup a Google Cloud Connection in Airflow
  • Setup variables that the DAG's will need
  • Copy the DAG's to your dags folder

Airflow setup

  • Checkout master of Airflow
  • pip install google-api-python-client
  • python setup.py install

Make sure you're running the LocalExecutor and have a decent database setup.

Google Cloud Service Key

Next create a service account where you want your smoke tests and examples to run in. Go to the console:

console

And create a service key. Provision a JSON private key and give it Editor's rights

console

Airflow Connection

In Airflow you need to define the gcp_smoke named connection to your project:

console

Supply the path to the downloaded private key, supply the project_id and define the minimum scope of https://www.googleapis.com/auth/cloud-platform

Airflow Variables

You need to setup variables that are used in the examples. You can tweak them to suite your environment.

console

variable example value note
gc_project my-project Project where the examples will run in
gcq_dataset airflow BigQuery dataset for examples
gcq_tempset airflow_temp BiqQuery dataset with 1 day retentions
gcs_bucket airflow-gcp-smoke Storage bucket
gcs_root data Storage root path (required, no start and end with slash)

airflow-gcp-examples's People

Watchers

 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.