From 86cdb0973408d104abcc99e16ffac29b1c219916 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Wed, 26 May 2021 15:12:34 +0300 Subject: [PATCH] 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. --- scripts/run-docker.sh | 11 +++++++++++ scripts/setup-ubuntu.sh | 3 +++ 2 files changed, 14 insertions(+) diff --git a/scripts/run-docker.sh b/scripts/run-docker.sh index 19460171c..d4a93883d 100755 --- a/scripts/run-docker.sh +++ b/scripts/run-docker.sh @@ -31,8 +31,15 @@ else fi $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..." $SUDO docker run \ + $SECURITY_OPT \ --detach \ --name $CONTAINER_NAME \ --volume $REPOROOT:$CONTAINER_HOME_DIR/termux-packages \ @@ -49,6 +56,10 @@ $SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || { 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 $SUDO docker exec --interactive $DOCKER_TTY $CONTAINER_NAME bash else diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 6cf03781a..989a96445 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -3,6 +3,9 @@ set -e -u PACKAGES="" +# For fixing networking interface when running on Github Actions. +PACKAGES+=" ethtool" + # For en_US.UTF-8 locale. PACKAGES+=" locales"