another attempt to fix Github Actions curl timeouts

Will run "sudo ethtool -K eth0 tx off rx off" in container before executing
build commands.

Since our build environment doesn't have ethtool installed, this will
imply rebuilding Docker image. Until that, CI builds will fail due to
missing utility.
This commit is contained in:
Leonid Pliushch 2021-05-26 15:12:34 +03:00
parent 62abbe5ae0
commit 86cdb09734
No known key found for this signature in database
GPG Key ID: 45F2964132545795
2 changed files with 14 additions and 0 deletions

View File

@ -31,8 +31,15 @@ else
fi fi
$SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || { $SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || {
if [ "$GITHUB_ACTIONS" = "true" ]; then
SECURITY_OPT="--cap-add SYS_ADMIN --cap-add NET_ADMIN --security-opt apparmor:unconfined --security-opt seccomp=unconfined"
else
SECURITY_OPT=""
fi
echo "Creating new container..." echo "Creating new container..."
$SUDO docker run \ $SUDO docker run \
$SECURITY_OPT \
--detach \ --detach \
--name $CONTAINER_NAME \ --name $CONTAINER_NAME \
--volume $REPOROOT:$CONTAINER_HOME_DIR/termux-packages \ --volume $REPOROOT:$CONTAINER_HOME_DIR/termux-packages \
@ -49,6 +56,10 @@ $SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || {
fi fi
} }
if [ "$GITHUB_ACTIONS" = "true" ]; then
$SUDO docker exec $DOCKER_TTY $CONTAINER_NAME sudo ethtool -K eth0 tx off rx off
fi
if [ "$#" -eq "0" ]; then if [ "$#" -eq "0" ]; then
$SUDO docker exec --interactive $DOCKER_TTY $CONTAINER_NAME bash $SUDO docker exec --interactive $DOCKER_TTY $CONTAINER_NAME bash
else else

View File

@ -3,6 +3,9 @@ set -e -u
PACKAGES="" PACKAGES=""
# For fixing networking interface when running on Github Actions.
PACKAGES+=" ethtool"
# For en_US.UTF-8 locale. # For en_US.UTF-8 locale.
PACKAGES+=" locales" PACKAGES+=" locales"