BUILDBOT: Install buildbot-worker in a virtual environment

This will avoid conflicts between system packages and required ones by
buildbot.
This also makes sure all Python libraries are up to date.
This commit is contained in:
Le Philousophe
2023-08-13 10:32:30 +00:00
parent c9030c75cb
commit 0b45771eb7
2 changed files with 7 additions and 12 deletions
+6 -7
View File
@@ -1,16 +1,13 @@
m4_ifdef(`BASE_ALPINE',
RUN apk add --no-cache \
dumb-init \
py3-future \
py3-pip \
py3-twisted
py3-wheel
, m4_ifdef(`BASE_DEBIAN',
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
dumb-init \
python3-future \
python3-pip \
python3-twisted \
python3-venv \
python3-wheel \
&& \
rm -rf /var/lib/apt/lists/*
, ``fatal_error(No base defined)''))m4_dnl
@@ -18,7 +15,9 @@ RUN apt-get update && \
ARG BUILDBOT_VERSION
LABEL buildbot-version=${BUILDBOT_VERSION}
RUN pip3 --no-cache-dir install --break-system-packages \
# Setup a virtual env and install buildbot worker in it
RUN python3 -m venv --system-site-packages /opt/buildbot && \
/opt/buildbot/bin/python3 -m pip --no-cache-dir install \
buildbot-worker==${BUILDBOT_VERSION}
ARG BUILDBOT_UID=1000
+1 -5
View File
@@ -1,8 +1,4 @@
USER buildbot
WORKDIR /buildbot-worker/
m4_ifdef(`BASE_ALPINE',
``ENTRYPOINT ["/usr/bin/dumb-init", ''m4_ifdef(`ENTRY_WRAPPER',`ENTRY_WRAPPER``, ''')``"twistd", "--pidfile=", "-ny", "buildbot.tac"]''
, m4_ifdef(`BASE_DEBIAN',
``ENTRYPOINT ["/usr/bin/dumb-init", ''m4_ifdef(`ENTRY_WRAPPER',`ENTRY_WRAPPER``, ''')``"twistd3", "--pidfile=", "-ny", "buildbot.tac"]''
, ``fatal_error(No base defined)''))m4_dnl
ENTRYPOINT ["/usr/bin/dumb-init", m4_ifdef(`ENTRY_WRAPPER',ENTRY_WRAPPER`, ')"/opt/buildbot/bin/twistd", "--pidfile=", "-ny", "buildbot.tac"]