Before you can run or deploy the sample, you will need to do the following:
-
Enable the Cloud Pub/Sub API in the Google Developers Console.
-
Create a topic and subscription.
$ gcloud pubsub topics create topic_tfrecord $ gcloud pubsub subscriptions create sub_tfrecord \ --topic topic_tfrecord \ --push-endpoint \ https://[your-app-id].appspot.com/pubsub/push?token=[your-token] \ --ack-deadline 30
-
Update the environment variables in
app.yaml
.
Install dependencies, preferably with a virtualenv:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
Then set environment variables before starting your application:
export GOOGLE_APPLICATION_CREDENTIALS=[path-to-json-cred]
export PUBSUB_VERIFICATION_TOKEN=[your-verification-token]
export PUBSUB_TOPIC=[your-topic]
export BUCKET_NAME=[your-bucket]
export PROJECT_ID=[your-project-id]
python main.py
Assuming you have Frame entities in Datastore with imageUrl property pointing to their storage (on GCS ?)
export PUBSUB_VERIFICATION_TOKEN=[your-verification-token]
python test/call.py
gcloud app deploy