Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Update/overhaul of these 2 examples, including switching to use GKE (#21
Browse files Browse the repository at this point in the history
)

* use GKE (rather than kubernetes)
* big readme updates for both examples
* update gcr image versions
* change redis-master to be a deployment, api updates
* updated top-level readme
  • Loading branch information
amygdala authored Dec 5, 2017
1 parent dcd81bc commit f6400e5
Show file tree
Hide file tree
Showing 10 changed files with 720 additions and 262 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

Copyright (C) 2014 Google Inc.

# Example apps: Real-time data analysis using Kubernetes, Redis or PubSub, and BigQuery
# Example apps: Real-time data analysis using Google Kubernetes Engine, Redis or PubSub, and BigQuery

This repository contains two related example [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes) apps that show how to build a 'pipeline' to stream data into BigQuery.
This repository contains two related example [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/)
(GKE) apps that show how to build a 'pipeline' to stream data into BigQuery.

The first app, in the `redis` subdirectory, uses [Redis](http://redis.io/).
Documentation for this example can be found on the Google Cloud Platform site:
https://cloud.google.com/solutions/real-time-analysis/kubernetes-redis-bigquery

The second app, in the `pubsub` directory, uses [Google Cloud PubSub](https://cloud.google.com/pubsub/docs) instead of Redis. Documentation for this example can be found on the Google Cloud Platform site:
https://cloud.google.com/solutions/real-time/kubernetes-pubsub-bigquery
The app in the `pubsub` directory uses [Google Cloud PubSub](https://cloud.google.com/pubsub/docs).
<!-- Documentation for this example can be found on the Google Cloud Platform site:
https://cloud.google.com/solutions/real-time/kubernetes-pubsub-bigquery -->

The app in the `redis` subdirectory uses [Redis](http://redis.io/).
<!-- Documentation for this example can be found on the Google Cloud Platform site:
https://cloud.google.com/solutions/real-time-analysis/kubernetes-redis-bigquery -->
471 changes: 234 additions & 237 deletions pubsub/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pubsub/bigquery-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: bigquery-controller
Expand All @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: bigquery
image: gcr.io/google-samples/pubsub-bq-pipe:v3
image: gcr.io/google-samples/pubsub-bq-pipe:v4
env:
- name: PROCESSINGSCRIPT
value: pubsub-to-bigquery
Expand Down
4 changes: 3 additions & 1 deletion pubsub/pubsub-pipe-image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def cleanup(data):
# TODO: update BigQuery schema
elif (k == 'video_info' or k == 'scopes' or k == 'withheld_in_countries'
or k == 'is_quote_status' or 'source_user_id' in k
or 'quoted_status' in k or 'display_text_range' in k or 'extended_tweet' in k):
or k == ''
or 'quoted_status' in k or 'display_text_range' in k or 'extended_tweet' in k
or 'media' in k):
pass
elif v is False:
newdict[k] = v
Expand Down
4 changes: 2 additions & 2 deletions pubsub/twitter-stream.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: twitter-stream
Expand All @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: twitter-to-pubsub
image: gcr.io/google-samples/pubsub-bq-pipe:v3
image: gcr.io/google-samples/pubsub-bq-pipe:v4
env:
- name: PROCESSINGSCRIPT
value: twitter-to-pubsub
Expand Down
466 changes: 460 additions & 6 deletions redis/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions redis/bigquery-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: bigquery-controller
Expand All @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: bigquery
image: gcr.io/google-samples/redis-bq-pipe:v3
image: gcr.io/google-samples/redis-bq-pipe:v4
env:
- name: PROCESSINGSCRIPT
value: redis-to-bigquery
Expand Down
4 changes: 2 additions & 2 deletions redis/redis-master.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
kind: ReplicationController
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: redis-master
labels:
Expand Down
4 changes: 3 additions & 1 deletion redis/redis-pipe-image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def cleanup(data):
# TODO: update BigQuery schema
elif (k == 'video_info' or k == 'scopes' or k == 'withheld_in_countries'
or k == 'is_quote_status' or 'source_user_id' in k
or 'quoted_status' in k or 'display_text_range' in k or 'extended_tweet' in k):
or k == ''
or 'quoted_status' in k or 'display_text_range' in k or 'extended_tweet' in k
or 'media' in k):
pass
elif v is False:
newdict[k] = v
Expand Down
4 changes: 2 additions & 2 deletions redis/twitter-stream.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: twitter-stream
Expand All @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: twitter-to-redis
image: gcr.io/google-samples/redis-bq-pipe:v3
image: gcr.io/google-samples/redis-bq-pipe:v4
env:
- name: PROCESSINGSCRIPT
value: twitter-to-redis
Expand Down

0 comments on commit f6400e5

Please sign in to comment.