util/docker/jenkins-node: Install pip modules into virtual env

Instead of installing the pip modules system-wide, and possibly causing
conflicts, install them into a virtual environment for the coreboot
user.

If we wanted to, in the future, we could install different versions of
the modules into different virtual environment directories to allow
for testing or anything else we needed.

Change-Id: I49c749a13a698bfb7af29bf07e42ac14b67b2ae7
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79006
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Martin Roth 2023-11-10 13:20:18 -07:00 committed by Felix Singer
parent dbc33f9376
commit 162b6484ff
1 changed files with 8 additions and 4 deletions

View File

@ -31,6 +31,7 @@ RUN apt-get -y update && \
sdcc \
python3-pip \
pykwalify \
python3-venv \
python3-yaml \
python3-pyelftools \
python3-jsonschema \
@ -70,10 +71,13 @@ ENTRYPOINT mount /cb-build && \
EXPOSE 49151
USER coreboot
ENV PATH=$PATH:/home/coreboot/.local/bin
RUN echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \
pip3 install --upgrade --no-cache-dir pip \
&& pip3 install --no-cache-dir \
ENV VIRTUAL_ENV="/home/coreboot/python3"
ENV PATH=$VIRTUAL_ENV/bin:$PATH:/home/coreboot/.local/bin
RUN echo 'export PATH=$PATH:/opt/xgcc/bin' >> /home/coreboot/.bashrc && \
echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/coreboot/.bashrc && \
python3 -m venv /home/coreboot/python3 && \
pip3 install --upgrade --no-cache-dir pip && \
pip3 install --no-cache-dir \
setuptools==58.2.0 \
jinja2==3.1.2 \
recommonmark===0.7.1 \