Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
build_all_targets: limit concurrent jobs
Browse files Browse the repository at this point in the history
This commit adds some code that limits the amount of docker
containers that run in parallel. This will hopefully fix the
nondeterministically missing files that we have seen in the
packagefeed.

Signed-off-by: Martin Hübner <[email protected]>
  • Loading branch information
Akira25 committed Aug 5, 2021
1 parent da4e192 commit 2765fc5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build_all_targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ FEED="$2"
OUTPUT_DIR="$3"
BUILD_PARALLEL="$4"

MAX_JOBS=8
CUR_JOBS=0

# check for dependencies
DEPS="docker-hub docker"

Expand Down Expand Up @@ -53,9 +56,13 @@ archs+=( ["x86_64"]=x86-64 )
for key in ${!archs[@]}; do
SDK="${archs[${key}]}"
[ "$OPENWRT_VERSION" != "snapshot" ] && SDK+="-$OPENWRT_VERSION"
if [ -n "$BUILD_PARALLEL" ]; then
if [ -n "$BUILD_PARALLEL" ] ; then
CUR_JOBS=$(( $CUR_JOBS + 1 ))
(./build_feed "$SDK" "$FEED" "$OUTPUT_DIR" PARALLEL) &
else
./build_feed "$SDK" "$FEED" "$OUTPUT_DIR"
fi
while [ $CUR_JOBS -ge $MAX_JOBS ]; do
sleep 20
done
done

0 comments on commit 2765fc5

Please sign in to comment.