Skip to content

Commit

Permalink
BUILDBOT: Install buildbot-worker in a virtual environment
Browse files Browse the repository at this point in the history
This will avoid conflicts between system packages and required ones by
buildbot.
This also makes sure all Python libraries are up to date.
  • Loading branch information
lephilousophe committed Aug 13, 2023
1 parent c9030c7 commit 0b45771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 6 additions & 7 deletions workers/m4/install-buildbot.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
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

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
Expand Down
6 changes: 1 addition & 5 deletions workers/m4/run-buildbot.m4
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 0b45771

Please sign in to comment.