CloudCats is an example of using node.js and various Google Cloud APIs and services to solve the greatest question of our time: do developers prefer dogs or cats.
This is an adaptation of the awwvision, which uses Kubernetes to do something similar. Credit to Thea Flowers for the idea.
Cloud Cats queries for a list of images from the front page of r/aww. Each of those images is saved into Google Cloud Storage, and then analyzed using the Google Cloud Vision API.
Cloud Cats uses a few Google Cloud APIs and Services.
- Users visit the front application, which is running in an App Engine module.
- When you're ready to do a run, the {+} will call an endpoint on the [worker][/worker] module.
- The worker will invoke the Reddit JSON API to get a list of images from r/aww.
- Images are saved to Google Cloud Storage.
- The Cloud Vision API analyzes the image, and tags it as dog or cat or other.
- The result is placed in a Google Cloud Pub/Sub topic.
- The front end App Engine Module subscribes to results from the topic.
- Results are streamed to the user using PubNub.
This code is built as a demo for running Node.js on Google Cloud, but you can run it anywhere that node.js works.
- Create a project in the Google Cloud Platform Console.
- Enable billing for your project.
- Enable Storage, PubSub, and Cloud Vision APIs in the API Manager.
- Install the Google Cloud SDK.
- Deploy with
gcloud preview app deploy web/app.yaml worker/app.yaml --project <YOUR PROJECT>
Feel free to submit an issue on the repository, or find me at @JustinBeckwith