-
Notifications
You must be signed in to change notification settings - Fork 225
Installation on Google Compute Engine
Follow the instructions on Running Docker on Google Compute Engine.
At this point you should be ssh'd into your GCE instance
SSH into your GCE instance as described in the last step of Running Docker on Google Compute Engine
Choose a password for your RabbitMQ instance, eg, supersecret2
Now launch RabbitMQ using the password you chose:
sudo docker run -d -p 5672:5672 -p 15672:15672 -e RABBITMQ_PASS=supersecret2 tutum/rabbitmq
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 firewalls create allow-8080 --allow tcp:8080
$ gcloud compute firewalls create allow-5672 --allow tcp:5672
On your workstation with the gcloud
tool installed, run:
$ gcloud compute instances list -l
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.
You will need to know your amqp URI for the next steps. The amqp URI is made up of:
amqp://<username>:<rabbitmq_password>@<external_ip>/
So in the example of this tutorial, that would be:
amqp://admin:[email protected]/
This assumes you are still SSH'd into your GCE instance.
$ sudo docker run -d -p 8080:8080 tleyden5iwx/open-ocr open-ocr-httpd -amqp_uri "amqp://admin:[email protected]/" -http_port 8080
You must change the amqp_uri parameter to the one you created in the previous step: Launch RabbitMQ instance on CloudAMQP
To verify that it worked, run:
$ curl http://localhost:8080
and you should see "OpenOCR is running!" in the HTML returned.
This assumes you are still SSH'd into your GCE instance.
Run a worker with:
$ sudo docker run -d tleyden5iwx/open-ocr open-ocr-worker -amqp_uri "amqp://admin:[email protected]/"
Again, you must replace the amqp_uri parameter with the one you created in the previous step.
$ curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://142.222.178.49:8080/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.