b11353383588b6e13a0879a16a710bbed716c2ef
[functest-kubernetes.git] / docker / core / Dockerfile
1 FROM golang:1.14-alpine3.12
2
3 ARG BRANCH=master
4 ARG OPENSTACK_TAG=master
5 ARG OPNFV_TAG=master
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 RUN apk --no-cache add --update python3 py3-pip py3-wheel bash git grep libffi openssl mailcap && \
10     apk --no-cache add --virtual .build-deps --update \
11         python3-dev build-base libffi-dev openssl-dev && \
12     apk --no-cache add --update py3-distlib==0.3.1-r0 \
13         --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main && \
14     git init /src/requirements && \
15     (cd /src/requirements && \
16         git fetch --tags https://review.opendev.org/openstack/requirements $OPENSTACK_TAG && \
17         git checkout FETCH_HEAD) && \
18     git init /src/functest-kubernetes && \
19     (cd /src/functest-kubernetes && \
20         git fetch --tags https://gerrit.opnfv.org/gerrit/functest-kubernetes $BRANCH && \
21         git checkout FETCH_HEAD) && \
22     pip3 install --no-cache-dir --src /src \
23         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
24         -c/src/requirements/upper-constraints.txt \
25         /src/functest-kubernetes && \
26     (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
27     (cd /usr/lib/python3.8/site-packages/xrally_kubernetes/ && \
28         patch -p2 < /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch) && \
29     rm -rf /src/functest-kubernetes /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch && \
30     bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \
31     ln -s /var/lib/xtesting /home/opnfv/functest && \
32     mkdir -p /etc/rally && \
33     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
34     mkdir -p /var/lib/rally/database && rally db create && \
35     rm -r /src/requirements/.git /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch && \
36     apk del .build-deps
37 COPY logging.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.ini
38 COPY logging.debug.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.debug.ini
39 CMD ["run_tests", "-t", "all"]