Install releng via requirements.txt
[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=0.8.1
17 ARG TEMPEST_TAG=15.0.0
18 ARG REFSTACK_TAG=15.0.0
19 ARG ODL_TAG=release/beryllium-sr4
20 ARG OPENSTACK_TAG=stable/mitaka
21 ARG KINGBIRD_TAG=1.1.0
22 ARG VIMS_TAG=stable
23 ARG VROUTER_TAG=stable
24 ARG REPOS_DIR=/home/opnfv/repos
25 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
26 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
27 ARG FUNCTEST_DATA_DIR=${FUNCTEST_BASE_DIR}/data
28 ARG FUNCTEST_IMAGES_DIR=${FUNCTEST_BASE_DIR}/images
29 ARG FUNCTEST_RESULTS_DIR=${FUNCTEST_BASE_DIR}/results
30 ARG FUNCTEST_REPO_DIR=${REPOS_DIR}/functest
31 ARG FUNCTEST_TEST_DIR=${FUNCTEST_REPO_DIR}/functest/opnfv_tests
32 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
33
34 # Environment variables
35 ENV HOME /home/opnfv
36 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_REPO_DIR}/functest/ci/config_functest.yaml
37 ENV REPOS_DIR ${HOME}/repos
38 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
39 ENV TERM xterm
40 ENV COLORTERM gnome-terminal
41
42 WORKDIR ${HOME}
43
44 # Packaged dependencies
45 RUN apt-get update && apt-get install -y \
46 build-essential \
47 bundler \
48 crudini \
49 curl \
50 gcc \
51 git \
52 libffi-dev \
53 libgmp3-dev \
54 libpq-dev \
55 libssl-dev \
56 libxml2-dev \
57 libxslt-dev \
58 libzmq3-dev \
59 python-dev \
60 python-mock \
61 python-pip \
62 postgresql \
63 ruby1.9.1-dev \
64 ssh \
65 sshpass \
66 wget \
67 --no-install-recommends
68
69 RUN pip install --upgrade pip
70
71 RUN mkdir -p ${REPOS_DIR} \
72     && mkdir -p ${REPOS_VNFS_DIR} \
73     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
74     && mkdir -p ${FUNCTEST_CONF_DIR} \
75     && mkdir -p ${FUNCTEST_DATA_DIR} \
76     && mkdir -p ${FUNCTEST_IMAGES_DIR} \
77     && mkdir -p /root/.ssh \
78     && chmod 700 /root/.ssh
79
80 RUN git config --global http.sslVerify false
81
82 # OPNFV repositories
83 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/functest ${REPOS_DIR}/functest
84 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
85 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sdnvpn ${REPOS_DIR}/sdnvpn
86 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
87 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPOS_DIR}/parser
88 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
89 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
90 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready
91 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds ${REPOS_DIR}/fds
92 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/barometer ${REPOS_DIR}/barometer
93 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sfc ${REPOS_DIR}/sfc
94 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/snaps ${REPOS_DIR}/snaps
95 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS_DIR}/securityscanning
96 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/opera ${REPOS_DIR}/opera
97
98 # OpenStack repositories
99 RUN git clone --depth 1 -b $OPENSTACK_TAG https://github.com/openstack/networking-bgpvpn ${REPOS_DIR}/bgpvpn
100 RUN git clone --depth 1 -b $KINGBIRD_TAG https://github.com/openstack/kingbird.git ${REPOS_DIR}/kingbird
101 RUN git clone --depth 1 -b $RALLY_TAG https://github.com/openstack/rally.git ${REPOS_DIR}/rally
102 RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git ${REPOS_DIR}/tempest
103 RUN git clone https://github.com/openstack/refstack-client ${REPOS_DIR}/refstack-client
104
105 # other repositories
106 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
107 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
108 RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter
109 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
110
111 RUN pip install -r ${REPOS_DIR}/rally/requirements.txt
112 RUN pip install -r ${REPOS_DIR}/tempest/requirements.txt
113
114 RUN cd ${FUNCTEST_REPO_DIR} \
115     && pip install -r requirements.txt \
116     && pip install -e .
117
118 RUN cd ${REPOS_DIR}/barometer \
119     && pip install .
120
121 RUN pip install ${REPOS_DIR}/opera
122
123 RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
124     -not -path "*tests/unit*" \
125     -not -path "*functest_venv*" \
126     |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 \
127     && find ${FUNCTEST_REPO_DIR} -name "*.sh" \
128     -not -path "*functest_venv*" \
129     |xargs grep -L \#\! |cut -d\:  -f 1 |xargs chmod -c 644
130
131 RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
132     -not -path "*tests/unit*" \
133     -not -path "*functest_venv*" \
134     |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
135     && find ${FUNCTEST_REPO_DIR} -name "*.sh" \
136     -not -path "*functest_venv*" \
137     |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
138
139 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
140 RUN ${REPOS_DIR}/rally/install_rally.sh --yes
141
142 RUN /bin/bash ${REPOS_DIR}/functest/docker/add_images.sh
143
144 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
145 RUN curl -L https://get.rvm.io | bash -s stable
146
147 # SNAPS integration
148 RUN pip install -e ${REPOS_DIR}/snaps/
149
150 # SFC integration
151 RUN /bin/bash -c ". ${REPOS_DIR}/sfc/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
152 RUN cd ${REPOS_DIR}/sfc && pip install -e .
153
154 # SDNVPN integration
155 RUN cd ${REPOS_DIR}/sdnvpn && pip install -e .
156 RUN cd ${REPOS_DIR}/bgpvpn && pip install -e .
157
158 # Kingbird integration
159 RUN cd ${REPOS_DIR}/kingbird && pip install -e .
160 RUN cd ${FUNCTEST_REPO_DIR} && pip install -r kingbird_requirements.txt
161
162 # refstack-client integration
163 RUN cd ${REPOS_DIR}/refstack-client && ./setup_env -t ${REFSTACK_TAG}
164
165 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
166     && cd ${REPOS_VNFS_DIR}/vims-test \
167     && rvm autolibs enable"
168 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
169     && cd ${REPOS_VNFS_DIR}/vims-test \
170     && rvm install 1.9.3"
171 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
172     && cd ${REPOS_VNFS_DIR}/vims-test \
173     && rvm use 1.9.3"
174 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
175     && cd ${REPOS_VNFS_DIR}/vims-test \
176     && bundle install"
177
178 RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
179     && sudo apt-get install -y nodejs \
180     && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
181     && cd ${REPOS_DIR}/promise/source && npm install
182
183 RUN echo "set nocompatible \n\
184 set backspace=2" \
185 >> ${HOME}/.vimrc
186 RUN echo set nocompatible >> ${HOME}/.exrc
187 RUN echo "alias ll='ls -lh' \n\
188 . ${FUNCTEST_REPO_DIR}/functest/cli/functest-complete.sh" \
189 >> ${HOME}/.bashrc