Installation¶
You can use the pip utility to install this package. One way of doing that is by pointing pip directly to the directory containing the setup.py file such as:
pip install .
Alternatively, one can use the public repository of this project for installation by pip such as:
pip install git@github.com:crim-ca/ServiceGateway.git
This will install the Service Gateway along with program entry points for various utilities.
A good practise might be to make use of a virtual environment in which all the dependencies will be installed through pip.
Requirements¶
This package was developed on/for Linux CentOS version 6.6 though it should work with most recent Linux distributions.
The main interface uses Python version 2.7 .
Docker Builds¶
This interface has been containerized and you can also create your own images by using the following Dockerfile contents:
Note
The following Dockerfile implies that you have a copy of the source code and that you are executing the docker build command from the top level of the package structure.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | FROM centos:7
# Ensure appropriates locales are generated
RUN sed -ie 's/^override_install_langs.*/override_install_langs=fr_CA.utf8,en_CA.utf8/' /etc/yum.conf
# Install required libraries -------------------------------
RUN yum install -y \
python2-devel \
gcc \
wget \
tar
RUN wget https://bootstrap.pypa.io/get-pip.py && \
python ./get-pip.py
# Install external dependencies -------------------
RUN pip install python-swiftclient \
python-keystoneclient \
gunicorn \
nose
# Set environment encoding for STDOUT ------------
RUN yum -y -q reinstall glibc-common # We need to do this to reactivate the locale defs.
ENV LC_ALL en_CA.utf8
# Application -------------------------------------
COPY . /var/local/src/ServiceGateway
RUN pip install /var/local/src/ServiceGateway
EXPOSE 5000
RUN nosetests -v ServiceGateway
ENTRYPOINT ["gunicorn", "ServiceGateway.rest_api:APP"]
CMD ["-w", "4", "-preload", "-b", "0.0.0.0:5000", "--log-config=/var/local/src/ServiceGateway/ServiceGateway/logging.ini"]
|