diff mbox series

[1/4] ci: drop run-docker scripts

Message ID 20240912094336.GA589828@coredump.intra.peff.net (mailing list archive)
State Accepted
Commit 48c55943c5c7d1ab35fe8af62f656f8e40fe18e5
Headers show
Series make linux32 ci job work with recent actions | expand

Commit Message

Jeff King Sept. 12, 2024, 9:43 a.m. UTC
We haven't used these scripts since 4a6e4b9602 (CI: remove Travis CI
support, 2021-11-23), as the GitHub Actions config has support for
directly running jobs within docker containers.

It's possible we might want to resurrect something like this in order to
be more agnostic to the CI platform. But it's not clear exactly what it
would look like. And in the meantime, it's just a maintenance burden as
we make changes to CI config, and is subject to bitrot. In fact it's
already broken; it references ci/install-docker-dependencies.sh, which
went away in 9cdeb34b96 (ci: merge scripts which install dependencies,
2024-04-12).

Signed-off-by: Jeff King <peff@peff.net>
---
I think this is worth doing even if we don't take the rest of the
patches. But obviously it gets even more bit-rotted as the other patches
change the CI config file.

 ci/run-docker-build.sh | 66 ------------------------------------------
 ci/run-docker.sh       | 47 ------------------------------
 2 files changed, 113 deletions(-)
 delete mode 100755 ci/run-docker-build.sh
 delete mode 100755 ci/run-docker.sh

Comments

Patrick Steinhardt Sept. 12, 2024, 10:40 a.m. UTC | #1
On Thu, Sep 12, 2024 at 05:43:36AM -0400, Jeff King wrote:
> We haven't used these scripts since 4a6e4b9602 (CI: remove Travis CI
> support, 2021-11-23), as the GitHub Actions config has support for
> directly running jobs within docker containers.
> 
> It's possible we might want to resurrect something like this in order to
> be more agnostic to the CI platform. But it's not clear exactly what it
> would look like. And in the meantime, it's just a maintenance burden as
> we make changes to CI config, and is subject to bitrot. In fact it's
> already broken; it references ci/install-docker-dependencies.sh, which
> went away in 9cdeb34b96 (ci: merge scripts which install dependencies,
> 2024-04-12).
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I think this is worth doing even if we don't take the rest of the
> patches. But obviously it gets even more bit-rotted as the other patches
> change the CI config file.

I initially wanted to use them for GitLab CI, but eventually I figured
that it makes way more sense to just merge the setup instructions we
have into a single, unified script. Docker or not doesn't really matter
all that much when you want to install dependencies. What matters more
is the actual platform you're on, but that is independent of Docker
anyway.

The only remaining usecase I could see for these is to run CI-like
builds on a developer's machine. But the fact that these scripts don't
work at all anymore and have started to bitrot already demonstrates that
nobody does seem to do that in the first place.

So I think removing them is the right thing to do.

Patrick
diff mbox series

Patch

diff --git a/ci/run-docker-build.sh b/ci/run-docker-build.sh
deleted file mode 100755
index 6cd832efb9..0000000000
--- a/ci/run-docker-build.sh
+++ /dev/null
@@ -1,66 +0,0 @@ 
-#!/bin/sh
-#
-# Build and test Git inside container
-#
-# Usage:
-#   run-docker-build.sh <host-user-id>
-#
-
-set -ex
-
-if test $# -ne 1 || test -z "$1"
-then
-	echo >&2 "usage: run-docker-build.sh <host-user-id>"
-	exit 1
-fi
-
-case "$jobname" in
-linux32)
-	switch_cmd="linux32 --32bit i386"
-	;;
-linux-musl)
-	switch_cmd=
-	useradd () { adduser -D "$@"; }
-	;;
-*)
-	exit 1
-	;;
-esac
-
-"${0%/*}/install-docker-dependencies.sh"
-
-# If this script runs inside a docker container, then all commands are
-# usually executed as root. Consequently, the host user might not be
-# able to access the test output files.
-# If a non 0 host user id is given, then create a user "ci" with that
-# user id to make everything accessible to the host user.
-HOST_UID=$1
-if test $HOST_UID -eq 0
-then
-	# Just in case someone does want to run the test suite as root.
-	CI_USER=root
-else
-	CI_USER=ci
-	if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID
-	then
-		echo "user '$CI_USER' already exists with the requested ID $HOST_UID"
-	else
-		useradd -u $HOST_UID $CI_USER
-	fi
-fi
-
-# Build and test
-command $switch_cmd su -m -l $CI_USER -c "
-	set -ex
-	export DEVELOPER='$DEVELOPER'
-	export DEFAULT_TEST_TARGET='$DEFAULT_TEST_TARGET'
-	export GIT_PROVE_OPTS='$GIT_PROVE_OPTS'
-	export GIT_TEST_OPTS='$GIT_TEST_OPTS'
-	export GIT_TEST_CLONE_2GB='$GIT_TEST_CLONE_2GB'
-	export MAKEFLAGS='$MAKEFLAGS'
-	export cache_dir='$cache_dir'
-	cd /usr/src/git
-	test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove
-	make
-	make test
-"
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
deleted file mode 100755
index af89d1624a..0000000000
--- a/ci/run-docker.sh
+++ /dev/null
@@ -1,47 +0,0 @@ 
-#!/bin/sh
-#
-# Download and run Docker image to build and test Git
-#
-
-. ${0%/*}/lib.sh
-
-case "$jobname" in
-linux32)
-	CI_CONTAINER="daald/ubuntu32:xenial"
-	;;
-linux-musl)
-	CI_CONTAINER=alpine
-	;;
-*)
-	exit 1
-	;;
-esac
-
-docker pull "$CI_CONTAINER"
-
-# Use the following command to debug the docker build locally:
-# <host-user-id> must be 0 if podman is used as drop-in replacement for docker
-# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/sh "$CI_CONTAINER"
-# root@container:/# export jobname=<jobname>
-# root@container:/# /usr/src/git/ci/run-docker-build.sh <host-user-id>
-
-container_cache_dir=/tmp/container-cache
-
-docker run \
-	--interactive \
-	--env DEVELOPER \
-	--env DEFAULT_TEST_TARGET \
-	--env GIT_PROVE_OPTS \
-	--env GIT_TEST_OPTS \
-	--env GIT_TEST_CLONE_2GB \
-	--env MAKEFLAGS \
-	--env jobname \
-	--env cache_dir="$container_cache_dir" \
-	--volume "${PWD}:/usr/src/git" \
-	--volume "$cache_dir:$container_cache_dir" \
-	"$CI_CONTAINER" \
-	/usr/src/git/ci/run-docker-build.sh $(id -u $USER)
-
-check_unignored_build_artifacts
-
-save_good_tree