Install setuptools_scm before xrally
[functest-kubernetes.git] / docker / core / Dockerfile
1 FROM alpine:3.10
2
3 ARG BRANCH=stable/jerma
4 ARG OPENSTACK_TAG=stable/train
5 ARG OPNFV_TAG=stable/jerma
6
7 COPY Try-a-quick-fix-vs-asynchronuous-issues.patch /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch
8 COPY Switch-to-threading.Thread-for-Rally-tasks.patch /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch
9 COPY Allow-offline-testing-in-PodWithClusterIPSvc.patch /tmp/Allow-offline-testing-in-PodWithClusterIPSvc.patch
10 RUN apk -U upgrade && \
11     apk --no-cache add --update libcurl curl --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main && \
12     apk --no-cache add --update python3 bash git grep libffi openssl mailcap && \
13     apk --no-cache add --virtual .build-deps --update \
14         python3-dev build-base libffi-dev openssl-dev && \
15     git init /src/functest-kubernetes && \
16     (cd /src/functest-kubernetes && \
17         git fetch --tags https://gerrit.opnfv.org/gerrit/functest-kubernetes $BRANCH && \
18         git checkout FETCH_HEAD) && \
19     pip3 install --no-cache-dir --src /src \
20         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
21         -chttps://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt \
22         setuptools_scm && \
23     pip3 install --no-cache-dir --src /src \
24         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
25         -chttps://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt \
26         /src/functest-kubernetes && \
27     (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
28     (cd /usr/lib/python3.7/site-packages/xrally_kubernetes/ && \
29         patch -p2 < /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch && \
30         patch -p2 < /tmp/Allow-offline-testing-in-PodWithClusterIPSvc.patch) && \
31     rm -rf /src/functest-kubernetes /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch && \
32     bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \
33     ln -s /var/lib/xtesting /home/opnfv/functest && \
34     mkdir -p /etc/rally && \
35     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
36     mkdir -p /var/lib/rally/database && rally db create && \
37     rm /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch /tmp/Allow-offline-testing-in-PodWithClusterIPSvc.patch && \
38     apk del .build-deps
39 COPY logging.ini /usr/lib/python3.7/site-packages/xtesting/ci/logging.ini
40 COPY logging.debug.ini /usr/lib/python3.7/site-packages/xtesting/ci/logging.debug.ini
41 CMD ["run_tests", "-t", "all"]