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