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

Commit

Permalink
fix logic in redis error checking; updates to use newer python base i…
Browse files Browse the repository at this point in the history
…mage (#22)
  • Loading branch information
amygdala authored Dec 21, 2017
1 parent f6400e5 commit 1081872
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Then, set the Twitter authentication information to the values you noted when se

Edit `bigquery-controller.yaml`. Set your `PUBSUB_TOPIC`, and set your `PROJECT_ID`, `BQ_DATASET`, and `BQ_TABLE` information.

(If you optionally built your own docker image as described in the Appendix, also replace the image string `gcr.io/google-samples/pubsub-bq-pipe:v4` with the name of the container image that you have built and pushed.)
(If you optionally built your own docker image as described in the Appendix, also replace the image string `gcr.io/google-samples/pubsub-bq-pipe:v5` with the name of the container image that you have built and pushed.)

### Deploy your app

Expand Down Expand Up @@ -410,7 +410,7 @@ If you don't see evidence that your container has ever started sucessfully, doub
This step is optional.

The example app uses a [Docker](https://www.docker.com/) image that runs the app's python scripts.
If you like, you can just use the prebuilt docker image, `gcr.io/google-samples/pubsub-bq-pipe:v4`, for your app. This is the image used by default in the `bigquery-controller.yaml` and `twitter-stream.yaml` files.
If you like, you can just use the prebuilt docker image, `gcr.io/google-samples/pubsub-bq-pipe:v5`, for your app. This is the image used by default in the `bigquery-controller.yaml` and `twitter-stream.yaml` files.

Follow the instructions below if you'd like to add customization and use your own image instead.
For this, you'll either need [Docker](https://docs.docker.com/installation/#installation) installed locally, or you can run Docker in the Cloud Shell. (You could also alternately use [Google Cloud Container Builder](https://cloud.google.com/container-builder/docs/).)
Expand Down
2 changes: 1 addition & 1 deletion pubsub/bigquery-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: bigquery
image: gcr.io/google-samples/pubsub-bq-pipe:v4
image: gcr.io/google-samples/pubsub-bq-pipe:v5
env:
- name: PROCESSINGSCRIPT
value: pubsub-to-bigquery
Expand Down
2 changes: 1 addition & 1 deletion pubsub/pubsub-pipe-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM google/python
FROM python:2

RUN pip install --upgrade pip
RUN pip install tweepy
Expand Down
2 changes: 1 addition & 1 deletion pubsub/twitter-stream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: twitter-to-pubsub
image: gcr.io/google-samples/pubsub-bq-pipe:v4
image: gcr.io/google-samples/pubsub-bq-pipe:v5
env:
- name: PROCESSINGSCRIPT
value: twitter-to-pubsub
Expand Down
6 changes: 3 additions & 3 deletions redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Set the Twitter authentication information to the values you noted when setting
Edit `bigquery-controller.yaml`. Set your `PROJECT_ID`, `BQ_DATASET`, and `BQ_TABLE` information.

(If you optionally built your own docker image as described in the Appendix, also replace the image string
`gcr.io/google-samples/redis-bq-pipe:v4` with the name of the container image that you have built and pushed.)
`gcr.io/google-samples/redis-bq-pipe:v5` with the name of the container image that you have built and pushed.)

### Deploy your app

Expand Down Expand Up @@ -424,7 +424,7 @@ If you don't see evidence that your container has ever started sucessfully, doub
This step is optional.

The example app uses a [Docker](https://www.docker.com/) image that runs the app's python scripts.
If you like, you can just use the prebuilt docker image, `gcr.io/google-samples/redis-bq-pipe:v4`, for your app. This is the image used by default in the `bigquery-controller.yaml` and `twitter-stream.yaml` files.
If you like, you can just use the prebuilt docker image, `gcr.io/google-samples/redis-bq-pipe:v5`, for your app. This is the image used by default in the `bigquery-controller.yaml` and `twitter-stream.yaml` files.

Follow the instructions below if you'd like to add customization and use your own image instead.
For this, you'll either need [Docker](https://docs.docker.com/installation/#installation) installed locally, or you can run Docker in the Cloud Shell. (You could also alternately use [Google Cloud Container Builder](https://cloud.google.com/container-builder/docs/).)
Expand All @@ -451,7 +451,7 @@ gcloud docker -- push gcr.io/<your-project-name>/redis-bq-pipe:v1
```

Finally, edit `twitter-stream.yaml` and `bigquery-controller.yaml`, and
replace `gcr.io/google-samples/redis-bq-pipe:v4` with the name of your image.
replace `gcr.io/google-samples/redis-bq-pipe:v5` with the name of your image.



Expand Down
2 changes: 1 addition & 1 deletion redis/bigquery-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: bigquery
image: gcr.io/google-samples/redis-bq-pipe:v4
image: gcr.io/google-samples/redis-bq-pipe:v5
env:
- name: PROCESSINGSCRIPT
value: redis-to-bigquery
Expand Down
2 changes: 1 addition & 1 deletion redis/redis-pipe-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM google/python
FROM python:2

RUN pip install --upgrade pip
RUN pip install tweepy
Expand Down
3 changes: 2 additions & 1 deletion redis/redis-pipe-image/redis-to-bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def write_to_bq(bigquery):
tweet = json.loads(res[1])
except Exception, e:
print e
redis_errors += 1
if redis_errors > allowed_redis_errors:
print "Too many redis errors: exiting."
print "Too many redis-related errors: exiting."
return
continue
# First do some massaging of the raw data
Expand Down
2 changes: 1 addition & 1 deletion redis/twitter-stream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: twitter-to-redis
image: gcr.io/google-samples/redis-bq-pipe:v4
image: gcr.io/google-samples/redis-bq-pipe:v5
env:
- name: PROCESSINGSCRIPT
value: twitter-to-redis
Expand Down

0 comments on commit 1081872

Please sign in to comment.