272cf1fa81765fe0ffb0c8c2bf865efd0390c598
[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=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=0.2.2
22 ARG VIMS_TAG=stable
23 ARG REPOS_DIR=/home/opnfv/repos
24 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
25 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
26 ARG FUNCTEST_DATA_DIR=${FUNCTEST_BASE_DIR}/data
27 ARG FUNCTEST_IMAGES_DIR=${FUNCTEST_BASE_DIR}/images
28 ARG FUNCTEST_RESULTS_DIR=${FUNCTEST_BASE_DIR}/results
29 ARG FUNCTEST_REPO_DIR=${REPOS_DIR}/functest
30 ARG FUNCTEST_TEST_DIR=${FUNCTEST_REPO_DIR}/functest/opnfv_tests
31 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
32
33 # Environment variables
34 ENV HOME /home/opnfv
35 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_REPO_DIR}/functest/ci/config_functest.yaml
36 ENV REPOS_DIR ${HOME}/repos
37 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
38
39 WORKDIR ${HOME}
40
41 # Packaged dependencies
42 RUN apt-get update && apt-get install -y \
43 build-essential \
44 bundler \
45 crudini \
46 curl \
47 gcc \
48 git \
49 libffi-dev \
50 libgmp3-dev \
51 libjpeg-dev \
52 libpq-dev \
53 libssl-dev \
54 libxml2-dev \
55 libxslt-dev \
56 python-dev \
57 python-mock \
58 python-pip \
59 postgresql \
60 ruby1.9.1-dev \
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
68 RUN mkdir -p ${FUNCTEST_REPO_DIR} \
69     && mkdir -p ${REPOS_VNFS_DIR} \
70     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
71     && mkdir -p ${FUNCTEST_BASE_DIR}/conf \
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 pip install \
81     git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
82     git+https://gerrit.opnfv.org/gerrit/releng@$BRANCH#egg=opnfv\&subdirectory=modules \
83     git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps \
84     -r thirdparty-requirements.txt && rm thirdparty-requirements.txt
85
86 # OPNFV repositories
87 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
88 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sdnvpn ${REPOS_DIR}/sdnvpn
89 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
90 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPOS_DIR}/parser
91 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
92 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
93 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sfc ${REPOS_DIR}/sfc
94 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS_DIR}/securityscanning
95 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/opera ${REPOS_DIR}/opera
96
97 # other repositories
98 RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git ${REPOS_DIR}/tempest
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 find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
104     -not -path "*tests/unit*" \
105     -not -path "*functest_venv*" \
106     |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 \
107     && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
108     -not -path "*functest_venv*" \
109     |xargs grep -L \#\! |cut -d\:  -f 1 |xargs chmod -c 644
110
111 RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
112     -not -path "*tests/unit*" \
113     -not -path "*functest_venv*" \
114     |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
115     && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
116     -not -path "*functest_venv*" \
117     |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
118
119 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
120 RUN wget -q https://raw.githubusercontent.com/openstack/rally/${RALLY_TAG}/install_rally.sh \
121     && bash install_rally.sh --branch ${RALLY_TAG} --yes && rm install_rally.sh
122
123 RUN add_images.sh
124
125 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
126 RUN curl -L https://get.rvm.io | bash -s stable
127
128 RUN pip install ${REPOS_DIR}/opera
129
130 # SFC integration
131 RUN /bin/bash -c ". ${REPOS_DIR}/sfc/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
132 RUN cd ${REPOS_DIR}/sfc && pip install -e .
133
134 # SDNVPN integration
135 RUN cd ${REPOS_DIR}/sdnvpn && pip install -e .
136
137 # refstack-client integration
138 RUN wget -q https://raw.githubusercontent.com/openstack/refstack-client/master/setup_env \
139     && bash setup_env -t ${REFSTACK_TAG} && rm setup_env
140
141 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
142     && cd ${REPOS_VNFS_DIR}/vims-test \
143     && rvm autolibs enable"
144 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
145     && cd ${REPOS_VNFS_DIR}/vims-test \
146     && rvm install 1.9.3"
147 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
148     && cd ${REPOS_VNFS_DIR}/vims-test \
149     && rvm use 1.9.3"
150 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
151     && gem install bundler \
152     && cd ${REPOS_VNFS_DIR}/vims-test \
153     && bundle config build.nokogiri --use-system-libraries \
154     && bundle install"
155
156 RUN sh -c 'wget -qO- https://nodejs.org/dist/v4.7.2/node-v4.7.2-linux-arm64.tar.gz | \
157     tar -xz -C /usr/local --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md --strip-components 1 '\
158     && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
159     && cd ${REPOS_DIR}/promise/source && npm install
160
161 RUN echo ". ${FUNCTEST_REPO_DIR}/functest/cli/functest-complete.sh" >> ${HOME}/.bashrc