Skip to content

Installation on Google Compute Engine

Paul Capestany edited this page May 20, 2015 · 17 revisions

Create GCE instance and ssh in

Follow the instructions on Running Docker on Google Compute Engine.

At this point you should be ssh'd into your GCE instance

Add firewall rules

This should be run on your workstation, and assumes you've already installed the gcloud utility as described in Running Docker on Google Compute Engine.

$ gcloud compute firewall-rules create allow-8080 --allow tcp:8080
$ gcloud compute firewall-rules create allow-5672 --allow tcp:5672

This assumes you are going to use 8080 as your HTTP_PORT in the step below when you launch the docker images.

Find your host address

On your workstation with the gcloud tool installed, run:

$ gcloud compute instances list
name     status  zone          machineType internalIP   externalIP
open-ocr RUNNING us-central1-a f1-micro    10.240.74.44 142.222.178.49

Your external ip is listed under the externalIP column, eg 142.222.178.49 in this example.

Launch docker images

SSH into your GCE instance as described in the last step of Running Docker on Google Compute Engine and run the following commands:

Make sure that you substitute RABBITMQ_HOST with the host address from the above step, and choose a sensible value for RABBITMQ_PASS

gce:~$ curl -O https://raw.githubusercontent.com/tleyden/open-ocr/master/launcher/launcher.sh
gce:~$ export RABBITMQ_HOST=142.222.178.49 RABBITMQ_PASS=supersecret2 HTTP_PORT=8080
gce:~$ chmod +x launcher.sh
gce:~$ ./launcher.sh gce

Verify that it's working

From your workstation or any other machine, run:

$ export RABBITMQ_HOST=142.222.178.49 HTTP_PORT=8080
$ curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://${RABBITMQ_HOST}:${HTTP_PORT}/ocr

and you should see the following decoded OCR text output:

You can create local variables for the pipelines within the template by
prefixing the variable name with a “$" sign. Variable names have to be
composed of alphanumeric characters and the underscore. In the example
below I have used a few variations that work for variable names.