Merge "Prepare env will exit when an error is raised"
[functest.git] / docker / Dockerfile.aarch64
1 ########################################
2 #  Aarch64 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 aarch64/ubuntu:14.04
11 MAINTAINER Armband team <armband@enea.com>
12 LABEL version="0.1" description="OPNFV Functest Aarch64 Docker container"
13
14 # Environment variables
15 ARG BRANCH=master
16 ARG RALLY_TAG=0.8.1
17 ARG TEMPEST_TAG=14.0.0
18 ARG ODL_TAG=release/beryllium-sr4
19 ARG OPENSTACK_TAG=stable/mitaka
20 ARG KINGBIRD_TAG=0.2.2
21 ARG VIMS_TAG=stable
22 ARG REPOS_DIR=/home/opnfv/repos
23 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
24 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
25 ARG FUNCTEST_DATA_DIR=${FUNCTEST_BASE_DIR}/data
26 ARG FUNCTEST_RESULTS_DIR=${FUNCTEST_BASE_DIR}/results
27 ARG FUNCTEST_REPO_DIR=${REPOS_DIR}/functest
28 ARG FUNCTEST_TEST_DIR=${FUNCTEST_REPO_DIR}/functest/opnfv_tests
29 ARG RELENG_MODULE_DIR=${REPOS_DIR}/releng/modules
30 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
31
32 # Environment variables
33 ENV HOME /home/opnfv
34 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_REPO_DIR}/functest/ci/config_functest.yaml
35 ENV REPOS_DIR ${HOME}/repos
36 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
37 ENV TERM xterm
38 ENV COLORTERM gnome-terminal
39
40 WORKDIR ${HOME}
41
42 # Packaged dependencies
43 RUN apt-get update && apt-get install -y \
44 build-essential \
45 bundler \
46 crudini \
47 curl \
48 gcc \
49 git \
50 libffi-dev \
51 libgmp3-dev \
52 libjpeg-dev \
53 libpq-dev \
54 libssl-dev \
55 libxml2-dev \
56 libxslt-dev \
57 python-dev \
58 python-mock \
59 python-pip \
60 postgresql \
61 ruby1.9.1-dev \
62 ssh \
63 sshpass \
64 wget \
65 --no-install-recommends
66
67 RUN pip install --upgrade pip
68
69 RUN mkdir -p ${REPOS_DIR} \
70     && mkdir -p ${REPOS_VNFS_DIR} \
71     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
72     && mkdir -p ${FUNCTEST_BASE_DIR}/conf \
73     && mkdir -p /root/.ssh \
74     && chmod 700 /root/.ssh
75
76 RUN git config --global http.sslVerify false
77
78 # OPNFV repositories
79 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/functest ${REPOS_DIR}/functest
80 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
81 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sdnvpn ${REPOS_DIR}/sdnvpn
82 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
83 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPOS_DIR}/parser
84 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
85 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/ovno ${REPOS_DIR}/ovno
86 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
87 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sfc ${REPOS_DIR}/sfc
88 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/snaps ${REPOS_DIR}/snaps
89 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS_DIR}/securityscanning
90 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${REPOS_DIR}/releng
91
92 # OpenStack repositories
93 RUN git clone --depth 1 -b $OPENSTACK_TAG https://github.com/openstack/networking-bgpvpn ${REPOS_DIR}/bgpvpn
94 RUN git clone --depth 1 -b $KINGBIRD_TAG https://github.com/openstack/kingbird.git ${REPOS_DIR}/kingbird
95 RUN git clone --depth 1 -b $RALLY_TAG https://github.com/openstack/rally.git ${REPOS_DIR}/rally
96 RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git ${REPOS_DIR}/tempest
97
98 # other repositories
99 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
100 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
101 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
102
103 RUN pip install -r ${REPOS_DIR}/rally/requirements.txt
104 RUN pip install -r ${REPOS_DIR}/tempest/requirements.txt
105
106 RUN cd ${FUNCTEST_REPO_DIR} \
107     && pip install -r requirements.txt \
108     && pip install .
109
110 RUN cd ${RELENG_MODULE_DIR} \
111     && pip install .
112
113 RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
114     -not -path "*tests/unit*" |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
115     && find ${FUNCTEST_REPO_DIR} -name "*.sh" |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
116
117 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
118 RUN ${REPOS_DIR}/rally/install_rally.sh --yes
119
120 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
121 RUN curl -L https://get.rvm.io | bash -s stable
122
123 # SNAPS integration
124 RUN pip install -e ${REPOS_DIR}/snaps/
125
126 # SFC integration
127 RUN /bin/bash -c ". ${REPOS_DIR}/sfc/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
128 RUN cd ${REPOS_DIR}/sfc && pip install .
129
130 # SDNVPN integration
131 RUN cd ${REPOS_DIR}/sdnvpn && pip install .
132
133 RUN cd ${REPOS_DIR}/bgpvpn && pip install .
134
135 # Kingbird integration
136 RUN cd ${REPOS_DIR}/kingbird && pip install -e .
137
138 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
139     && cd ${REPOS_VNFS_DIR}/vims-test \
140     && rvm autolibs enable"
141 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
142     && cd ${REPOS_VNFS_DIR}/vims-test \
143     && rvm install 1.9.3"
144 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
145     && cd ${REPOS_VNFS_DIR}/vims-test \
146     && rvm use 1.9.3"
147 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
148     && gem install bundler \
149     && cd ${REPOS_VNFS_DIR}/vims-test \
150     && bundle config build.nokogiri --use-system-libraries \
151     && bundle install"
152
153 RUN sh -c 'wget -qO- https://nodejs.org/dist/v4.7.2/node-v4.7.2-linux-arm64.tar.gz | \
154     tar -xz -C /usr/local --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md --strip-components 1 '\
155     && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
156     && cd ${REPOS_DIR}/promise/source && npm install
157
158 RUN echo "set nocompatible \n\
159 set backspace=2" \
160 >> ${HOME}/.vimrc
161 RUN echo set nocompatible >> ${HOME}/.exrc
162 RUN echo "alias ll='ls -lh' \n\
163 . ${FUNCTEST_REPO_DIR}/functest/cli/functest-complete.sh" \
164 >> ${HOME}/.bashrc