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

View File

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