1 FROM golang:1.15-alpine3.12
4 ARG OPENSTACK_TAG=master
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 git init /src/requirements && \
13 (cd /src/requirements && \
14 git fetch --tags https://review.opendev.org/openstack/requirements $OPENSTACK_TAG && \
15 git checkout FETCH_HEAD) && \
16 case $(uname -m) in aarch*|arm*) \
17 sed -i -E /^PyNaCl=/d /src/requirements/upper-constraints.txt && \
18 apk add --no-cache py3-pynacl ;; esac && \
19 apk --no-cache add --update py3-distlib\>=0.3.1 \
20 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main && \
21 git init /src/functest-kubernetes && \
22 (cd /src/functest-kubernetes && \
23 git fetch --tags https://gerrit.opnfv.org/gerrit/functest-kubernetes $BRANCH && \
24 git checkout FETCH_HEAD) && \
25 pip3 install --no-cache-dir --src /src \
26 -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
27 -c/src/requirements/upper-constraints.txt \
28 /src/functest-kubernetes && \
29 (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
30 (cd /usr/lib/python3.8/site-packages/xrally_kubernetes/ && \
31 patch -p2 < /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch) && \
32 rm -rf /src/functest-kubernetes /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch && \
33 bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \
34 ln -s /var/lib/xtesting /home/opnfv/functest && \
35 mkdir -p /etc/rally && \
36 printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
37 mkdir -p /var/lib/rally/database && rally db create && \
38 rm -r /src/requirements/.git /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch && \
40 COPY logging.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.ini
41 COPY logging.debug.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.debug.ini
42 CMD ["run_tests", "-t", "all"]