Fix refstack_defcore
[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 REFSTACK_TAG=15.0.0
18 ARG ODL_TAG=release/beryllium-sr4
19 ARG KINGBIRD_TAG=0.2.2
20 ARG VIMS_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_REPO_DIR=${REPOS_DIR}/functest
28 ARG FUNCTEST_TEST_DIR=${FUNCTEST_REPO_DIR}/functest/opnfv_tests
29 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
30 ARG PIP_OPTS=-chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?stable/ocata
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
38 WORKDIR ${HOME}
39
40 # Packaged dependencies
41 RUN apt-get update && apt-get install -y \
42 build-essential \
43 bundler \
44 crudini \
45 curl \
46 gcc \
47 git \
48 libffi-dev \
49 libgmp3-dev \
50 libjpeg-dev \
51 libpq-dev \
52 libssl-dev \
53 libxml2-dev \
54 libxslt-dev \
55 python-dev \
56 python-mock \
57 python-pip \
58 postgresql \
59 ruby1.9.1-dev \
60 ssh \
61 sshpass \
62 wget \
63 --no-install-recommends
64
65 RUN pip install --upgrade pip && easy_install -U setuptools==30.0.0
66
67 RUN mkdir -p ${FUNCTEST_REPO_DIR} \
68     && mkdir -p ${REPOS_VNFS_DIR} \
69     && mkdir -p ${FUNCTEST_BASE_DIR}/results \
70     && mkdir -p ${FUNCTEST_BASE_DIR}/conf \
71     && mkdir -p ${FUNCTEST_DATA_DIR} \
72     && mkdir -p ${FUNCTEST_IMAGES_DIR} \
73     && mkdir -p /root/.ssh \
74     && chmod 700 /root/.ssh
75
76 RUN git config --global http.sslVerify false
77
78 COPY thirdparty-requirements.txt thirdparty-requirements.txt
79 RUN pip install ${PIP_OPTS} \
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 && rm thirdparty-requirements.txt
84
85 # OPNFV repositories
86 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
87 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
88 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPOS_DIR}/parser
89 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
90 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
91
92 # other repositories
93 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
94 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
95 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
96
97 RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
98     -not -path "*tests/unit*" \
99     -not -path "*functest_venv*" \
100     |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 \
101     && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
102     -not -path "*functest_venv*" \
103     |xargs grep -L \#\! |cut -d\:  -f 1 |xargs chmod -c 644
104
105 RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
106     -not -path "*tests/unit*" \
107     -not -path "*functest_venv*" \
108     |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
109     && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
110     -not -path "*functest_venv*" \
111     |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
112
113 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
114 RUN wget -q https://raw.githubusercontent.com/openstack/rally/${RALLY_TAG}/install_rally.sh \
115     && bash install_rally.sh --branch ${RALLY_TAG} --yes && rm install_rally.sh
116
117 RUN add_images.sh
118
119 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
120 RUN curl -L https://get.rvm.io | bash -s stable
121
122 # SFC integration
123 RUN /bin/bash -c ". /usr/local/lib/python2.7/dist-packages/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
124
125 # refstack-client integration
126 RUN wget -q https://raw.githubusercontent.com/openstack/refstack-client/master/setup_env \
127     && bash setup_env -t ${REFSTACK_TAG} && rm setup_env
128 RUN ln -s ${HOME}/.tempest /usr/local/lib/python2.7/dist-packages/.tempest
129
130 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
131     && cd ${REPOS_VNFS_DIR}/vims-test \
132     && rvm autolibs enable"
133 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
134     && cd ${REPOS_VNFS_DIR}/vims-test \
135     && rvm install 1.9.3"
136 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
137     && cd ${REPOS_VNFS_DIR}/vims-test \
138     && rvm use 1.9.3"
139 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
140     && gem install bundler \
141     && cd ${REPOS_VNFS_DIR}/vims-test \
142     && bundle config build.nokogiri --use-system-libraries \
143     && bundle install"
144
145 RUN sh -c 'wget -qO- https://nodejs.org/dist/v4.7.2/node-v4.7.2-linux-arm64.tar.gz | \
146     tar -xz -C /usr/local --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md --strip-components 1 '\
147     && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
148     && cd ${REPOS_DIR}/promise/source && npm install
149
150 RUN echo ". ${FUNCTEST_REPO_DIR}/functest/cli/functest-complete.sh" >> ${HOME}/.bashrc