eefc0da87ce08ed728b01bc845a36560f0e3aaee
[functest-kubernetes.git] / docker / core / Dockerfile
1 FROM alpine:3.16
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 -U upgrade && \
10     apk --no-cache add --update python3 py3-pip py3-wheel bash git grep libffi openssl mailcap \
11         libxml2 libxslt && \
12     apk --no-cache add --virtual .build-deps --update \
13         python3-dev build-base libffi-dev openssl-dev rust cargo libxml2-dev libxslt-dev && \
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     case $(uname -m) in aarch*|arm*) \
19         sed -i -E /^PyNaCl=/d /src/requirements/upper-constraints.txt && \
20         apk add --no-cache py3-pynacl ;; esac && \
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 --use-deprecated=legacy-resolver --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         setuptools_scm && \
29     pip3 install --use-deprecated=legacy-resolver --no-cache-dir --src /src \
30         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
31         -c/src/requirements/upper-constraints.txt \
32         /src/functest-kubernetes && \
33     (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
34     (cd /usr/lib/python3.10/site-packages/xrally_kubernetes/ && \
35         patch -p2 < /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch) && \
36     rm -rf /src/functest-kubernetes /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch && \
37     bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \
38     ln -s /var/lib/xtesting /home/opnfv/functest && \
39     mkdir -p /etc/rally && \
40     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
41     mkdir -p /var/lib/rally/database && rally db create && \
42     rm -r /src/requirements/.git /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch && \
43     addgroup -g 1000 xtesting && adduser -u 1000 -G xtesting -D xtesting && \
44     mkdir -p /etc/xtesting && chown -R xtesting: /etc/xtesting && \
45     apk del .build-deps
46 USER xtesting
47 COPY logging.ini /etc/xtesting/logging.ini
48 COPY logging.debug.ini /etc/xtesting/logging.debug.ini
49 CMD ["run_tests", "-t", "all"]