Get rid of install_rally.sh
[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 ODL_TAG=release/beryllium-sr4
18 ARG KINGBIRD_TAG=1.1.0
19 ARG VIMS_TAG=stable
20 ARG VROUTER_TAG=stable
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 HOME /home/opnfv
32 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_DIR}/ci/config_functest.yaml
33 ENV REPOS_DIR ${HOME}/repos
34 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
35
36 WORKDIR ${HOME}
37
38 # Packaged dependencies
39 RUN apt-get update && apt-get install -y \
40 build-essential \
41 bundler \
42 crudini \
43 curl \
44 gcc \
45 git \
46 libffi-dev \
47 libgmp3-dev \
48 libpq-dev \
49 libssl-dev \
50 libxml2-dev \
51 libxslt-dev \
52 libzmq3-dev \
53 python-dev \
54 python-mock \
55 python-pip \
56 postgresql \
57 ruby1.9.1-dev \
58 ssh \
59 sshpass \
60 wget \
61 --no-install-recommends
62
63 RUN pip install --upgrade pip && easy_install -U setuptools==30.0.0
64
65 RUN mkdir -p ${REPOS_VNFS_DIR} \
66     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
67     && mkdir -p ${FUNCTEST_CONF_DIR} \
68     && mkdir -p ${FUNCTEST_DATA_DIR} \
69     && mkdir -p ${FUNCTEST_IMAGES_DIR} \
70     && mkdir -p /root/.ssh \
71     && chmod 700 /root/.ssh
72
73 RUN git config --global http.sslVerify false
74
75 COPY thirdparty-requirements.txt thirdparty-requirements.txt
76 RUN wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata | \
77         sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
78         > upper-constraints.txt && \
79     pip install --src /src -cupper-constraints.txt \
80         git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
81         git+https://gerrit.opnfv.org/gerrit/releng@$BRANCH#egg=opnfv\&subdirectory=modules \
82         git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps \
83         -r thirdparty-requirements.txt && \
84     mkdir -p /etc/rally && \
85     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
86     mkdir -p /var/lib/rally/database && rally-manage db create && \
87     rm thirdparty-requirements.txt upper-constraints.txt
88
89 # OPNFV repositories
90 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
91 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
92 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
93 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
94 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready
95 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds ${REPOS_DIR}/fds
96
97 # other repositories
98 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
99 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
100 RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter
101 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
102
103 RUN add_images.sh
104
105 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
106 RUN curl -L https://get.rvm.io | bash -s stable
107
108 # SFC integration
109 RUN /bin/bash -c ". /usr/local/lib/python2.7/dist-packages/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
110
111 # Install tempest venv and create symlink for running refstack-client
112 RUN ln -s /src/tempest /src/refstack-client/.tempest \
113     && virtualenv --system-site-packages /src/tempest/.venv
114
115 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
116     && cd ${REPOS_VNFS_DIR}/vims-test \
117     && rvm autolibs enable"
118 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
119     && cd ${REPOS_VNFS_DIR}/vims-test \
120     && rvm install 1.9.3"
121 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
122     && cd ${REPOS_VNFS_DIR}/vims-test \
123     && rvm use 1.9.3"
124 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
125     && cd ${REPOS_VNFS_DIR}/vims-test \
126     && bundle install"
127
128 RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
129     && sudo apt-get install -y nodejs \
130     && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
131     && cd ${REPOS_DIR}/promise/source && npm install
132
133 RUN echo ". ${FUNCTEST_DIR}/cli/functest-complete.sh" >> ${HOME}/.bashrc