Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

README.md

Outline

Cloud Run Image Processing Sample

This sample service applies Cloud Storage-triggered image processing with Cloud Vision API analysis and ImageMagick transformation.

Use it with the Image Processing with Cloud Run tutorial.

Run in Google Cloud

Build

docker build --tag pubsub-tutorial:python .

Run Locally

docker run --rm -p 9090:8080 -e PORT=8080 pubsub-tutorial:python

Test

pytest

Note: you may need to install pytest using pip install pytest.

Deploy

# Set an environment variable with your GCP Project ID
export GOOGLE_CLOUD_PROJECT=<PROJECT_ID>

# Submit a build using Google Cloud Build
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/pubsub-tutorial

# Deploy to Cloud Run
gcloud beta run deploy pubsub-tutorial --image gcr.io/${GOOGLE_CLOUD_PROJECT}/pubsub-tutorial --set-env-vars=BLURRED_BUCKET_NAME=<BLURRED_BUCKET_NAME>

Environment Variables

Cloud Run services can be configured with Environment Variables. Required variables for this sample include:

  • INPUT_BUCKET_NAME: The Cloud Run service will be notified of images uploaded to this Cloud Storage bucket. The service will then retreive and process the image.
  • BLURRED_BUCKET_NAME: The Cloud Run service will write blurred images to this Cloud Storage bucket.

Maintenance Note

Morty Proxy This is a proxified and sanitized view of the page, visit original site.