aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2022-10-05 11:06:09 +0200
committerMagnus Granberg <zorry@gentoo.org>2022-10-05 11:06:09 +0200
commit5feaf00fc4770fbf3088244faa129996d1b08b8c (patch)
treebf29d792ffb8161b9a05d1e6b69a913c28064da3
parentFix owner to buildbot (diff)
downloadtinderbox-cluster-5feaf00fc4770fbf3088244faa129996d1b08b8c.tar.gz
tinderbox-cluster-5feaf00fc4770fbf3088244faa129996d1b08b8c.tar.bz2
tinderbox-cluster-5feaf00fc4770fbf3088244faa129996d1b08b8c.zip
Fix the Log and Build dockerfiles
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-rw-r--r--docker/GentooBuildbotWorker.Dockerfile14
-rw-r--r--docker/GentooBuildbotWorkerBuild.Dockerfile79
-rw-r--r--docker/GentooBuildbotWorkerLog.Dockerfile (renamed from docker/GentooBuildbotWorkerDefault.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
index a7c7af1..a7c7af1 100644
--- a/docker/GentooBuildbotWorkerDefault.Dockerfile
+++ b/docker/GentooBuildbotWorkerLog.Dockerfile