Force requests===2.13.0
[functest.git] / docker / Dockerfile
1 ########################################
2 #   Docker container for FUNCTEST
3 ########################################
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9
10 FROM ubuntu:14.04
11 MAINTAINER Jose Lausuch <jose.lausuch@ericsson.com>
12 LABEL version="0.1" description="OPNFV Functest Docker container"
13
14 # Environment variables
15 ARG BRANCH=master
16 ARG RALLY_TAG=stable/0.9
17 ARG ODL_TAG=e12ba90cd27577c4c6c70ee54f7d599b5f6777ba
18 ARG OPENSTACK_TAG=stable/ocata
19 ARG VIMS_TAG=stable
20 ARG REFSTACK_TAG=4e187b07672dd1c41cb7c94658f1c91edebf53a2
21 ARG REPOS_DIR=/home/opnfv/repos
22 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
23 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
24 ARG FUNCTEST_DATA_DIR=${FUNCTEST_BASE_DIR}/data
25 ARG FUNCTEST_IMAGES_DIR=${FUNCTEST_BASE_DIR}/images
26 ARG FUNCTEST_RESULTS_DIR=${FUNCTEST_BASE_DIR}/results
27 ARG FUNCTEST_DIR=/usr/local/lib/python2.7/dist-packages/functest/
28 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
29
30 # Environment variables
31 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_DIR}/ci/config_functest.yaml
32 ENV REPOS_DIR ${REPOS_DIR}
33 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
34
35 # Packaged dependencies
36 RUN apt-get update && apt-get install -y \
37 build-essential \
38 bundler \
39 crudini \
40 curl \
41 dnsmasq \
42 gcc \
43 git \
44 libffi-dev \
45 libgmp3-dev \
46 libpq-dev \
47 libssl-dev \
48 libxml2-dev \
49 libxslt-dev \
50 libzmq3-dev \
51 python-dev \
52 python-mock \
53 python-pip \
54 python3 \
55 python3-dev \
56 python3-pip \
57 postgresql \
58 ruby \
59 ruby-dev \
60 ruby-bundler \
61 ssh \
62 sshpass \
63 wget \
64 --no-install-recommends
65
66 RUN pip install --upgrade pip && easy_install -U setuptools==30.0.0
67 RUN python3 -m pip install --upgrade pip setuptools==30.0.0
68
69 RUN mkdir -p ${REPOS_VNFS_DIR} \
70     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
71     && mkdir -p ${FUNCTEST_CONF_DIR} \
72     && mkdir -p ${FUNCTEST_DATA_DIR} \
73     && mkdir -p ${FUNCTEST_IMAGES_DIR} \
74     && mkdir -p /root/.ssh \
75     && chmod 700 /root/.ssh
76
77 RUN git config --global http.sslVerify false
78
79 COPY thirdparty-requirements.txt thirdparty-requirements.txt
80 RUN wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
81         sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ | \
82         sed s/^requests===.*$/requests===2.13.0/ \
83         > upper-constraints.txt && \
84     pip install --src /src -cupper-constraints.txt \
85         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
86         -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
87     git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
88     update-requirements -s --source /src/openstack-requirements /src/rally && \
89     git clone --depth 1 https://github.com/openstack/refstack-client.git /src/refstack-client && \
90     (cd src/refstack-client && git checkout -b $REFSTACK_TAG) && \
91     update-requirements -s --source /src/openstack-requirements /src/refstack-client && \
92     pip install --src /src -cupper-constraints.txt \
93         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
94         /src/rally -e/src/refstack-client && \
95     pip install --src /src -cupper-constraints.txt \
96         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
97         git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
98         -rthirdparty-requirements.txt && \
99     python3 -m pip install --src /src \
100         -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
101         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
102         doctor-tests && \
103     mkdir -p /etc/rally && \
104     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
105     mkdir -p /var/lib/rally/database && rally-manage db create && \
106     rm thirdparty-requirements.txt upper-constraints.txt
107
108 # OPNFV repositories
109 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds /src/fds
110
111 # other repositories
112 RUN git clone --depth 1 https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
113         (cd src/odl_test && git checkout -b $ODL_TAG)
114 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test /src/vims-test
115
116 # Install tempest venv and create symlink for running refstack-client
117 RUN ln -s /src/tempest /src/refstack-client/.tempest \
118     && virtualenv --system-site-packages /src/tempest/.venv --python=python2
119
120 RUN cd /src/vims-test && bundle install
121
122 RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
123     && sudo apt-get install -y nodejs \
124     && cd /src/promise && sudo npm -g install npm@latest \
125     && cd /src/promise/source && npm install
126
127 RUN echo ". ${FUNCTEST_DIR}/cli/functest-complete.sh" >> /root/.bashrc
128
129 CMD ["functest_restapi"]