Skip to content

Opencv on Openshift

When I wanted to intall opencv on my python-2.7 openshift online cartridge I faced the problem of quota limitation to 1GB.

A blog post by Stephen Nneji discussed using a DIY cartridge to install Python and OpenCV manually. Another blog post by Nikhil Kumar used the Python-2.7 cartridge template to reduce the compiled size.

The complete steps were collected into a single bash script.

To run this script in your openshift Python-2.7 cartridge, run the following command:

$ wget https://raw.githubusercontent.com/ammarnajjar/opencv_on_openshift_online/master/install.sh && bash install.sh

Then test importing opencv:

> python
Python 2.7.11 (default, Mar 31 2016, 20:46:51) 
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>

Deploying OpenCV workloads taught me as much about containers as about image processing. If you have run OpenCV in the cloud, how did you handle the environment setup, and did the result justify the effort compared to running locally?