From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: docker/
Date: Wed, 5 Oct 2022 09:06:35 +0000 (UTC) [thread overview]
Message-ID: <1664960769.5feaf00fc4770fbf3088244faa129996d1b08b8c.zorry@gentoo> (raw)
commit: 5feaf00fc4770fbf3088244faa129996d1b08b8c
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 5 09:06:09 2022 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Wed Oct 5 09:06:09 2022 +0000
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=5feaf00f
Fix the Log and Build dockerfiles
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
docker/GentooBuildbotWorker.Dockerfile | 14 ----
docker/GentooBuildbotWorkerBuild.Dockerfile | 79 ++++++++++++++++++++++
...ckerfile => GentooBuildbotWorkerLog.Dockerfile} | 0
3 files changed, 79 insertions(+), 14 deletions(-)
diff --git a/docker/GentooBuildbotWorker.Dockerfile b/docker/GentooBuildbotWorker.Dockerfile
deleted file mode 100644
index db5e398..0000000
--- a/docker/GentooBuildbotWorker.Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Dockerfile creates a gentoo buildbot worker container image
-# from a gentoo project stage4 docker image.
-
-ARG PROJECTUUID
-
-FROM stage4-${PROJECTUUID}
-RUN echo "Building Gentoo Buildbot worker Container image for ${PROJECTUUID}" \
- && ( sed -i -e 's/#rc_sys=""/rc_sys="docker"/g' etc/rc.conf 2>/dev/null || true ) \
- && echo 'UTC' > etc/timezone \
- && echo 'docker' >> /var/lib/buildbot_worker/info/host \
- && echo 'bb-worker-${PROJECTUUID}:latest' >> /var/lib/buildbot_worker/info/host
-WORKDIR /var/lib/buildbot_worker
-ENTRYPOINT ["/usr/bin/buildbot-worker"]
-CMD ["start", "--nodaemon"]
diff --git a/docker/GentooBuildbotWorkerBuild.Dockerfile b/docker/GentooBuildbotWorkerBuild.Dockerfile
new file mode 100644
index 0000000..bd357dc
--- /dev/null
+++ b/docker/GentooBuildbotWorkerBuild.Dockerfile
@@ -0,0 +1,79 @@
+# This Dockerfile creates a gentoo stage4 container image with buildbot worker installed.
+
+ARG TAG=latest
+
+FROM gentoo/portage:latest as portage
+
+FROM gentoo/stage3:$TAG
+
+ARG KEYWORDS
+ARG PROJECTUUID
+ARG BINHOSTURL
+ARG ARCH
+ARG TAG=latest
+ARG NODE
+
+# copy the entire portage volume in
+COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
+
+# Setup portage for git install
+RUN echo 'FEATURES="-ipc-sandbox -pid-sandbox -network-sandbox -usersandbox -mount-sandbox sandbox"' | cat >> /etc/portage/make.conf\
+ && echo 'MAKEOPTS="-j8"' | cat >> /etc/portage/make.conf
+
+# Install git
+RUN emerge -qv dev-vcs/git
+
+# Setup portage for the rest of the build
+RUN echo -e "[binhost]\npriority = 9999\nsync-uri = ${BINHOSTURL}/${PROJECTUUID}/packages/\n" | cat >> /etc/portage/binrepos.conf\
+ && echo 'EMERGE_DEFAULT_OPTS="--buildpkg=y --rebuild-if-new-rev=y --rebuilt-binaries=y --usepkg=y --binpkg-respect-use=n --binpkg-changed-deps=y --nospinner --color=n --ask=n"' | cat >> /etc/portage/make.conf\
+ && echo 'FEATURES="${FEATURES} parallel-fetch -merge-sync "' | cat >> /etc/portage/make.conf\
+ && echo 'FEATURES="${FEATURES} getbinpkg"' | cat >> /etc/portage/make.conf\
+ && echo 'COMMON_FLAGS="${COMMON_FLAGS} -fno-diagnostics-color -march=native"' | >> /etc/portage/make.conf\
+ && echo 'USE="X elogind"' | >> /etc/portage/make.conf\
+ && echo 'PYTHON_TARGETS="python3_10 python3_9 python3_8 python3_11"' | >> /etc/portage/make.conf\
+ && echo 'ACCEPT_LICENSE="*"'\
+ && ( sed -i -e 's/#rc_sys=""/rc_sys="docker"/g' /etc/rc.conf 2>/dev/null || true ) \
+ && echo 'UTC' > /etc/timezone
+
+# Setup LANG
+RUN echo 'en_US.UTF-8 UTF-8' | cat >> /etc/locale.gen\
+ && echo 'en_US ISO-8859-1' | cat >> /etc/locale.gen\
+ && echo 'C.UTF8 UTF-8' | cat >> /etc/locale.gen\
+ && echo 'LANG="en_US.utf8"' | cat >> /etc/locale.conf\
+ && locale-gen
+
+# clone gentoo repo use github https for
+# gitlab.gentoo.org do timeout on https
+RUN rm -R /var/db/repos/gentoo\
+ && git clone --depth=1 https://github.com/gentoo/gentoo.git /var/db/repos/gentoo
+
+# set accept_keywords
+RUN echo 'ACCEPT_KEYWORDS="'"${KEYWORDS}"'"' | cat >> /etc/portage/make.conf
+
+# Setup world file
+RUN echo 'app-text/ansifilter' | cat >> /var/lib/portage/world\
+ && echo 'dev-util/pkgcheck' | cat >> /var/lib/portage/world\
+ && echo 'dev-lang/rust-bin' | cat >> /var/lib/portage/world\
+ && echo 'app-admin/eclean-kernel' | cat >> /var/lib/portage/world\
+ && echo 'app-portage/gentoolkit' | cat >> /var/lib/portage/world\
+ && echo 'app-editors/nano' | cat >> /var/lib/portage/world
+
+# Run emerge update and install buildbot-worker
+RUN emerge -1qv perl\
+ && perl-cleaner --all\
+ && emerge -qv --update --deep --newuse @world\
+ && emerge -qv gentoo-kernel-bin\
+ && emerge -qv buildbot-worker
+
+# Rm the gentoo repo
+RUN rm -R /var/db/repos/gentoo
+
+# Setup the buildbot-worker
+WORKDIR /var/lib/buildbot_worker
+RUN wget https://raw.githubusercontent.com/buildbot/buildbot/master/worker/docker/buildbot.tac\
+ && ( sed -i -e 's/umask = None/umask = 0o22/g' buildbot.tac 2>/dev/null || true ) \
+ && mkdir info\
+ && echo "${PROJECTUUID} ${ARCH} stage3:${TAG} ${NODE}" | cat > info/host
+ENTRYPOINT ["/usr/bin/buildbot-worker"]
+CMD ["start", "--nodaemon"]
+#CMD ["/bin/bash"]
diff --git a/docker/GentooBuildbotWorkerDefault.Dockerfile b/docker/GentooBuildbotWorkerLog.Dockerfile
similarity index 100%
rename from docker/GentooBuildbotWorkerDefault.Dockerfile
rename to docker/GentooBuildbotWorkerLog.Dockerfile
next reply other threads:[~2022-10-05 9:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 9:06 Magnus Granberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-06-07 21:33 [gentoo-commits] proj/tinderbox-cluster:master commit in: docker/ Magnus Granberg
2023-05-08 20:19 Magnus Granberg
2022-08-18 14:50 Magnus Granberg
2022-07-14 0:29 Magnus Granberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1664960769.5feaf00fc4770fbf3088244faa129996d1b08b8c.zorry@gentoo \
--to=zorry@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox