From e1cae5872eda9f1a3a2a2e63ed954849b55b1214 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jul 2021 12:15:32 +0000 Subject: [PATCH] add proxy support --- apply-all-patch.sh | 14 +++++------ apply-single-patch.sh | 10 +++++--- clone-src.sh | 41 +++++++++++++++++++++++++++++++ create-from-patch.sh | 14 ++++++++--- export-all-patch.sh | 2 +- images/buildstack.env.example | 1 + images/buildstack.yml | 46 +++++++++++++++++++++++++++++++++++ 7 files changed, 113 insertions(+), 15 deletions(-) create mode 100644 clone-src.sh create mode 100644 images/buildstack.env.example diff --git a/apply-all-patch.sh b/apply-all-patch.sh index 10cc54b..a8bd159 100644 --- a/apply-all-patch.sh +++ b/apply-all-patch.sh @@ -37,26 +37,26 @@ for current_file in $(cat $PATCH_LIST); do echo "Adding $current_file" echo "Executing bash ~/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH" - bash ~/buildtools/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH + bash ~/bromite-buildtools/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH - echo "Press return" - read -n 1 + #echo "Press return" + #read -n 1 elif [[ $current_file =~ ^1.* ]]; then echo "Using new path $current_file" - bash ~/buildtools/apply-single-patch.sh $PATCH_NEW_PATH/${current_file:1} $PATCH_NEW_PATH + bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_NEW_PATH/${current_file:1} $PATCH_NEW_PATH echo "" LAST_COMMIT=$(git rev-parse HEAD) echo "Last Commit " $LAST_COMMIT - bash ~/buildtools/export-single-patch.sh $LAST_COMMIT + bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT else - bash ~/buildtools/apply-single-patch.sh $PATCH_OLD_PATH/$current_file $PATCH_NEW_PATH + bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_OLD_PATH/$current_file $PATCH_NEW_PATH echo $current_file >>$DESTINATION echo $PATCH_FILE @@ -64,7 +64,7 @@ for current_file in $(cat $PATCH_LIST); do echo "" LAST_COMMIT=$(git rev-parse HEAD) echo "Last Commit " $LAST_COMMIT - bash ~/buildtools/export-single-patch.sh $LAST_COMMIT + bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT #cp -r ~/bromite/build/patches-new/* ~/br2/bromite/build/patches/ #git -C ~/br2/bromite/ add . diff --git a/apply-single-patch.sh b/apply-single-patch.sh index 1cf5842..2966917 100644 --- a/apply-single-patch.sh +++ b/apply-single-patch.sh @@ -14,12 +14,16 @@ echo "Applying patch $PATCH" | tee -a ${LOG_FILE} git apply --reject --whitespace=fix $PATCH && OK=1 if [[ OK -eq 0 ]]; then + OK=1 + for file in $(grep '+++ b/' $PATCH | sed -e 's#+++ [ab]/##'); do + test -f $file || OK=0 + done + for file in $(find . -name *.rej); do echo " -> Check $file" | tee -a ${LOG_FILE}; - wiggle --no-ignore --replace ${file::-4} $file && rm $file && rm ${file::-4}.porig && echo " OK"; + wiggle --no-ignore --replace ${file::-4} $file && rm $file && rm ${file::-4}.porig && echo " OK" || OK=0 done - OK=1 for file in $(find . -name *.rej); do echo "---Found: $file" | tee -a ${LOG_FILE}; git add ${file::-4} @@ -64,5 +68,5 @@ if [[ OK -eq 0 ]]; then fi if [[ DOEXPORT -eq 1 ]]; then - bash ~/buildtools/create-from-patch.sh $PATCH $2 + bash ~/bromite-buildtools/create-from-patch.sh $PATCH $2 fi diff --git a/clone-src.sh b/clone-src.sh new file mode 100644 index 0000000..34f6d31 --- /dev/null +++ b/clone-src.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +VERSION=$(cat ~/bromite/build/RELEASE) +CURRENT_RELEASE=$(git -C ~/chromium/src/ rev-parse --verify refs/tags/$VERSION) + + +for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $CURRENT_RELEASE...HEAD); do + DIRNAME=$(dirname $file) + mkdir -p ~/mytests/$DIRNAME + git -C ~/chromium/src/ show $CURRENT_RELEASE:$file > ~/mytests/$file +done +git -C ~/mytests/ add . +git -C ~/mytests/ commit -m "$VERSION" + + +ALLPATCHS_E=$(git -C ~/chromium/src/ rev-list --reverse $CURRENT_RELEASE...HEAD) +for patch in $ALLPATCHS_E; do + + for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $patch); do + DIRNAME=$(dirname $file) + mkdir -p ~/mytests/$DIRNAME + #cp ~/chromium/src/$file ~/mytests/$file + #echo $file + OK=0 + git -C ~/chromium/src/ show $patch:$file > ~/mytests/$file && OK=1 + if [[ OK -eq 0 ]]; then + echo " Removing ~/mytests/$file" + rm ~/mytests/$file + fi + done + +#echo $ALLFILES_E +#read -n 1 + + MESSAGE=$(git -C ~/chromium/src/ log --pretty=format:%s -n 1 $patch) + git -C ~/mytests/ add . + git -C ~/mytests/ commit -m "$MESSAGE" + +#read -n 1 +done + diff --git a/create-from-patch.sh b/create-from-patch.sh index 8c7d274..05f9d7b 100644 --- a/create-from-patch.sh +++ b/create-from-patch.sh @@ -34,17 +34,23 @@ else if [[ "$NEWLINE" == Subject:* ]]; then echo "" >>$PATCH_FILE fi -fi +fi echo "FILE:$(basename $PATCH)" >>$PATCH_FILE echo "---" >>$PATCH_FILE echo "$CONTENT" >>$PATCH_FILE -#echo press return -#read -n 1 +echo press return +read -n 1 git reset --hard git clean -f -d echo " Applying new patch" -git am $PATCH_FILE +OK=1 +git am $PATCH_FILE || OK=0 + +if [[ OK -eq 0 ]]; then + echo "---> Failed to apply. Press return" + read -n 1 +fi diff --git a/export-all-patch.sh b/export-all-patch.sh index 96da4c1..42304e8 100644 --- a/export-all-patch.sh +++ b/export-all-patch.sh @@ -25,6 +25,6 @@ for patch in $ALLPATCHS_E; do read -n 1 fi - bash ~/buildtools/export-single-patch.sh $patch $PATCH_FILE + bash ~/bromite-buildtools/export-single-patch.sh $patch $PATCH_FILE done diff --git a/images/buildstack.env.example b/images/buildstack.env.example new file mode 100644 index 0000000..7b6ed7d --- /dev/null +++ b/images/buildstack.env.example @@ -0,0 +1 @@ +REMOTEEXEC_ADDR=:50051 diff --git a/images/buildstack.yml b/images/buildstack.yml index 813c4f1..f179320 100644 --- a/images/buildstack.yml +++ b/images/buildstack.yml @@ -1,6 +1,38 @@ version: "3.9" services: + runner-proxy: + image: uazo/privoxy + networks: + - bridge-ext + env_file: + - buildstack.env + volumes: + - /tmp/proxy:/tmp/proxy:rw + - /tmp/forward-proxy:/tmp/forward-proxy:rw + deploy: + mode: global + placement: + max_replicas_per_node: 1 + constraints: [node.labels.githubrunner == 1] + +# githubrunner: +# image: uazo/github-runner +# runtime: sysbox-runc +# depends_on: +# - runner-proxy +# networks: +# - bridge-int +# volumes: +# - /tmp/proxy:/tmp/proxy:rw +# - /tmp/forward-proxy:/tmp/forward-proxy:rw +# - /tmp/docker-inner:/var/lib/docker:rw +# deploy: +# mode: global +# placement: +# max_replicas_per_node: 1 +# constraints: [node.labels.githubrunner == 1] + buildboxcasd: image: uazo/buildboxcasd networks: @@ -28,6 +60,20 @@ services: max_replicas_per_node: 8 constraints: [node.labels.gomarunners == 8] + buildboxrunner-6: + image: uazo/buildboxrunner + networks: + - bridge-int + depends_on: + - buildboxcasd + volumes: + - /tmp/cache:/wrk-cache:rw + deploy: + replicas: 20 + placement: + max_replicas_per_node: 6 + constraints: [node.labels.gomarunners == 6] + buildboxrunner-4: image: uazo/buildboxrunner networks: