forked from marosg42/serverlab-testflinger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtf-api
More file actions
68 lines (55 loc) · 1.68 KB
/
tf-api
File metadata and controls
68 lines (55 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM python:3.8-slim-buster
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV PATH /data/testflinger/server:$PATH
ENV TESTFLINGER_CONFIG=/data/testflinger/server/testflinger.conf
RUN echo "RUNNING tf-api dockerfile"
# install deps & cleanup
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
git \
procps \
wget \
python3 \
python3-dev \
python3-pip \
python3-requests \
python3-click
# clean up APT
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# link python3 bin
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN useradd -ms /bin/bash ubuntu
# facilitate logging
RUN mkdir -p /var/log/testflinger \
&& chmod 755 /var/log/testflinger
# clone src in volume dir
WORKDIR /data/testflinger/server
RUN git init \
&& git remote add origin https://github.com/canonical/testflinger.git \
&& git fetch origin \
&& git checkout -b main --track origin/main
#&& git checkout c1a1d6ab6de04dca3fcfd8fac3db962f0c35272e
# Remove gunicorn from install scripts
# RUN sed -i '22 s/^/#/' ./setup.py
# install gunicorn threading deps
RUN pip install gevent packaging
RUN pip install -Iv urllib3==1.26.15
# run setup
# RUN ./setup.py install
RUN echo && echo "Running testflinger-api setup:" \
&& echo "Updating pip from $(pip3 --version)" \
&& pip3 install -U pip \
&& hash -r \
&& echo "New pip version: $(pip3 --version)" \
&& echo "Attempting build/install of testflinger api" \
&& pip install -I .
# copy tf config files
COPY ./code/testflinger.conf /data/testflinger/server
# adjust perms on src files
RUN chown -R ubuntu:ubuntu /data/testflinger