Compare commits
277 Commits
v91.0.4472
...
v97.0.4692
Author | SHA1 | Date | |
---|---|---|---|
|
489ae12c5c | ||
|
aeccb9578f | ||
|
71cd8c86b7 | ||
|
c7db69f56a | ||
|
9d7cb9236b | ||
|
dda16bfaab | ||
|
71d813bbb6 | ||
|
0b8d06a12c | ||
|
397576a9ba | ||
|
394e8fb6f1 | ||
|
b6734a4704 | ||
|
a92ed02b41 | ||
|
2aa199eecf | ||
|
3189860cc8 | ||
|
1cecd2c62e | ||
|
4db5e9c3d9 | ||
|
8adf08fb0d | ||
|
4684954d27 | ||
|
72eb8b6722 | ||
|
db6c230404 | ||
|
950ad532f9 | ||
|
d8324941ae | ||
|
2bf12def99 | ||
|
0a4506aebd | ||
|
6843f20c5e | ||
|
f9b1eaaf7a | ||
|
2dac12ddc2 | ||
|
33596c0fc1 | ||
|
0d4ee779ea | ||
|
cc2a7be277 | ||
|
65b1cee998 | ||
|
00e6db8635 | ||
|
265acb6dd2 | ||
|
5c93ab7d6c | ||
|
9fc297d1b0 | ||
|
53605d6156 | ||
|
9d611cc535 | ||
|
095f1c88ec | ||
|
50f63f923f | ||
|
a14daf975e | ||
|
5bb97ed80d | ||
|
200ca03d3c | ||
|
a170c403ca | ||
|
42751a4808 | ||
|
45f774099d | ||
|
3628a1b39b | ||
|
fa6c38e200 | ||
|
742e127d98 | ||
|
1907239cb4 | ||
|
94a046836d | ||
|
0f5975fbe5 | ||
|
92c459e2ea | ||
|
438bc539f2 | ||
|
dd4609a2f8 | ||
|
46a6636ee2 | ||
|
d9b1671f6d | ||
|
8de587281e | ||
|
4027914f7f | ||
|
6913c9024d | ||
|
74a1205a6c | ||
|
7aa7dfdcfa | ||
|
ff6231659d | ||
|
0453eb1466 | ||
|
8900e70c30 | ||
|
429bf167dc | ||
|
d3de108ec1 | ||
|
504e80b1a8 | ||
|
aea35c3256 | ||
|
8cdf7bb588 | ||
|
4c4a04f039 | ||
|
f33fe1b406 | ||
|
2a15536226 | ||
|
a02e1ecc56 | ||
|
ee9e7eee52 | ||
|
747bb64495 | ||
|
1c7b30eb4a | ||
|
ac5100b048 | ||
|
f4b90c3d12 | ||
|
072ea1336a | ||
|
8fcf94baec | ||
|
8eb7b5a193 | ||
|
b981c3de69 | ||
|
bd70da5e3a | ||
|
f14dac257d | ||
|
1276c3c905 | ||
|
2b4e41ca3a | ||
|
5c144ee742 | ||
|
d086a1a946 | ||
|
f832649fa9 | ||
|
ef7582b462 | ||
|
1ee3f5cf39 | ||
|
104ff35b95 | ||
|
b791f2928f | ||
|
6c8e6f2408 | ||
|
1cf32971c6 | ||
|
4903c26ffc | ||
|
5000b10dd5 | ||
|
0c48dad835 | ||
|
0a14f2493c | ||
|
43002a89da | ||
|
db7cddaefb | ||
|
ae444dcf23 | ||
|
2841f9118a | ||
|
e20518d819 | ||
|
c4958ba854 | ||
|
98f00109f3 | ||
|
647263bccb | ||
|
46ff9fe113 | ||
|
1e9f4bff87 | ||
|
c6bbd87a52 | ||
|
c03e54ab48 | ||
|
18bf8d6e41 | ||
|
d842577e61 | ||
|
81bc1e9c2e | ||
|
25fbab7270 | ||
|
ccd0517cf5 | ||
|
689f7b1abd | ||
|
81886a6785 | ||
|
47ee754190 | ||
|
556ba40cb0 | ||
|
8096b347c4 | ||
|
c6805fc246 | ||
|
0aeba2909b | ||
|
35c7a19990 | ||
|
111531546a | ||
|
20873e7f0a | ||
|
e52168d57c | ||
|
496fc2be52 | ||
|
3176e14604 | ||
|
3b0e563153 | ||
|
030babd8f1 | ||
|
ec30286955 | ||
|
d5a651b6b3 | ||
|
ec247c2ff8 | ||
|
657ee452fa | ||
|
ff51c10724 | ||
|
205577b1e7 | ||
|
88cb066fb0 | ||
|
8652584587 | ||
|
94064e733f | ||
|
2133526767 | ||
|
f4d90c447d | ||
|
9aa1294d11 | ||
|
0baf066b90 | ||
|
b1d8660386 | ||
|
6b72ff5daa | ||
|
f28cef7946 | ||
|
c3c3a84cf7 | ||
|
39cd20f263 | ||
|
0c5e573751 | ||
|
4ebe5857f7 | ||
|
20e6194685 | ||
|
c618fba296 | ||
|
c84a353f3b | ||
|
90c5ec8261 | ||
|
0014c3f5b2 | ||
|
44020e2303 | ||
|
e1c49af901 | ||
|
34ce200a7f | ||
|
af68a4afba | ||
|
65027daa17 | ||
|
1876342608 | ||
|
7c0faf0d80 | ||
|
968be3ee69 | ||
|
228297a813 | ||
|
5eb7a2fc0f | ||
|
5bc12295a9 | ||
|
4c6eb4718e | ||
|
f99c1058cc | ||
|
5aab93cb75 | ||
|
6d847db0e2 | ||
|
934a82208f | ||
|
97f82ee962 | ||
|
20dfb0c60a | ||
|
20ce175ee5 | ||
|
e1cae5872e | ||
|
532a0475bf | ||
|
5f239bfb4c | ||
|
348fbd5fed | ||
|
cc8189a871 | ||
|
300c1d4c06 | ||
|
6e976a45af | ||
|
5b1013c9e4 | ||
|
8355e73892 | ||
|
d9afa39915 | ||
|
e5c7e803c3 | ||
|
4737501a1f | ||
|
f68e4e77dc | ||
|
edecf413de | ||
|
45dec4f942 | ||
|
f8d4d72853 | ||
|
54a048de6e | ||
|
002a46b1a7 | ||
|
91741ab63e | ||
|
722f766a31 | ||
|
e49a2416e1 | ||
|
88a7fb072f | ||
|
ae85f2ad58 | ||
|
9f6fc5398b | ||
|
f7d16abfca | ||
|
066243c27a | ||
|
6406030146 | ||
|
ac11365c4d | ||
|
b1433fbfb6 | ||
|
3596a1c905 | ||
|
83c1bc041d | ||
|
4f94288ac0 | ||
|
28e8df14ff | ||
|
03f6666aa6 | ||
|
baacc1b7cf | ||
|
e4d2329545 | ||
|
55b8ca83bb | ||
|
950376b67b | ||
|
379ea54578 | ||
|
de6de42d5f | ||
|
63f30f772d | ||
|
06b7f13392 | ||
|
7d9063ac69 | ||
|
2d67eddf2a | ||
|
8a6fc9cda6 | ||
|
9c452f3346 | ||
|
cba16c550f | ||
|
f86e0eeb53 | ||
|
c296b0bb6c | ||
|
b77f581cbc | ||
|
095acb1a59 | ||
|
e9f4917166 | ||
|
7e9960477a | ||
|
797b9baeea | ||
|
6e7dd5afb2 | ||
|
72719ad42e | ||
|
050b981b32 | ||
|
e4c11d444a | ||
|
d5adab79bc | ||
|
9f625379fb | ||
|
2c58cc1dab | ||
|
0d852b169d | ||
|
f83cb919d3 | ||
|
a7f6772640 | ||
|
ec5b7f214f | ||
|
e670c18407 | ||
|
62679bd160 | ||
|
cd8af75a2b | ||
|
3c11a87c17 | ||
|
0eb719af8b | ||
|
4e5b6df9d8 | ||
|
b9c6c689c2 | ||
|
c1625b68cf | ||
|
9bb5cdeff4 | ||
|
e58eff1173 | ||
|
077fb3e9c5 | ||
|
f0c4aa2996 | ||
|
b8448a875e | ||
|
29fbc43b9e | ||
|
fe7a67ce52 | ||
|
5411f6206e | ||
|
0a416e5dc5 | ||
|
1a170243be | ||
|
d3dd56d62a | ||
|
419b047604 | ||
|
83b742f4d8 | ||
|
73a312f9f5 | ||
|
97b9ee7716 | ||
|
5a04d49059 | ||
|
ec97025e00 | ||
|
dbbbc5e9a7 | ||
|
b4d7faa2a5 | ||
|
072fd782b6 | ||
|
5b561eef26 | ||
|
8505561a95 | ||
|
ce8bbdc9ad | ||
|
f0d7e38d26 | ||
|
20cff1ca4a | ||
|
c937ac4150 | ||
|
877081a41b | ||
|
fc5844e57e | ||
|
91c92a47c8 |
423
.github/workflows/build_bromite_dev.yaml
vendored
Normal file
423
.github/workflows/build_bromite_dev.yaml
vendored
Normal file
@@ -0,0 +1,423 @@
|
||||
name: Build Bromite
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/bromite SHA'
|
||||
required: true
|
||||
default: '76745fde6ed75542f005ea5528f486df41c56da4'
|
||||
build:
|
||||
description: 'arch [arm64/x64]'
|
||||
required: true
|
||||
default: 'x64'
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'dev'
|
||||
debug:
|
||||
description: 'debug? [true/false]'
|
||||
required: true
|
||||
default: 'true'
|
||||
usegoma:
|
||||
description: 'Use goma? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
|
||||
env:
|
||||
BROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
USEGOMA: ${{ github.event.inputs.usegoma }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
GOMAJOBS: 60
|
||||
|
||||
jobs:
|
||||
check_images:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: bromite-buildtools
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Enable proxy on container
|
||||
shell: bash
|
||||
run: |
|
||||
if ! [[ -z "${HTTP_PROXY}" ]]; then
|
||||
PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
|
||||
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
||||
sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
|
||||
fi
|
||||
|
||||
- name: Get current chromium version
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir bromite
|
||||
cd bromite
|
||||
git init
|
||||
git remote add origin https://github.com/uazo/bromite
|
||||
git fetch origin $BROMITE_SHA
|
||||
git reset --hard FETCH_HEAD
|
||||
cd ..
|
||||
|
||||
export VERSION=$( cat ./bromite/build/RELEASE )
|
||||
rm -rf bromite
|
||||
|
||||
echo Current version is $VERSION
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
cd bromite-buildtools
|
||||
|
||||
- name: Checking build-deps for ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
--no-cache \
|
||||
bromite-buildtools/images/build-deps/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Checking chromium for ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
bromite-buildtools/images/chr-source/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Checking bromite for ${{ env.BROMITE_SHA }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$BROMITE_SHA --progress plain \
|
||||
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
bromite-buildtools/images/bromite-source/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Checking bromite-build for ${{ env.BROMITE_SHA }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \
|
||||
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
--no-cache \
|
||||
bromite-buildtools/images/bromite-build/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Mark image to build
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:build > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -eq "0" ]; then
|
||||
docker rmi uazo/bromite-build:build
|
||||
fi
|
||||
docker tag uazo/bromite-build:$BROMITE_SHA uazo/bromite-build:build
|
||||
|
||||
build:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
needs: check_images
|
||||
if: success()
|
||||
timeout-minutes: 720
|
||||
|
||||
services:
|
||||
gomaserver:
|
||||
image: uazo/goma-server
|
||||
volumes:
|
||||
- /tmp/proxy:/tmp/proxy
|
||||
- /redis:/var/lib/redis
|
||||
options: >-
|
||||
--health-cmd "hostname -I >/tmp/proxy/gomaserverip"
|
||||
--health-interval 30s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
container:
|
||||
image: uazo/bromite-build:build
|
||||
env:
|
||||
SERVER_HOST_GOMA: gomaserver
|
||||
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
|
||||
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
|
||||
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
|
||||
WORKSPACE: /home/lg/working_dir
|
||||
KYTHE_CORPUS: chromium.googlesource.com/chromium/src
|
||||
KYTHE_ROOT_DIRECTORY: /home/lg/working_dir/chromium/src
|
||||
KYTHE_OUTPUT_DIRECTORY: /home/lg/working_dir/chromium/src/out/bromite/kythe
|
||||
# compile in debug mode
|
||||
TARGET_ISDEBUG: ${{ github.event.inputs.debug }}
|
||||
TARGET_CPU: ${{ github.event.inputs.build }}
|
||||
volumes:
|
||||
- /storage/images/${{ github.event.inputs.build }}/${{ github.event.inputs.sha }}:/home/lg/working_dir/chromium/src/out/bromite
|
||||
- /tmp/proxy:/tmp/proxy
|
||||
|
||||
steps:
|
||||
- name: Prepare Build Container
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE
|
||||
|
||||
# reset proxy env
|
||||
HTTP_PROXY=
|
||||
HTTPS_PROXY=
|
||||
http_proxy=
|
||||
https_proxy=
|
||||
|
||||
# update hosts
|
||||
#sudo echo "$(cat /tmp/proxy/gomaserverip | xargs) gomaserver" >/etc/hosts
|
||||
#sudo echo "$(cat /tmp/proxy/redisip | xargs) redis" >/etc/hosts
|
||||
|
||||
# set goma options
|
||||
export SERVER_HOST_GOMA=$(cat /tmp/proxy/gomaserverip | xargs)
|
||||
export GOMA_SERVER_HOST=$SERVER_HOST_GOMA
|
||||
export GOMA_SERVER_PORT=5050
|
||||
export GOMA_USE_SSL=false
|
||||
export GOMA_HTTP_AUTHORIZATION_FILE=$WORKSPACE/.debug_auth_file
|
||||
export GOMA_HERMETIC=error
|
||||
export GOMA_USE_LOCAL=false
|
||||
export GOMA_FALLBACK=true
|
||||
export GOMA_ARBITRARY_TOOLCHAIN_SUPPORT=true
|
||||
export GOMA_MAX_SUBPROCS_LOW=0
|
||||
|
||||
# set out folder permissions
|
||||
test -d chromium/src/out/bromite || sudo mkdir -p chromium/src/out/bromite && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/bromite &&
|
||||
|
||||
# make kythe output directory
|
||||
test -d $KYTHE_OUTPUT_DIRECTORY || mkdir -p $KYTHE_OUTPUT_DIRECTORY
|
||||
|
||||
sudo mkdir -p /run/user/1000/
|
||||
sudo chown lg /run/user/1000/
|
||||
sudo chmod g-rxw /run/user/1000/
|
||||
sudo chmod o-rxw /run/user/1000/
|
||||
|
||||
# start goma client
|
||||
[[ "$USEGOMA" = "true" ]] && \
|
||||
echo "::group::-------- start goma client" && \
|
||||
$WORKSPACE/goma/goma_ctl.py ensure_stop && \
|
||||
$WORKSPACE/goma/goma_ctl.py ensure_start && \
|
||||
echo "::endgroup::" \
|
||||
|| true
|
||||
|
||||
cd chromium/src
|
||||
|
||||
OUT_PRESENT=0
|
||||
test -f out/bromite/prepare_gn && OUT_PRESENT=1
|
||||
if [[ OUT_PRESENT -eq 0 ]]; then
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
[[ "$USEGOMA" = "true" ]] && \
|
||||
gn gen --args="import(\"/home/lg/working_dir/bromite/build/GN_ARGS\") use_goma=true goma_dir=\"$WORKSPACE/goma\" $(cat ../../build_args.gni) " out/bromite \
|
||||
|| \
|
||||
gn gen --args="import(\"/home/lg/working_dir/bromite/build/GN_ARGS\") $(cat ../../build_args.gni) " out/bromite
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/bromite/ --list --short
|
||||
gn args out/bromite/ --list >out/bromite/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- apply .mtool"
|
||||
test -f out/bromite/.mtool && \
|
||||
cp out/bromite/.mtool .mtool && \
|
||||
$WORKSPACE/mtool/chromium/mtime.sh --restore
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "OK" >out/bromite/prepare_gn
|
||||
|
||||
fi
|
||||
|
||||
cp ../../bromite/build/RELEASE out/bromite
|
||||
|
||||
if [[ -z "${GOMAJOBS}" ]]; then
|
||||
GOMAJOBS=40
|
||||
fi
|
||||
|
||||
echo "::group::-------- pre-cache toolchain"
|
||||
[[ "$USEGOMA" = "true" ]] && \
|
||||
sudo ../../casupload --cas-server=unix:/tmp/proxy/bots.sock --instance=default_instance \
|
||||
third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include \
|
||||
third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/include \
|
||||
third_party/llvm-build/Release+Asserts/lib \
|
||||
third_party/llvm-build/Release+Asserts/bin \
|
||||
buildtools/third_party/libc++ \
|
||||
chrome/android/profiles/afdo.prof \
|
||||
|| true
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Build Bromite
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
[[ "$USEGOMA" = "true" ]] && \
|
||||
autoninja -j $GOMAJOBS -C out/bromite chrome_public_apk \
|
||||
|| \
|
||||
autoninja -C out/bromite chrome_public_apk
|
||||
|
||||
- name: Get ninja logs
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing $WORKSPACE/chromium/src/out/bromite/.ninja_log >$WORKSPACE/chromium/src/out/bromite/ninja_log_trace.json
|
||||
$WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/bromite/ninja_log_trace.json
|
||||
|
||||
- name: Get goma logs
|
||||
shell: bash
|
||||
run: |
|
||||
# reset proxy env
|
||||
HTTP_PROXY=
|
||||
HTTPS_PROXY=
|
||||
http_proxy=
|
||||
https_proxy=
|
||||
|
||||
[[ "$USEGOMA" = "true" ]] && \
|
||||
wget http://127.0.0.1:8088/logz?INFO -O out/bromite/goma-client.log \
|
||||
|| \
|
||||
echo Skipped.
|
||||
|
||||
- name: Generate breakpad symbols
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- generating breakpad symbols"
|
||||
autoninja -j $GOMAJOBS -C out/bromite minidump_stackwalk dump_syms
|
||||
components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/bromite \
|
||||
--symbols-dir=out/bromite/symbols/ --binary=out/bromite/lib.unstripped/libchrome.so \
|
||||
--platform=android --clear --verbose
|
||||
cp out/bromite/lib.unstripped/libchrome.so out/bromite/symbols/libchrome.lib.so
|
||||
cp out/bromite/minidump_stackwalk out/bromite/symbols
|
||||
cp out/bromite/dump_syms out/bromite/symbols
|
||||
echo "::endgroup::"
|
||||
|
||||
# - name: Generate kythe kzip
|
||||
# shell: bash
|
||||
# run: |
|
||||
# PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
# cd $WORKSPACE/chromium/src
|
||||
#
|
||||
# $WORKSPACE/ninja/ninja -C $WORKSPACE/chromium/src/out/bromite -a chrome_public_apk \
|
||||
# -t compdb cc cxx objc objcxx >$WORKSPACE/chromium/src/out/bromite/compile_commands.json
|
||||
# gn desc out/bromite 'chrome_public_apk' --format=json >out/bromite/gn_targets.json
|
||||
#
|
||||
# #python tools/clang/scripts/run_tool.py --tool translation_unit -p out/bromite/ --all || true
|
||||
# tools/clang/scripts/run_tool.py --tool translation_unit -p out/bromite || true
|
||||
# python /home/lg/add_kythe_metadata.py out/bromite/ --corpus $KYTHE_CORPUS || true
|
||||
#
|
||||
# /home/lg/package_index/latest/package_index \
|
||||
# --checkout_dir /home/lg/working_dir/chromium/src \
|
||||
# --path_to_compdb /home/lg/working_dir/chromium/src/out/bromite/compile_commands.json \
|
||||
# --path_to_gn_targets /home/lg/working_dir/chromium/src/out/bromite/gn_targets.json \
|
||||
# --path_to_java_kzips $KYTHE_OUTPUT_DIRECTORY \
|
||||
# --path_to_archive_output /home/lg/working_dir/chromium/src/out/bromite/chromium_linux.kzip \
|
||||
# --corpus $KYTHE_CORPUS \
|
||||
# --out_dir src/out/bromite || true
|
||||
|
||||
- name: Generate clangd index
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
test -f out/bromite/bromite.idx || \
|
||||
/home/lg/working_dir/clangd_snapshot_20211205/bin/clangd-indexer --executor=all-TUs out/bromite/compile_commands.json >out/bromite/bromite.idx
|
||||
|
||||
- name: Build junit tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
git log | grep FILE:Fix-build-test-suite.patch && TEST=1
|
||||
if [[ TEST -eq 1 ]]; then
|
||||
autoninja -j $GOMAJOBS -C out/bromite chrome_junit_tests
|
||||
autoninja -j $GOMAJOBS -C out/bromite components_junit_tests
|
||||
autoninja -j $GOMAJOBS -C out/bromite content_junit_tests
|
||||
autoninja -j $GOMAJOBS -C out/bromite base_junit_tests
|
||||
autoninja -j $GOMAJOBS -C out/bromite ui_junit_tests
|
||||
fi
|
||||
|
||||
- name: Build c++ tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
git log | grep FILE:Fix-build-test-suite.patch && TEST=1
|
||||
if [[ TEST -eq 1 ]]; then
|
||||
autoninja -j $GOMAJOBS -C out/bromite network_service
|
||||
autoninja -j $GOMAJOBS -C out/bromite unit_tests
|
||||
autoninja -j $GOMAJOBS -C out/bromite content_browsertests
|
||||
autoninja -j $GOMAJOBS -C out/bromite components_unittests
|
||||
autoninja -j $GOMAJOBS -C out/bromite components_browsertests
|
||||
fi
|
||||
|
||||
- name: Build instrumentation tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
git log | grep FILE:Fix-build-test-suite.patch && TEST=1
|
||||
if [[ TEST -eq 1 ]]; then
|
||||
autoninja -j $GOMAJOBS -C out/bromite content_shell_test_apk
|
||||
autoninja -j $GOMAJOBS -C out/bromite chrome_public_test_apk
|
||||
fi
|
||||
|
||||
- name: Stop goma
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- stop goma"
|
||||
[[ "$USEGOMA" = "true" ]] && $WORKSPACE/goma/goma_ctl.py ensure_stop || true
|
||||
[[ "$USEGOMA" = "true" ]] && find /tmp/ -maxdepth 1 -name "gomacc*" -print0 | xargs -0 rm || true
|
||||
[[ "$USEGOMA" = "true" ]] && rm -rf /tmp/goma_lg/ || true
|
||||
echo "::endgroup::"
|
130
.github/workflows/execute-tests.yaml
vendored
Normal file
130
.github/workflows/execute-tests.yaml
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
name: Execute Tests
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/bromite SHA'
|
||||
required: true
|
||||
default: 'ce2f07034a3d3b257e9bada65d8293a6786bb95f'
|
||||
|
||||
env:
|
||||
BROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
jobs:
|
||||
get_image:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Mark image to test
|
||||
shell: bash
|
||||
run: |
|
||||
docker tag uazo/bromite-build:$BROMITE_SHA uazo/bromite-build:test
|
||||
|
||||
exec-test:
|
||||
runs-on: self-hosted
|
||||
needs: get_image
|
||||
if: success()
|
||||
|
||||
container:
|
||||
image: uazo/bromite-build:test
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
|
||||
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
|
||||
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
|
||||
WORKSPACE: /home/lg/working_dir
|
||||
ARTIFACS_DIR: /home/lg/working_dir/artifacs
|
||||
volumes:
|
||||
- /storage/images/${{ github.event.inputs.sha }}/out:/home/lg/working_dir/chromium/src/out/bromite:r
|
||||
- /storage/images/${{ github.event.inputs.sha }}/out/tests:/home/lg/working_dir/chromium/src/out/tests
|
||||
options: --device=/dev/kvm
|
||||
|
||||
steps:
|
||||
- name: Prepare Test Container
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE
|
||||
|
||||
# copy artifacts
|
||||
#cd chromium/src
|
||||
#mkdir -p out/bromite
|
||||
#cp -arp $ARTIFACS_DIR/out/* out/bromite
|
||||
|
||||
rm -rf out/tests/*
|
||||
#mkdir -p out/tests
|
||||
|
||||
# reset proxy env
|
||||
#HTTP_PROXY=
|
||||
#HTTPS_PROXY=
|
||||
#http_proxy=
|
||||
#https_proxy=
|
||||
|
||||
# - name: Wait forever
|
||||
# shell: bash
|
||||
# run: |
|
||||
# sleep infinity
|
||||
|
||||
- name: Execute chrome junit test
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/bin/run_chrome_junit_tests --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
- name: Start Android Emulator
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
sudo mkdir -p /github/home/.android
|
||||
sudo chmod 666 /github/home/.android/
|
||||
tools/android/avd/avd.py install --avd-config ../../generic_android31.textpb -v
|
||||
tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v
|
||||
|
||||
- name: Execute unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/unit_tests -v --fast-local-dev --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
- name: Restart Android Emulator
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
pkill -f qemu-system-x86
|
||||
tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v
|
||||
|
||||
- name: Execute instrumentation tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/bin/run_chrome_public_test_apk -v --num-retries=1 --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
#- name: Wait forever
|
||||
# shell: bash
|
||||
# run: |
|
||||
# sleep infinity
|
||||
|
||||
- name: Copy results
|
||||
shell: bash
|
||||
run: |
|
||||
sudo cp -r $WORKSPACE/chromium/src/out/bromite/TEST_RESULTS* $WORKSPACE/chromium/src/out/tests/
|
||||
|
96
.github/workflows/release.yaml
vendored
Normal file
96
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
name: Release Bromite CI
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/bromite SHA'
|
||||
required: true
|
||||
default: '0a8ff322d6e9d738f7b2fa52618b178081bd100d'
|
||||
build:
|
||||
description: 'arch [arm64/x64]'
|
||||
required: true
|
||||
default: 'arm64'
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
debug:
|
||||
description: 'debug? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
usegoma:
|
||||
description: 'Use goma? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
|
||||
env:
|
||||
BROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
USEGOMA: ${{ github.event.inputs.usegoma }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
GOMAJOBS: 60
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
env:
|
||||
OUTPUTFILE: /storage/images/${{ github.event.inputs.build }}/${{ github.event.inputs.sha }}
|
||||
APK: ${{ github.event.inputs.build }}_ChromePublic.apk
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
|
||||
unzip pup_v0.4.0_linux_amd64.zip && rm pup_v0.4.0_linux_amd64.zip
|
||||
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$BROMITE_SHA | ./pup -p li.branch a text{})
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
wget https://github.com/cli/cli/releases/download/v2.4.0/gh_2.4.0_linux_amd64.tar.gz
|
||||
tar xfz gh_2.4.0_linux_amd64.tar.gz
|
||||
|
||||
- name: Checkout 'uazo/buildtools'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/bromite-buildtools'
|
||||
#ref: ${{ github.event.inputs.rtag }}
|
||||
path: 'bromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Copy artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
sudo cp ${{ env.OUTPUTFILE }}/apks/ChromePublic.apk ChromePublic.apk
|
||||
sudo chown runner ChromePublic.apk
|
||||
mv ChromePublic.apk $APK
|
||||
|
||||
- name: Create release
|
||||
shell: bash
|
||||
run: |
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | gh_2.4.0_linux_amd64/bin/gh auth login --with-token
|
||||
|
||||
cd bromite
|
||||
VERSION=v$(cat ${{ env.OUTPUTFILE }}/RELEASE)-${{ github.event.inputs.build }}
|
||||
../gh_2.4.0_linux_amd64/bin/gh release create $VERSION-$BROMITE_SHA \
|
||||
../$APK --notes ""
|
||||
|
||||
# - name: Enable proxy on container
|
||||
# shell: bash
|
||||
# run: |
|
||||
# if ! [[ -z "${HTTP_PROXY}" ]]; then
|
||||
# PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
|
||||
# echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
||||
# sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
# sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
|
||||
# fi
|
||||
|
||||
# - name: Release build ${{ github.event.inputs.build }}/${{ github.event.inputs.sha }}
|
||||
# uses: softprops/action-gh-release@v1
|
||||
# with:
|
||||
# draft: true
|
||||
# body: Apk for ${{ env.APK }} sha ${{ github.event.inputs.sha }}
|
||||
# files: ${{ env.APK }}
|
||||
# env:
|
||||
# HTTP_PROXY: ${{ env.PROXY_ADDR }}
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@
|
||||
################################################################################
|
||||
|
||||
/.vs
|
||||
images/github-runner/.env
|
||||
images/privoxy/privoxy.conf.save
|
||||
images/remote-index/bromite.idx
|
||||
|
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# bromite-buildtools
|
||||
|
||||
this repo contains my build machine and some scripts I use for Bromite development. the ci uses a modified version of the gihub runner (avaiable [here](https://github.com/uazo/runner)) and use [sysbox](https://github.com/nestybox/sysbox) to improve security. it also contains everything you need to use a self-hosted modified version of [goma](https://github.com/uazo/goma-server) for a multi-machine build
|
@@ -16,7 +16,7 @@ IFS=$'\n'
|
||||
|
||||
PATCH_LIST=~/bromite/build/bromite_patches_list_new.txt
|
||||
if [ ! -f $PATCH_LIST ]; then
|
||||
cp ~/bromite/build/bromite_patches_list.txt $PATCH_LIST
|
||||
cp ~/bromite/build/bromite_patches_list.txt $PATCH_LIST
|
||||
fi
|
||||
|
||||
echo "Phase 1: check clean"
|
||||
@@ -37,38 +37,48 @@ 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
|
||||
if [ -n "$SKIPAUTOGENERATED" ]; then
|
||||
if [[ "$current_file" == *"Automated-domain-substitution"* ]]; then
|
||||
echo ""
|
||||
echo -e ${RED} " -> Excluding $current_file" ${NC}
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $current_file >>$DESTINATION
|
||||
echo $PATCH_FILE
|
||||
bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_OLD_PATH/$current_file $PATCH_NEW_PATH || exit 1
|
||||
|
||||
echo ""
|
||||
LAST_COMMIT=$(git rev-parse HEAD)
|
||||
echo "Last Commit " $LAST_COMMIT
|
||||
bash ~/buildtools/export-single-patch.sh $LAST_COMMIT
|
||||
if [ -z "$SILENT" ]; then
|
||||
echo $current_file >>$DESTINATION
|
||||
echo $PATCH_FILE
|
||||
|
||||
#cp -r ~/bromite/build/patches-new/* ~/br2/bromite/build/patches/
|
||||
#git -C ~/br2/bromite/ add .
|
||||
#git -C ~/br2/bromite/ commit -m "$current_file"
|
||||
echo ""
|
||||
LAST_COMMIT=$(git rev-parse HEAD)
|
||||
echo "Last Commit " $LAST_COMMIT
|
||||
bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT || exit 1
|
||||
|
||||
#cp -r ~/bromite/build/patches-new/* ~/br2/bromite/build/patches/
|
||||
#git -C ~/br2/bromite/ add .
|
||||
#git -C ~/br2/bromite/ commit -m "$current_file"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
@@ -9,60 +9,100 @@ OK=0
|
||||
DOBUILD=1
|
||||
DOEXPORT=1
|
||||
|
||||
TEST=0
|
||||
git log | grep FILE:$(basename -- $PATCH) && TEST=1
|
||||
if [[ TEST -eq 1 ]]; then
|
||||
|
||||
echo "Patch $PATCH already exists. skipped." | tee -a ${LOG_FILE}
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
echo "" | tee -a ${LOG_FILE}
|
||||
echo "Applying patch $PATCH" | tee -a ${LOG_FILE}
|
||||
git apply --reject --whitespace=fix $PATCH && OK=1
|
||||
|
||||
if [[ OK -eq 0 ]]; then
|
||||
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";
|
||||
done
|
||||
OK=1
|
||||
for file in $(grep '+++ b/' $PATCH | sed -e 's#+++ [ab]/##'); do
|
||||
test -f $file || OK=0
|
||||
done
|
||||
|
||||
OK=1
|
||||
for file in $(find . -name *.rej); do
|
||||
echo "---Found: $file" | tee -a ${LOG_FILE};
|
||||
git add ${file::-4}
|
||||
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" || OK=0
|
||||
done
|
||||
|
||||
if [[ OK -eq 0 ]]; then
|
||||
DOBUILD=1
|
||||
echo "Current patch $PATCH" | tee -a ${LOG_FILE}
|
||||
echo "Patch not apply cleanly. Please fix... (next phase: build)" | tee -a ${LOG_FILE}
|
||||
echo "Press return"
|
||||
read -n 1
|
||||
else
|
||||
echo "Patch not apply cleanly. Wiggle done!" | tee -a ${LOG_FILE}
|
||||
fi
|
||||
for file in $(find . -name *.rej); do
|
||||
echo " Found: $file" | tee -a ${LOG_FILE};
|
||||
git add ${file::-4}
|
||||
OK=0
|
||||
done
|
||||
|
||||
echo " Deleting rej"
|
||||
if [[ OK -eq 0 ]]; then
|
||||
DOBUILD=1
|
||||
echo "Current patch $PATCH" | tee -a ${LOG_FILE}
|
||||
echo " Patch not apply cleanly. Please fix..." | tee -a ${LOG_FILE}
|
||||
if [ -n "$SILENT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
echo " Press return"
|
||||
read -n 1
|
||||
else
|
||||
echo " Patch not apply cleanly. Wiggle done!" | tee -a ${LOG_FILE}
|
||||
fi
|
||||
|
||||
echo " Deleting rej"
|
||||
find . -type f -name '*.rej' -delete
|
||||
find . -type f -name '*.porig' -delete
|
||||
|
||||
else
|
||||
echo "Patch apply cleanly." | tee -a ${LOG_FILE}
|
||||
DOBUILD=0
|
||||
echo "Patch apply cleanly." | tee -a ${LOG_FILE}
|
||||
DOBUILD=0
|
||||
fi
|
||||
|
||||
if [[ DOBUILD -eq 1 ]]; then
|
||||
OK=0
|
||||
echo "Building ${PATCH}: chrome_public_apk" | tee -a ${LOG_FILE}
|
||||
date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE}
|
||||
autoninja -C out/arm64 chrome_public_apk && OK=1
|
||||
date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE}
|
||||
OK=0
|
||||
#echo "Building ${PATCH}: chrome_public_apk" | tee -a ${LOG_FILE}
|
||||
#date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE}
|
||||
#autoninja -C out/arm64 chrome_public_apk && OK=1
|
||||
#date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE}
|
||||
|
||||
DOEXPORT=1
|
||||
DOEXPORT=1
|
||||
|
||||
fi
|
||||
|
||||
if [[ OK -eq 0 ]]; then
|
||||
echo "Read to add $PATCH. Press return"
|
||||
read -n 1
|
||||
|
||||
DOEXPORT=1
|
||||
if [ -z "$SILENT" ]; then
|
||||
echo "Read to add $PATCH. Press return"
|
||||
read -n 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ DOEXPORT -eq 1 ]]; then
|
||||
bash ~/buildtools/create-from-patch.sh $PATCH $2
|
||||
until false
|
||||
do
|
||||
bash ~/bromite-buildtools/create-from-patch.sh $PATCH $2 || exit 1
|
||||
|
||||
rm /tmp/1 /tmp/2 || true
|
||||
lsdiff $PATCH >/tmp/1
|
||||
lsdiff ../../bromite/build/patches-new/$(basename -- $PATCH) >/tmp/2
|
||||
STATUS="$(cmp --silent /tmp/1 /tmp/2; echo $?)"
|
||||
if [[ $STATUS -ne 0 ]]; then
|
||||
git reset HEAD^
|
||||
diff /tmp/1 /tmp/2
|
||||
echo "Some files are missing. Check again." | tee -a ${LOG_FILE}
|
||||
if [ -n "$SILENT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -r -p "y to continue [y/N] " response
|
||||
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||
bash ~/bromite-buildtools/create-from-patch.sh $PATCH $2 || exit 1
|
||||
break
|
||||
fi
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
41
clone-src.sh
Normal file
41
clone-src.sh
Normal file
@@ -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
|
||||
|
@@ -4,15 +4,15 @@ PATCH=$1
|
||||
|
||||
PLEASEWAIT=0
|
||||
if [[ $PATCH =~ ^+.* ]]; then
|
||||
PLEASEWAIT=1
|
||||
PATCH=${PATCH:1}
|
||||
PLEASEWAIT=1
|
||||
PATCH=${PATCH:1}
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
PATCH_NEW_PATH="~/bromite/build/patches-new"
|
||||
PATCH_NEW_PATH="~/bromite/build/patches-new"
|
||||
else
|
||||
PATCH_NEW_PATH=$2
|
||||
PATCH_NEW_PATH=$2
|
||||
fi
|
||||
|
||||
echo " Creating new patch"
|
||||
@@ -22,19 +22,19 @@ HEAD=$(sed -n '1,/---/ p' $PATCH | sed '/^---/d')
|
||||
CONTENT=$(git -C ~/chromium/src/ diff --cached --binary)
|
||||
|
||||
PATCH_FILE=$PATCH_NEW_PATH/$(basename $PATCH)
|
||||
rm $PATCH_FILE
|
||||
test -f $PATCH_FILE && rm $PATCH_FILE
|
||||
echo "$HEAD" >$PATCH_FILE
|
||||
|
||||
NEWLINE=$(tail -n 1 "$PATCH_FILE")
|
||||
echo $NEWLINE
|
||||
#echo $NEWLINE
|
||||
if [[ "$NEWLINE" == Subject:* ]]; then
|
||||
echo "" >>$PATCH_FILE
|
||||
echo "" >>$PATCH_FILE
|
||||
else
|
||||
NEWLINE=$(tail -n 2 "$PATCH_FILE" | head -n 1)
|
||||
if [[ "$NEWLINE" == Subject:* ]]; then
|
||||
echo "" >>$PATCH_FILE
|
||||
fi
|
||||
fi
|
||||
NEWLINE=$(tail -n 2 "$PATCH_FILE" | head -n 1)
|
||||
if [[ "$NEWLINE" == Subject:* ]]; then
|
||||
echo "" >>$PATCH_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "FILE:$(basename $PATCH)" >>$PATCH_FILE
|
||||
echo "---" >>$PATCH_FILE
|
||||
@@ -47,4 +47,13 @@ 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
|
||||
if [ -n "$SILENT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
echo "---> Failed to apply. Press return"
|
||||
read -n 1
|
||||
fi
|
||||
|
@@ -12,6 +12,10 @@ NO_NAME=1
|
||||
for patch in $ALLPATCHS_E; do
|
||||
|
||||
PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | grep FILE: | sed 's/FILE://g' | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||
if [[ "$PATCH_FILE" == *"Automated-domain-substitution"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -z "$PATCH_FILE" ]
|
||||
then
|
||||
#git -C ~/chromium/src/ show -s $patch
|
||||
@@ -25,6 +29,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
|
||||
|
@@ -33,8 +33,8 @@ sed -i '/^old mode /d' ~/bromite/build/patches-new/$PATCH_FILE
|
||||
sed -i '/^new mode /d' ~/bromite/build/patches-new/$PATCH_FILE
|
||||
|
||||
echo "-- " >> ~/bromite/build/patches-new/$PATCH_FILE
|
||||
echo "2.17.1" >> ~/bromite/build/patches-new/$PATCH_FILE
|
||||
echo "2.20.1" >> ~/bromite/build/patches-new/$PATCH_FILE
|
||||
echo "" >> ~/bromite/build/patches-new/$PATCH_FILE
|
||||
|
||||
echo " done."
|
||||
echo ""
|
||||
echo ""
|
||||
|
@@ -1,10 +1,9 @@
|
||||
ARG VERSION
|
||||
ARG BROMITE_SHA
|
||||
|
||||
FROM uazo/bromite:$VERSION
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
FROM uazo/bromite:$BROMITE_SHA
|
||||
|
||||
USER lg
|
||||
WORKDIR /home/lg/working_dir
|
||||
|
||||
COPY pre-start.sh .
|
||||
COPY start-build.sh .
|
||||
@@ -12,6 +11,11 @@ COPY goma_auth.py .
|
||||
COPY casupload .
|
||||
COPY build_args.gni .
|
||||
|
||||
COPY generic_android31.textpb .
|
||||
|
||||
ENV CIPD_CACHE_DIR=/home/lg/working_dir/.cipd_cache
|
||||
ENV VPYTHON_VIRTUALENV_ROOT=/home/lg/vpython_root
|
||||
|
||||
RUN sudo chmod +x ./start-build.sh \
|
||||
&& \
|
||||
sudo chmod +x ./pre-start.sh \
|
||||
@@ -20,5 +24,3 @@ RUN sudo chmod +x ./start-build.sh \
|
||||
&& \
|
||||
./pre-start.sh
|
||||
|
||||
CMD ./start-build.sh
|
||||
|
||||
|
34
images/bromite-build/action.yaml
Normal file
34
images/bromite-build/action.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
name: 'Prepare Bromite Builder Image'
|
||||
description: 'Check and build Bromite builder image by sha'
|
||||
|
||||
inputs:
|
||||
sha:
|
||||
description: 'Bromite sha ref'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checking image for "${{ inputs.sha }}"
|
||||
shell: bash
|
||||
run: |
|
||||
BROMITE_SHA="${{ inputs.sha }}"
|
||||
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
echo "Image not found"
|
||||
|
||||
mkdir bromite-source
|
||||
pushd bromite-source/
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
|
||||
cd bromite-buildtools/images/bromite-build/
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \
|
||||
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
||||
.
|
||||
|
||||
popd
|
||||
fi
|
||||
fi
|
@@ -1,7 +1,7 @@
|
||||
|
||||
declare_args() {
|
||||
_is_debug_build = ""
|
||||
target_cpu = "x86"
|
||||
target_cpu = "x64"
|
||||
}
|
||||
|
||||
_is_debug_build = getenv("TARGET_ISDEBUG")
|
||||
@@ -11,13 +11,19 @@ not_needed(["_target_build", "_is_debug_build"])
|
||||
if(getenv("TARGET_CPU") != "") {
|
||||
target_cpu = getenv("TARGET_CPU")
|
||||
}
|
||||
print("Target " + target_cpu)
|
||||
# print("Target " + target_cpu)
|
||||
|
||||
if(!(_is_debug_build == "")) {
|
||||
print("Debug build on")
|
||||
enable_kythe_annotations = true
|
||||
clang_use_chrome_plugins = false
|
||||
|
||||
if(_is_debug_build == "true") {
|
||||
# print("Debug build on")
|
||||
is_debug = true
|
||||
is_official_build = false
|
||||
dcheck_always_on = true
|
||||
symbol_level = 1
|
||||
strip_debug_info = false
|
||||
generate_linker_map = false
|
||||
} else {
|
||||
generate_linker_map = true
|
||||
}
|
||||
|
25
images/bromite-build/generic_android31.textpb
Normal file
25
images/bromite-build/generic_android31.textpb
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copyright 2021 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Configuration for a generic x86_64 android-12 AVD (userdebug build).
|
||||
|
||||
emulator_package {
|
||||
package_name: "chromium/third_party/android_sdk/public/emulator"
|
||||
version: "gMHhUuoQRKfxr-MBn3fNNXZtkAVXtOwMwT7kfx8jkIgC" # 30.7.5
|
||||
dest_path: ".emulator_sdk"
|
||||
}
|
||||
|
||||
system_image_package {
|
||||
package_name: "chromium/third_party/android_sdk/public/system-images/android-31/google_apis/x86_64"
|
||||
version: "R6Jh5_P21Euu-kdb11zcNjdJKN4vV1mdQTb8t4gph4IC" # 6
|
||||
dest_path: ".emulator_sdk"
|
||||
}
|
||||
system_image_name: "system-images;android-31;google_apis;x86_64"
|
||||
|
||||
avd_package {
|
||||
package_name: "chromium/third_party/android_sdk/public/avds/android-31/google_apis/x86_64"
|
||||
version: "Ur_zl6_BRKRkf_9X3SMZ3eH2auoOyJ2kLslpTZZwi3gC" # created in bb_id 8841388797862621664
|
||||
dest_path: ".android"
|
||||
}
|
||||
avd_name: "android_31_google_apis_x86_64"
|
@@ -4,7 +4,6 @@ RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
WORKSPACE=/home/lg/working_dir
|
||||
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$PATH
|
||||
|
||||
sudo apt-get install -y lsof libgoogle-glog-dev libprotobuf17 libgrpc++1 parallel golang-go
|
||||
@@ -13,6 +12,13 @@ echo -e ${RED} -------- download mtool ${NC}
|
||||
git clone https://github.com/bromite/mtool
|
||||
cd mtool
|
||||
make
|
||||
cd ..
|
||||
|
||||
echo -e ${RED} -------- download ninjatracing ${NC}
|
||||
git clone https://github.com/nico/ninjatracing
|
||||
|
||||
mkdir $CIPD_CACHE_DIR
|
||||
mkdir $VPYTHON_VIRTUALENV_ROOT
|
||||
|
||||
echo -e ${RED} -------- download goma client ${NC}
|
||||
cd $WORKSPACE
|
||||
@@ -20,3 +26,43 @@ cipd install infra/goma/client/linux-amd64 -root $WORKSPACE/goma
|
||||
|
||||
echo "nomatter" >$WORKSPACE/.debug_auth_file
|
||||
sudo cp $WORKSPACE/goma_auth.py $WORKSPACE/goma/
|
||||
|
||||
echo -e ${RED} -------- prepare vpython virtual environment ${NC}
|
||||
rm -rf /tmp/vpython*
|
||||
cd $WORKSPACE/chromium/src
|
||||
vpython -vpython-spec .vpython -vpython-root $VPYTHON_VIRTUALENV_ROOT -vpython-log-level debug -vpython-tool install
|
||||
vpython3 -vpython-spec .vpython3 -vpython-root $VPYTHON_VIRTUALENV_ROOT -vpython-log-level debug -vpython-tool install
|
||||
|
||||
echo -e ${RED} -------- download x86_64 android image ${NC}
|
||||
echo -e "\$ParanoidMode CheckIntegrity\n\nchromium/third_party/android_sdk/public/avds/android-31/google_apis/x86_64 Ur_zl6_BRKRkf_9X3SMZ3eH2auoOyJ2kLslpTZZwi3gC" | .cipd_client ensure -ensure-file - -root $WORKSPACE/chromium/src/.android
|
||||
echo -e "\$ParanoidMode CheckIntegrity\n\nchromium/third_party/android_sdk/public/emulator gMHhUuoQRKfxr-MBn3fNNXZtkAVXtOwMwT7kfx8jkIgC\nchromium/third_party/android_sdk/public/system-images/android-31/google_apis/x86_64 R6Jh5_P21Euu-kdb11zcNjdJKN4vV1mdQTb8t4gph4IC" | .cipd_client ensure -ensure-file - -root $WORKSPACE/chromium/src/.emulator_sdk
|
||||
|
||||
echo -e ${RED} -------- download kythe resources ${NC}
|
||||
wget https://chromium.googlesource.com/chromium/tools/build/+/main/recipes/recipe_modules/codesearch/resources/add_kythe_metadata.py?format=TEXT -O ~/add_kythe_metadata.py.base64
|
||||
base64 -d ~/add_kythe_metadata.py.base64 >~/add_kythe_metadata.py
|
||||
echo -e "infra/tools/package_index/linux-amd64 latest" | .cipd_client ensure -ensure-file - -root ~/package_index/latest
|
||||
|
||||
cd $WORKSPACE/
|
||||
wget https://github.com/kythe/kythe/releases/download/v0.0.55/kythe-v0.0.55.tar.gz
|
||||
tar xfz kythe-v0.0.55.tar.gz
|
||||
|
||||
# removed since fail download with
|
||||
# https://commondatastorage.9oo91eapis.qjz9zk/chromium-browser-clang/Linux_x64/translation_unit-llvmorg-14-init-5759-g02895eed-1.tgz
|
||||
python tools/clang/scripts/update.py --package=translation_unit
|
||||
|
||||
echo -e ${RED} -------- download bromite-buildtools ${NC}
|
||||
cd $WORKSPACE/
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
|
||||
echo -e ${RED} -------- compile modified ninja ${NC}
|
||||
cd $WORKSPACE/
|
||||
git clone https://github.com/ninja-build/ninja.git -b v1.8.2
|
||||
cd ninja
|
||||
git apply $WORKSPACE/bromite-buildtools/ninja-one-target-for-compdb.patch
|
||||
./configure.py --bootstrap
|
||||
|
||||
echo -e ${RED} -------- download clang indexer ${NC}
|
||||
cd $WORKSPACE/
|
||||
wget https://github.com/clangd/clangd/releases/download/snapshot_20211205/clangd_indexing_tools-linux-snapshot_20211205.zip
|
||||
unzip clangd_indexing_tools-linux-snapshot_20211205.zip
|
||||
rm clangd_indexing_tools-linux-snapshot_20211205.zip
|
||||
|
@@ -7,7 +7,7 @@ WORKSPACE=/home/lg/working_dir
|
||||
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
|
||||
export GOMA_SERVER_HOST=127.0.0.1
|
||||
export GOMA_SERVER_HOST=$SERVER_HOST_GOMA
|
||||
export GOMA_SERVER_PORT=5050
|
||||
export GOMA_USE_SSL=false
|
||||
export GOMA_HTTP_AUTHORIZATION_FILE=$WORKSPACE/.debug_auth_file
|
||||
@@ -31,7 +31,7 @@ if [[ OUT_PRESENT -eq 0 ]]; then
|
||||
cp -arp ../../artifacs/out/bromite/* out/bromite/
|
||||
|
||||
echo -e ${RED} -------- gn gen ${NC}
|
||||
gn gen --args="import(\"../../bromite/build/GN_ARGS\") use_goma=true goma_dir=\"$WORKSPACE/goma\" $(cat ../../build_args.gni) " out/bromite
|
||||
gn gen --args="import(\"/home/lg/working_dir/bromite/build/GN_ARGS\") use_goma=true goma_dir=\"$WORKSPACE/goma\" $(cat ../../build_args.gni) " out/bromite
|
||||
|
||||
echo -e ${RED} -------- gn args ${NC}
|
||||
gn args out/bromite/ --list --short
|
||||
|
@@ -1,16 +1,23 @@
|
||||
ARG VERSION
|
||||
|
||||
FROM uazo/chromium:$VERSION
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
|
||||
USER lg
|
||||
ARG BROMITE_SHA
|
||||
ENV BROMITE_SHA=$BROMITE_SHA
|
||||
|
||||
#USER lg
|
||||
WORKDIR /home/lg/working_dir
|
||||
|
||||
COPY apply-bromite-patches.sh .
|
||||
|
||||
RUN sudo chmod +x ./apply-bromite-patches.sh \
|
||||
&& \
|
||||
git clone https://github.com/bromite/bromite \
|
||||
&& \
|
||||
./apply-bromite-patches.sh
|
||||
RUN sudo chmod +x ./apply-bromite-patches.sh && \
|
||||
mkdir bromite && \
|
||||
cd bromite && \
|
||||
git init && \
|
||||
git remote add origin https://github.com/uazo/bromite && \
|
||||
git fetch origin $BROMITE_SHA && \
|
||||
git reset --hard FETCH_HEAD && \
|
||||
cd ..
|
||||
|
||||
RUN ./apply-bromite-patches.sh
|
||||
|
||||
|
41
images/bromite-source/action.yaml
Normal file
41
images/bromite-source/action.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
name: 'Prepare Bromite Source Image'
|
||||
description: 'Check and build Bromite sources image by version'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'Chromium Version (example 91.0.4472.146)'
|
||||
required: true
|
||||
|
||||
sha:
|
||||
description: 'Bromite sha ref'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checking image for "${{ inputs.sha }}"
|
||||
shell: bash
|
||||
run: |
|
||||
BROMITE_SHA="${{ inputs.sha }}"
|
||||
VERSION="${{ inputs.version }}"
|
||||
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
echo "Image not found"
|
||||
|
||||
mkdir bromite-source
|
||||
pushd bromite-source/
|
||||
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
|
||||
cd bromite-buildtools/images/bromite-source/
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$BROMITE_SHA --progress plain \
|
||||
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
||||
--build-arg VERSION=$VERSION \
|
||||
.
|
||||
|
||||
popd
|
||||
fi
|
||||
fi
|
@@ -9,6 +9,12 @@ cd chromium/src
|
||||
|
||||
echo -e ${RED} ------- apply patchs ${NC}
|
||||
for file in $(cat ../../bromite/build/bromite_patches_list.txt) ; do
|
||||
|
||||
#if [[ "$file" == *"Automated-domain-substitution"* ]]; then
|
||||
# echo -e ${RED} " -> Excluding $file" ${NC}
|
||||
# continue
|
||||
#fi
|
||||
|
||||
echo -e ${RED} " -> Apply $file" ${NC}
|
||||
|
||||
REPL="0,/^---/s//FILE:"$file"\n---/"
|
||||
|
@@ -1,9 +1,22 @@
|
||||
FROM ubuntu:20.04
|
||||
ARG VERSION
|
||||
|
||||
ARG HTTP_PROXY
|
||||
|
||||
ENV HTTP_PROXY=$HTTP_PROXY
|
||||
ENV http_proxy=$HTTP_PROXY
|
||||
|
||||
ENV HTTPS_PROXY=$HTTP_PROXY
|
||||
ENV https_proxy=$HTTP_PROXY
|
||||
|
||||
RUN touch /etc/apt/apt.conf.d/proxy.conf && \
|
||||
echo "Acquire::http::Proxy \"$HTTP_PROXY\";" >/etc/apt/apt.conf.d/proxy.conf
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
|
||||
RUN apt-get update &&\
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils python sed tzdata g++-multilib
|
||||
apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils python sed tzdata build-essential lib32gcc-9-dev
|
||||
|
||||
ENV user lg
|
||||
|
||||
@@ -11,27 +24,24 @@ RUN useradd -m -d /home/${user} ${user} && \
|
||||
chown -R ${user} /home/${user} && \
|
||||
adduser ${user} sudo && \
|
||||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
USER ${user}
|
||||
|
||||
#RUN mkdir -p /home/${user} && \
|
||||
# echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
WORKDIR /home/${user}
|
||||
|
||||
RUN wget https://chromium.googlesource.com/chromium/src/+/refs/tags/$VERSION/build/install-build-deps.sh?format=TEXT -O install-build-deps.sh.base64 \
|
||||
&& \
|
||||
wget https://chromium.googlesource.com/chromium/src/+/refs/tags/$VERSION/build/install-build-deps-android.sh?format=TEXT -O install-build-deps-android.sh.base64 \
|
||||
&& \
|
||||
sudo base64 -d install-build-deps.sh.base64 >install-build-deps.sh \
|
||||
&& \
|
||||
sudo base64 -d install-build-deps-android.sh.base64 >install-build-deps-android.sh \
|
||||
&& \
|
||||
sed -i 's/snapcraft/wget/' install-build-deps.sh
|
||||
|
||||
RUN chmod +x ./install-build-deps.sh \
|
||||
&& \
|
||||
chmod +x ./install-build-deps-android.sh \
|
||||
&& ls -la \
|
||||
&& \
|
||||
sudo bash ./install-build-deps-android.sh --no-prompt
|
||||
base64 -d install-build-deps.sh.base64 >install-build-deps.sh && \
|
||||
base64 -d install-build-deps-android.sh.base64 >install-build-deps-android.sh && \
|
||||
sed -i 's/snapcraft/wget/' install-build-deps.sh && \
|
||||
chmod +x ./install-build-deps.sh && \
|
||||
chmod +x ./install-build-deps-android.sh && \
|
||||
sudo ./install-build-deps.sh --no-prompt --lib32 --no-chromeos-fonts && \
|
||||
sudo ./install-build-deps-android.sh --no-prompt
|
||||
|
||||
|
||||
|
||||
|
32
images/build-deps/action.yaml
Normal file
32
images/build-deps/action.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: 'Prepare Build Deps Image'
|
||||
description: 'Check and build build deps image by version'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'Chromium Version (example 91.0.4472.146)'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checking image for "${{ inputs.version }}"
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION="${{ inputs.version }}"
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
echo "Image not found"
|
||||
|
||||
mkdir build-repo
|
||||
pushd build-repo/
|
||||
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
cd bromite-buildtools/images/build-deps/
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION --progress plain .
|
||||
|
||||
popd
|
||||
rm -rf build-repo
|
||||
fi
|
||||
fi
|
@@ -1,19 +1,19 @@
|
||||
ARG VERSION
|
||||
FROM uazo/build-deps:$VERSION
|
||||
FROM ubuntu:latest
|
||||
|
||||
ARG REMOTEEXEC_ADDR
|
||||
|
||||
ENV REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
USER lg
|
||||
COPY buildbox-casd .
|
||||
COPY set-perms.sh .
|
||||
|
||||
RUN sudo apt-get -f -y install libgoogle-glog-dev libprotobuf17 libgrpc++1 socat &&\
|
||||
sudo chmod +x buildbox-casd
|
||||
RUN apt-get update &&\
|
||||
apt-get -f -y install sudo libgoogle-glog-dev libprotobuf17 libgrpc++1 socat &&\
|
||||
sudo chmod +x buildbox-casd &&\
|
||||
sudo chmod +x set-perms.sh
|
||||
|
||||
CMD sudo rm -rf /wrk-cache/* &&\
|
||||
bash -c "socat UNIX-LISTEN:/wrk-cache/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &" &&\
|
||||
bash -c "socat -t10 UNIX-LISTEN:/wrk-cache/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &" &&\
|
||||
bash -c "$PWD/set-perms.sh &" &&\
|
||||
./buildbox-casd \
|
||||
--instance=default_instance \
|
||||
--cas-instance=default_instance \
|
||||
@@ -21,5 +21,3 @@ CMD sudo rm -rf /wrk-cache/* &&\
|
||||
--ra-remote=http://$REMOTEEXEC_ADDR \
|
||||
--verbose \
|
||||
/wrk-cache
|
||||
|
||||
|
||||
|
23
images/buildboxcasd/set-perms.sh
Normal file
23
images/buildboxcasd/set-perms.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
wait_file() {
|
||||
local file="$1"; shift
|
||||
local wait_seconds="${1:-10}"; shift # 10 seconds as default timeout
|
||||
|
||||
until test $((wait_seconds--)) -eq 0 -o -e "$file" ; do sleep 1; done
|
||||
|
||||
((++wait_seconds))
|
||||
}
|
||||
|
||||
echo "--Checking permissions bots.sock"
|
||||
wait_file "/wrk-cache/bots.sock" && {
|
||||
echo "--Set bots.sock permissions"
|
||||
sudo chmod 777 /wrk-cache/bots.sock
|
||||
}
|
||||
|
||||
echo "--Checking permissions casd.sock"
|
||||
wait_file "/wrk-cache/casd.sock" && {
|
||||
echo "--Set casd.sock permissions"
|
||||
sudo chmod 777 /wrk-cache/casd.sock
|
||||
}
|
||||
|
||||
echo "--Done"
|
@@ -1,26 +1,34 @@
|
||||
ARG VERSION
|
||||
FROM uazo/build-deps:$VERSION
|
||||
|
||||
ARG REMOTEEXEC_ADDR
|
||||
|
||||
ENV REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
USER lg
|
||||
COPY buildbox-worker .
|
||||
COPY buildbox-run-hosttools .
|
||||
|
||||
RUN HTTP_PROXY= &&\
|
||||
HTTPS_PROXY= &&\
|
||||
http_proxy= &&\
|
||||
https_proxy= &&\
|
||||
sudo rm /etc/apt/apt.conf.d/proxy.conf
|
||||
|
||||
RUN sudo apt-get -f -y install libgoogle-glog-dev libprotobuf17 libgrpc++1 &&\
|
||||
sudo chmod +x buildbox-worker &&\
|
||||
sudo chmod +x buildbox-run-hosttools
|
||||
|
||||
USER root
|
||||
|
||||
CMD PATH=.:$PATH &&\
|
||||
./buildbox-worker \
|
||||
--instance=default_instance \
|
||||
--bots-remote=unix:/wrk-cache/bots.sock \
|
||||
--stop-after=50 \
|
||||
--bots-retry-limit=5 \
|
||||
--buildbox-run=buildbox-run-hosttools \
|
||||
--cas-remote=unix:/wrk-cache/casd.sock \
|
||||
--logstream-remote=unix:/wrk-cache/casd.sock \
|
||||
--cas-instance=default_instance \
|
||||
--cas-retry-limit=10
|
||||
--cas-retry-limit=10 \
|
||||
--request-timeout=10 \
|
||||
--verbose
|
||||
|
1
images/buildstack.env.example
Normal file
1
images/buildstack.env.example
Normal file
@@ -0,0 +1 @@
|
||||
REMOTEEXEC_ADDR=<ip-address>:50051
|
@@ -8,12 +8,40 @@ services:
|
||||
env_file:
|
||||
- buildstack.env
|
||||
volumes:
|
||||
- /tmp/cache:/wrk-cache:rw
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
mode: global
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
|
||||
buildboxrunner-32:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
- bridge-int
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 40
|
||||
placement:
|
||||
max_replicas_per_node: 30
|
||||
constraints: [node.labels.gomarunners == 32]
|
||||
|
||||
buildboxrunner-12:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
- bridge-int
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 60
|
||||
placement:
|
||||
max_replicas_per_node: 12
|
||||
constraints: [node.labels.gomarunners == 12]
|
||||
|
||||
buildboxrunner-8:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
@@ -21,13 +49,27 @@ services:
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /tmp/cache:/wrk-cache:rw
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 20
|
||||
replicas: 60
|
||||
placement:
|
||||
max_replicas_per_node: 8
|
||||
constraints: [node.labels.gomarunners == 8]
|
||||
|
||||
buildboxrunner-6:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
- bridge-int
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 60
|
||||
placement:
|
||||
max_replicas_per_node: 6
|
||||
constraints: [node.labels.gomarunners == 6]
|
||||
|
||||
buildboxrunner-4:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
@@ -35,13 +77,27 @@ services:
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /tmp/cache:/wrk-cache:rw
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 20
|
||||
replicas: 60
|
||||
placement:
|
||||
max_replicas_per_node: 4
|
||||
constraints: [node.labels.gomarunners == 4]
|
||||
|
||||
buildboxrunner-2:
|
||||
image: uazo/buildboxrunner
|
||||
networks:
|
||||
- bridge-int
|
||||
depends_on:
|
||||
- buildboxcasd
|
||||
volumes:
|
||||
- /cache:/wrk-cache:rw
|
||||
deploy:
|
||||
replicas: 60
|
||||
placement:
|
||||
max_replicas_per_node: 2
|
||||
constraints: [node.labels.gomarunners == 2]
|
||||
|
||||
networks:
|
||||
bridge-int:
|
||||
driver: overlay
|
||||
|
@@ -4,11 +4,12 @@ FROM uazo/build-deps:$VERSION
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
|
||||
USER lg
|
||||
WORKDIR working_dir
|
||||
#USER lg
|
||||
WORKDIR /home/lg/working_dir
|
||||
|
||||
COPY prepare-build.sh .
|
||||
COPY depot_tools.diff .
|
||||
COPY remove_ninja_uploader.diff .
|
||||
|
||||
RUN sudo chmod +x ./prepare-build.sh \
|
||||
&& \
|
||||
|
32
images/chr-source/action.yaml
Normal file
32
images/chr-source/action.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: 'Prepare Chromium Sources Image'
|
||||
description: 'Check and build chromium source image by version'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'Chromium Version (example 91.0.4472.146)'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checking image for "${{ inputs.version }}"
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION="${{ inputs.version }}"
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
echo "Image not found"
|
||||
|
||||
mkdir chr-source
|
||||
pushd chr-sourced/
|
||||
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
cd bromite-buildtools/images/chr-source/
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION --progress plain --build-arg VERSION=$VERSION .
|
||||
|
||||
popd
|
||||
rm -rf chr-source
|
||||
fi
|
||||
fi
|
@@ -3,11 +3,6 @@
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
sudo chown lg .
|
||||
sudo chmod -R 775 .
|
||||
|
||||
mkdir aa
|
||||
|
||||
echo -e ${RED} -------- chromium version is: $VERSION ${NC}
|
||||
|
||||
echo -e ${RED} -------- cloning depot_tools ${NC}
|
||||
@@ -16,6 +11,7 @@ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
echo -e ${RED} -------- apply depot_tools patch ${NC}
|
||||
cd depot_tools/
|
||||
git apply ../depot_tools.diff
|
||||
git apply ../remove_ninja_uploader.diff
|
||||
cd ..
|
||||
|
||||
echo -e ${RED} -------- set envs ${NC}
|
||||
@@ -45,7 +41,11 @@ echo >>../.gclient " \"deps_file\" : 'DEPS',"
|
||||
echo >>../.gclient " \"managed\" : True,"
|
||||
echo >>../.gclient " \"custom_deps\" : {"
|
||||
echo >>../.gclient " },"
|
||||
echo >>../.gclient " \"custom_vars\": {},"
|
||||
echo >>../.gclient " \"custom_vars\": {"
|
||||
echo >>../.gclient " \"checkout_android_prebuilts_build_tools\": True,"
|
||||
echo >>../.gclient " \"checkout_telemetry_dependencies\": False,"
|
||||
echo >>../.gclient " \"codesearch\": 'Debug',"
|
||||
echo >>../.gclient " },"
|
||||
echo >>../.gclient " },"
|
||||
echo >>../.gclient "]"
|
||||
echo >>../.gclient "target_os=['android']"
|
||||
@@ -66,4 +66,5 @@ git config user.name "Your Name"
|
||||
echo -e ${RED} -------- running hooks ${NC}
|
||||
gclient runhooks
|
||||
|
||||
|
||||
echo -e ${RED} -------- download objdump ${NC}
|
||||
tools/clang/scripts/update.py --package=objdump
|
||||
|
12
images/chr-source/remove_ninja_uploader.diff
Normal file
12
images/chr-source/remove_ninja_uploader.diff
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/ninjalog_uploader_wrapper.py b/ninjalog_uploader_wrapper.py
|
||||
index fbfca3f2..3cd9e9b1 100755
|
||||
--- a/ninjalog_uploader_wrapper.py
|
||||
+++ b/ninjalog_uploader_wrapper.py
|
||||
@@ -75,6 +75,7 @@ You can find a more detailed explanation in
|
||||
|
||||
|
||||
def main():
|
||||
+ return 0
|
||||
config = LoadConfig()
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == 'opt-in':
|
62
images/docker-host/Dockerfile
Normal file
62
images/docker-host/Dockerfile
Normal file
@@ -0,0 +1,62 @@
|
||||
#FROM nestybox/ubuntu-focal-systemd-docker
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN set -xe && \
|
||||
echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \
|
||||
echo 'exit 101' >> /usr/sbin/policy-rc.d && \
|
||||
chmod +x /usr/sbin/policy-rc.d && \
|
||||
dpkg-divert --local --rename --add /sbin/initctl && \
|
||||
cp -a /usr/sbin/policy-rc.d /sbin/initctl && \
|
||||
sed -i 's/^exit.*/exit 0/' /sbin/initctl && \
|
||||
echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \
|
||||
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages && \
|
||||
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes && \
|
||||
echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests
|
||||
|
||||
RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
systemd systemd-sysv libsystemd0 ca-certificates dbus \
|
||||
iptables iproute2 kmod locales sudo udev && \
|
||||
echo "ReadKMsg=no" >> /etc/systemd/journald.conf && \
|
||||
apt-get clean -y && \
|
||||
rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \
|
||||
/usr/share/doc/* /usr/share/man/* /usr/share/local/* && \
|
||||
useradd --create-home --shell /bin/bash admin && \
|
||||
echo "admin:admin" | chpasswd && \
|
||||
adduser admin sudo
|
||||
|
||||
STOPSIGNAL SIGRTMIN+3
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install --no-install-recommends -y apt-transport-https ca-certificates \
|
||||
curl gnupg-agent software-properties-common && \
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
||||
apt-key fingerprint 0EBFCD88 && \
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
|
||||
apt-get update && apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io=1.4.4-1 && \
|
||||
apt-get clean -y && \
|
||||
rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \
|
||||
/usr/share/doc/* /usr/share/man/* /usr/share/local/* && \
|
||||
usermod -a -G docker admin
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
openssh-server && \
|
||||
mkdir /home/admin/.ssh && \
|
||||
chown admin:admin /home/admin/.ssh
|
||||
|
||||
# Extra deps
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
sudo \
|
||||
pigz \
|
||||
&& rm -rf /var/lib/apt/list/*
|
||||
|
||||
ENTRYPOINT ["/sbin/init", "--log-level=err"]
|
||||
CMD ["/bin/bash"]
|
6
images/github-runner/.env.example
Normal file
6
images/github-runner/.env.example
Normal file
@@ -0,0 +1,6 @@
|
||||
RUNNER_NAME=pd-gh-runner
|
||||
GITHUB_PERSONAL_TOKEN=<personal token>
|
||||
GITHUB_OWNER=<owner>
|
||||
GITHUB_REPOSITORY=<repository-name>
|
||||
RUNNER_LABELS=<label>
|
||||
ALLOWEDAUTHORSLIST=<list of allowes users comma separated>
|
120
images/github-runner/Dockerfile
Normal file
120
images/github-runner/Dockerfile
Normal file
@@ -0,0 +1,120 @@
|
||||
#FROM nestybox/ubuntu-focal-systemd-docker
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
|
||||
RUN set -xe && \
|
||||
echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \
|
||||
echo 'exit 101' >> /usr/sbin/policy-rc.d && \
|
||||
chmod +x /usr/sbin/policy-rc.d && \
|
||||
dpkg-divert --local --rename --add /sbin/initctl && \
|
||||
cp -a /usr/sbin/policy-rc.d /sbin/initctl && \
|
||||
sed -i 's/^exit.*/exit 0/' /sbin/initctl && \
|
||||
echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \
|
||||
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean && \
|
||||
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages && \
|
||||
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes && \
|
||||
echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests
|
||||
|
||||
RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
systemd systemd-sysv libsystemd0 ca-certificates dbus \
|
||||
iptables iproute2 kmod locales sudo udev socat && \
|
||||
echo "ReadKMsg=no" >> /etc/systemd/journald.conf && \
|
||||
apt-get clean -y && \
|
||||
rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \
|
||||
/usr/share/doc/* /usr/share/man/* /usr/share/local/* && \
|
||||
useradd --create-home --shell /bin/bash admin && \
|
||||
echo "admin:admin" | chpasswd && \
|
||||
adduser admin sudo
|
||||
|
||||
STOPSIGNAL SIGRTMIN+3
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install --no-install-recommends -y apt-transport-https ca-certificates \
|
||||
curl gnupg-agent software-properties-common && \
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
||||
apt-key fingerprint 0EBFCD88 && \
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
|
||||
apt-get update && apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io=1.4.4-1 && \
|
||||
apt-get clean -y && \
|
||||
rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \
|
||||
/usr/share/doc/* /usr/share/man/* /usr/share/local/* && \
|
||||
usermod -a -G docker admin
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y openssh-server && \
|
||||
mkdir /home/admin/.ssh && \
|
||||
chown admin:admin /home/admin/.ssh
|
||||
|
||||
#EXPOSE 22
|
||||
|
||||
# Extra deps for GHA Runner
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
curl \
|
||||
jq \
|
||||
sudo \
|
||||
unzip \
|
||||
wget \
|
||||
zip \
|
||||
git \
|
||||
pigz nano \
|
||||
&& rm -rf /var/lib/apt/list/*
|
||||
|
||||
# Add and config runner user as sudo
|
||||
# Remove default admin user
|
||||
# https://github.com/nestybox/dockerfiles/blob/master/ubuntu-focal-systemd/Dockerfile
|
||||
RUN useradd -m runner \
|
||||
&& usermod -aG sudo runner \
|
||||
&& usermod -aG docker runner \
|
||||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
|
||||
&& userdel -r admin
|
||||
|
||||
# Build args
|
||||
ARG TARGETPLATFORM=amd64
|
||||
ARG RUNNER_VERSION=2.302.4
|
||||
WORKDIR /runner
|
||||
|
||||
# Runner download supports amd64 as x64
|
||||
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
|
||||
&& if [ "$ARCH" = "amd64" ]; then export ARCH=x64 ; fi \
|
||||
&& curl -Ls -o runner.tar.gz https://github.com/uazo/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${ARCH}-${RUNNER_VERSION}.tar.gz \
|
||||
&& tar xzf ./runner.tar.gz \
|
||||
&& rm runner.tar.gz \
|
||||
&& ./bin/installdependencies.sh \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Dumb Init
|
||||
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
|
||||
&& curl -Ls -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_${ARCH} \
|
||||
&& chmod +x /usr/local/bin/dumb-init
|
||||
|
||||
#AWS client
|
||||
#RUN curl -Ls "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip \
|
||||
# && unzip awscliv2.zip \
|
||||
# && ./aws/install \
|
||||
# && rm -rf awscliv2.zip
|
||||
|
||||
COPY startup.sh /usr/local/bin/
|
||||
|
||||
# Add patched scripts from GHA runner (svc.sh and RunnerService.js)
|
||||
COPY --chown=runner:runner patched/ ./patched/
|
||||
|
||||
RUN chmod +x ./patched/runsvc.sh /usr/local/bin/startup.sh
|
||||
|
||||
USER runner
|
||||
|
||||
ENV HTTP_PROXY="http://127.0.0.1:8118"
|
||||
ENV HTTPS_PROXY="http://127.0.0.1:8118"
|
||||
ENV http_proxy="http://127.0.0.1:8118"
|
||||
ENV https_proxy="http://127.0.0.1:8118"
|
||||
COPY docker.default /etc/default/docker
|
||||
COPY proxy.conf /etc/apt/apt.conf.d/proxy.conf
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
||||
CMD ["startup.sh"]
|
2
images/github-runner/docker.default
Normal file
2
images/github-runner/docker.default
Normal file
@@ -0,0 +1,2 @@
|
||||
export http_proxy="http://127.0.0.1:8118"
|
||||
export https_proxy="http://127.0.0.1:8118"
|
91
images/github-runner/patched/RunnerService.js
Normal file
91
images/github-runner/patched/RunnerService.js
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright (c) GitHub. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
var childProcess = require("child_process");
|
||||
var path = require("path")
|
||||
|
||||
var supported = ['linux', 'darwin']
|
||||
|
||||
if (supported.indexOf(process.platform) == -1) {
|
||||
console.log('Unsupported platform: ' + process.platform);
|
||||
console.log('Supported platforms are: ' + supported.toString());
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var stopping = false;
|
||||
var listener = null;
|
||||
|
||||
var runService = function() {
|
||||
var listenerExePath = path.join(__dirname, '../bin/Runner.Listener');
|
||||
var interactive = process.argv[2] === "interactive";
|
||||
|
||||
if(!stopping) {
|
||||
try {
|
||||
if (interactive) {
|
||||
console.log('Starting Runner listener interactively');
|
||||
listener = childProcess.spawn(listenerExePath, ['run'].concat(process.argv.slice(3)), { env: process.env });
|
||||
} else {
|
||||
console.log('Starting Runner listener with startup type: service');
|
||||
listener = childProcess.spawn(listenerExePath, ['run', '--startuptype', 'service'].concat(process.argv.slice(2)), { env: process.env });
|
||||
}
|
||||
|
||||
console.log('Started listener process');
|
||||
|
||||
listener.stdout.on('data', (data) => {
|
||||
process.stdout.write(data.toString('utf8'));
|
||||
});
|
||||
|
||||
listener.stderr.on('data', (data) => {
|
||||
process.stdout.write(data.toString('utf8'));
|
||||
});
|
||||
|
||||
listener.on('close', (code) => {
|
||||
console.log(`Runner listener exited with error code ${code}`);
|
||||
|
||||
if (code === 0) {
|
||||
console.log('Runner listener exit with 0 return code, stop the service, no retry needed.');
|
||||
stopping = true;
|
||||
} else if (code === 1) {
|
||||
console.log('Runner listener exit with terminated error, stop the service, no retry needed.');
|
||||
stopping = true;
|
||||
} else if (code === 2) {
|
||||
console.log('Runner listener exit with retryable error, re-launch runner in 5 seconds.');
|
||||
} else if (code === 3) {
|
||||
console.log('Runner listener exit because of updating, re-launch runner in 5 seconds.');
|
||||
} else {
|
||||
console.log('Runner listener exit with undefined return code, re-launch runner in 5 seconds.');
|
||||
}
|
||||
|
||||
if(!stopping) {
|
||||
setTimeout(runService, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
} catch(ex) {
|
||||
console.log(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runService();
|
||||
console.log('Started running service');
|
||||
|
||||
var gracefulShutdown = function(code) {
|
||||
console.log('Shutting down runner listener');
|
||||
stopping = true;
|
||||
if (listener) {
|
||||
console.log('Sending SIGINT to runner listener to stop');
|
||||
listener.kill('SIGINT');
|
||||
|
||||
// TODO wait for 30 seconds and send a SIGKILL
|
||||
}
|
||||
}
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
gracefulShutdown(0);
|
||||
});
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
gracefulShutdown(0);
|
||||
});
|
20
images/github-runner/patched/runsvc.sh
Normal file
20
images/github-runner/patched/runsvc.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# convert SIGTERM signal to SIGINT
|
||||
# for more info on how to propagate SIGTERM to a child process see: http://veithen.github.io/2014/11/16/sigterm-propagation.html
|
||||
trap 'kill -INT $PID' TERM INT
|
||||
|
||||
if [ -f ".path" ]; then
|
||||
# configure
|
||||
export PATH=`cat .path`
|
||||
echo ".path=${PATH}"
|
||||
fi
|
||||
|
||||
# insert anything to setup env when running as a service
|
||||
|
||||
# run the host process which keep the listener alive
|
||||
./externals/node12/bin/node ./bin/RunnerService.js $* &
|
||||
PID=$!
|
||||
wait $PID
|
||||
trap - TERM INT
|
||||
wait $PID
|
1
images/github-runner/proxy.conf
Normal file
1
images/github-runner/proxy.conf
Normal file
@@ -0,0 +1 @@
|
||||
Acquire::http::Proxy "http://127.0.0.1:8118";
|
47
images/github-runner/start-runner.sh
Executable file
47
images/github-runner/start-runner.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker stop gh-proxy
|
||||
|
||||
GHRUNNERHOME=~/gh-runner
|
||||
sudo rm -rf $GHRUNNERHOME/tmp
|
||||
|
||||
SYSBOX_UID=$(cat /etc/subuid | grep sysbox | cut -d : -f 2)
|
||||
mkdir -p $GHRUNNERHOME/tmp/proxy
|
||||
mkdir -p $GHRUNNERHOME/tmp/forward-proxy
|
||||
mkdir -p $GHRUNNERHOME/redis
|
||||
|
||||
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/proxy
|
||||
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/forward-proxy
|
||||
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/redis
|
||||
#sudo rm $GHRUNNERHOME/var/run/docker.socks
|
||||
#sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
|
||||
|
||||
docker run --rm -d --runtime=sysbox-runc \
|
||||
--name=gh-proxy \
|
||||
-e "REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR" \
|
||||
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
|
||||
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
|
||||
uazo/squid
|
||||
|
||||
docker logs gh-proxy
|
||||
|
||||
while true
|
||||
do
|
||||
#sudo chown -R $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
|
||||
|
||||
docker run --runtime=sysbox-runc --name=gh-runner -ti --rm \
|
||||
--env-file=.env \
|
||||
-v $GHRUNNERHOME/docker-inner/:/var/lib/docker/:rw \
|
||||
-v /storage/images:/storage/images:rw \
|
||||
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
|
||||
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
|
||||
-v $GHRUNNERHOME/redis:/redis:rw \
|
||||
-v $GHRUNNERHOME/var/run:/var/run \
|
||||
--network none \
|
||||
--device=/dev/kvm \
|
||||
uazo/github-runner
|
||||
|
||||
echo "You can stop now"
|
||||
sleep 5s
|
||||
|
||||
done
|
62
images/github-runner/startup.sh
Normal file
62
images/github-runner/startup.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting Proxy Support"
|
||||
socat TCP-LISTEN:8118,reuseaddr,fork UNIX-CLIENT:/tmp/forward-proxy/proxy.sock &
|
||||
sudo iptables -A INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
sudo iptables -A INPUT -p tcp --dport 8118 -j DROP
|
||||
|
||||
echo "Starting supervisor (Docker)"
|
||||
sudo service docker start
|
||||
|
||||
#bash
|
||||
|
||||
if [ -n "${GITHUB_REPOSITORY}" ]
|
||||
then
|
||||
auth_url="https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPOSITORY}/actions/runners/registration-token"
|
||||
registration_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPOSITORY}"
|
||||
else
|
||||
auth_url="https://api.github.com/orgs/${GITHUB_OWNER}/actions/runners/registration-token"
|
||||
registration_url="https://github.com/${GITHUB_OWNER}"
|
||||
fi
|
||||
|
||||
generate_token() {
|
||||
payload=$(curl -sX POST -H "Authorization: token ${GITHUB_PERSONAL_TOKEN}" "${auth_url}")
|
||||
runner_token=$(echo "${payload}" | jq .token --raw-output)
|
||||
|
||||
if [ "${runner_token}" == "null" ]
|
||||
then
|
||||
echo "${payload}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${runner_token}"
|
||||
}
|
||||
|
||||
remove_runner() {
|
||||
sudo service docker stop
|
||||
./config.sh remove --unattended --token "$(generate_token)"
|
||||
}
|
||||
|
||||
service docker status
|
||||
runner_id=${RUNNER_NAME}_$(openssl rand -hex 6)
|
||||
echo "Registering runner ${runner_id}"
|
||||
|
||||
./config.sh \
|
||||
--name "${runner_id}" \
|
||||
--labels "${RUNNER_LABELS}" \
|
||||
--token "$(generate_token)" \
|
||||
--url "${registration_url}" \
|
||||
--allowedauthorslist "${ALLOWEDAUTHORSLIST}" \
|
||||
--unattended \
|
||||
--replace
|
||||
|
||||
trap 'remove_runner; exit 130' SIGINT
|
||||
trap 'remove_runner; exit 143' SIGTERM
|
||||
|
||||
for f in runsvc.sh RunnerService.js; do
|
||||
mv bin/${f}{,.bak}
|
||||
mv {patched,bin}/${f}
|
||||
done
|
||||
|
||||
./bin/runsvc.sh --once "$*"
|
||||
remove_runner
|
@@ -6,7 +6,7 @@ COPY config-file .
|
||||
|
||||
RUN apt-get update \
|
||||
&& \
|
||||
apt-get -y install sudo wget git socat \
|
||||
apt-get -y install sudo wget git socat redis-server \
|
||||
&& \
|
||||
sudo chmod +x ./install-goma-server.sh \
|
||||
&& \
|
||||
|
@@ -17,3 +17,8 @@ rm go1.16.2.linux-amd64.tar.gz
|
||||
echo -e ${RED} -------- cloning goma-server ${NC}
|
||||
|
||||
git clone https://github.com/uazo/goma-server
|
||||
|
||||
cd goma-server
|
||||
/usr/local/go/bin/go run ./cmd/remoteexec_proxy/main.go --preload=true
|
||||
|
||||
cd ..
|
||||
|
@@ -3,17 +3,19 @@
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
#export REDISHOST=localhost
|
||||
echo -e ${RED} -------- start redis-server ${NC}
|
||||
|
||||
export REDISHOST=localhost
|
||||
sudo redis-server /etc/redis/redis.conf
|
||||
|
||||
echo -e ${RED} -------- start goma-server ${NC}
|
||||
|
||||
test -f /tmp/proxy/bots.sock && sudo rm /tmp/proxy/bots.sock
|
||||
socat UNIX-LISTEN:/tmp/proxy/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &
|
||||
socat TCP-LISTEN:50051,reuseaddr,fork UNIX-CLIENT:/tmp/proxy/bots.sock &
|
||||
|
||||
cd ./goma-server/
|
||||
/usr/local/go/bin/go run ./cmd/remoteexec_proxy/main.go \
|
||||
--port 5050 \
|
||||
--remoteexec-addr $REMOTEEXEC_ADDR \
|
||||
--remoteexec-addr 127.0.0.1:50051 \
|
||||
--remote-instance-name default_instance \
|
||||
--insecure-remoteexec \
|
||||
--allowed-users ppp \
|
||||
|
20
images/remote-index/Dockerfile
Normal file
20
images/remote-index/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM debian:stable
|
||||
RUN apt-get update -y && apt-get upgrade -y
|
||||
RUN apt-get install -y cron python3 python3-requests unzip nginx-light wget unzip
|
||||
# We install pip, jinja and delete pip afterwards in same step to keep final
|
||||
# image size small.
|
||||
RUN apt-get install -y --no-install-recommends python3-pip && \
|
||||
pip3 install j2cli && apt-get remove -y python3-pip && apt-get autoremove -y
|
||||
RUN rm -rf /var/www/html/*
|
||||
#WORKDIR "/"
|
||||
|
||||
RUN wget https://github.com/clangd/clangd/releases/download/snapshot_20211205/clangd_indexing_tools-linux-snapshot_20211205.zip && \
|
||||
unzip clangd_indexing_tools-linux-snapshot_20211205.zip && \
|
||||
rm clangd_indexing_tools-linux-snapshot_20211205.zip
|
||||
|
||||
ADD bromite.idx .
|
||||
ADD entry_point.sh .
|
||||
|
||||
RUN chmod +x ./entry_point.sh
|
||||
|
||||
ENTRYPOINT ["./entry_point.sh"]
|
11
images/remote-index/entry_point.sh
Normal file
11
images/remote-index/entry_point.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
until ./clangd_snapshot_20211205/bin/clangd-index-server \
|
||||
/bromite.idx /home/lg/working_dir/chromium/src \
|
||||
--server-address="0.0.0.0:50051" \
|
||||
--limit-results=99999999999
|
||||
do
|
||||
echo "Restarting index-server. Exited with code $?." >&2
|
||||
sleep 1
|
||||
done
|
||||
|
20
images/remote-index/generate.sh
Normal file
20
images/remote-index/generate.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "${DOCKER_SOCK}" ]]; then
|
||||
echo "Please set DOCKER_SOCK env variable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${DEV_CONTAINER}" ]]; then
|
||||
echo "Please set DEV_CONTAINER env variable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo docker -H $DOCKER_SOCK cp $DEV_CONTAINER:/home/lg/working_dir/chromium/src/out/bromite/bromite.idx .
|
||||
sudo docker -H $DOCKER_SOCK cp $DEV_CONTAINER:/home/lg/working_dir/bromite/build/RELEASE .
|
||||
|
||||
INDEX_VERSION=$(cat RELEASE)
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-remote-index:$INDEX_VERSION \
|
||||
--progress plain \
|
||||
--no-cache \
|
||||
.
|
12
images/squid/Dockerfile
Normal file
12
images/squid/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
COPY whitelist /etc/squid/whitelist
|
||||
COPY squid.conf /etc/squid/squid.conf
|
||||
COPY start-proxy.sh .
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y squid bash sudo socat
|
||||
|
||||
CMD sudo chmod +x ./start-proxy.sh &&\
|
||||
./start-proxy.sh
|
23
images/squid/squid.conf
Normal file
23
images/squid/squid.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
http_port 8118
|
||||
|
||||
acl localnet src 10.0.0.0/8 # RFC 1918 possible internal network
|
||||
acl localnet src 172.16.0.0/12 # RFC 1918 possible internal network
|
||||
acl localnet src 192.168.0.0/16 # RFC 1918 possible internal network
|
||||
|
||||
acl SSL_ports port 443
|
||||
acl Safe_ports port 80
|
||||
acl Safe_ports port 443
|
||||
acl CONNECT method CONNECT
|
||||
|
||||
acl whitelist dstdomain "/etc/squid/whitelist"
|
||||
http_access deny !whitelist
|
||||
|
||||
debug_options ALL,1 28,3 33,2
|
||||
|
||||
http_access deny manager
|
||||
http_access deny !Safe_ports
|
||||
http_access deny CONNECT !SSL_ports
|
||||
|
||||
http_access allow localhost
|
||||
http_access allow localnet
|
||||
http_access deny all
|
13
images/squid/start-proxy.sh
Normal file
13
images/squid/start-proxy.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo Connect /tmp/forward-proxy/proxy.sock to 127.0.0.1:8118
|
||||
test -e /tmp/forward-proxy/proxy.sock && sudo rm /tmp/forward-proxy/proxy.sock
|
||||
socat UNIX-LISTEN:/tmp/forward-proxy/proxy.sock,reuseaddr,fork TCP:127.0.0.1:8118 &
|
||||
sudo chmod 777 /tmp/forward-proxy/proxy.sock
|
||||
|
||||
echo Connect /tmp/proxy/bots.sock to $REMOTEEXEC_ADDR
|
||||
test -e /tmp/proxy/bots.sock && sudo rm /tmp/proxy/bots.sock
|
||||
socat UNIX-LISTEN:/tmp/proxy/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &
|
||||
sudo chmod 777 /tmp/proxy/bots.sock
|
||||
|
||||
squid -N
|
19
images/squid/whitelist
Normal file
19
images/squid/whitelist
Normal file
@@ -0,0 +1,19 @@
|
||||
.github.com
|
||||
.docker.io
|
||||
.docker.com
|
||||
.githubusercontent.com
|
||||
.ubuntu.com
|
||||
|
||||
# for buildeps
|
||||
#chromium.googlesource.com
|
||||
|
||||
# for chr-source
|
||||
chrome-infra-packages.appspot.com
|
||||
.googleapis.com
|
||||
.googlesource.com
|
||||
|
||||
# for goma client
|
||||
#chrome-infra-packages.appspot.com
|
||||
|
||||
# for pip
|
||||
.pypi.org
|
@@ -37,7 +37,7 @@ instances:
|
||||
caches:
|
||||
- !lru-action-cache &build-cache
|
||||
storage: *cas-storage
|
||||
max-cached-refs: 256
|
||||
max-cached-refs: 2560
|
||||
cache-failed-actions: true
|
||||
allow-updates: true
|
||||
|
||||
@@ -50,6 +50,7 @@ instances:
|
||||
action-cache: *build-cache
|
||||
scheduler: *state-database
|
||||
max-execution-timeout: 7200
|
||||
# permissive-bot-session: True
|
||||
|
||||
- !cas
|
||||
storage: *cas-storage
|
||||
@@ -57,4 +58,4 @@ instances:
|
||||
- !bytestream
|
||||
storage: *cas-storage
|
||||
|
||||
thread-pool-size: 5000
|
||||
thread-pool-size: 500
|
||||
|
10
images/test32bit/Dockerfile
Normal file
10
images/test32bit/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM ubuntu:20.04
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN apt-get update && \
|
||||
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 sudo
|
||||
|
||||
COPY bytecode_builtins_list_generator .
|
||||
COPY gen-regexp-special-case .
|
||||
COPY torque .
|
||||
|
||||
ENTRYPOINT ["bash"]
|
BIN
images/test32bit/bytecode_builtins_list_generator
Executable file
BIN
images/test32bit/bytecode_builtins_list_generator
Executable file
Binary file not shown.
BIN
images/test32bit/gen-regexp-special-case
Executable file
BIN
images/test32bit/gen-regexp-special-case
Executable file
Binary file not shown.
BIN
images/test32bit/torque
Executable file
BIN
images/test32bit/torque
Executable file
Binary file not shown.
121
ninja-one-target-for-compdb.patch
Normal file
121
ninja-one-target-for-compdb.patch
Normal file
@@ -0,0 +1,121 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 8 Dec 2021 11:08:45 +0000
|
||||
Subject: Allow 'ninja -t compdb' accept one target
|
||||
|
||||
---
|
||||
src/ninja.cc | 64 +++++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 61 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/ninja.cc b/src/ninja.cc
|
||||
index ed004ac8f1fe1a5107db8b1f5c02c4ba957daef4..bbb79da561ddec497863230cd99ffbe98b9a76e5 100644
|
||||
--- a/src/ninja.cc
|
||||
+++ b/src/ninja.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <unordered_set>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "getopt.h"
|
||||
@@ -73,6 +74,8 @@ struct Options {
|
||||
|
||||
/// Whether phony cycles should warn or print an error.
|
||||
bool phony_cycle_should_err;
|
||||
+
|
||||
+ const char* user_given_target;
|
||||
};
|
||||
|
||||
/// The Ninja main() loads up a series of data structures; various tools need
|
||||
@@ -211,6 +214,7 @@ void Usage(const BuildConfig& config) {
|
||||
" -l N do not start new jobs if the load average is greater than N\n"
|
||||
" -n dry run (don't run commands but act like they succeeded)\n"
|
||||
" -v show all command lines while building\n"
|
||||
+" -a generate compilation database for given target\n"
|
||||
"\n"
|
||||
" -d MODE enable debugging (use -d list to list modes)\n"
|
||||
" -t TOOL run a subtool (use -t list to list subtools)\n"
|
||||
@@ -662,7 +666,56 @@ void EncodeJSONString(const char *str) {
|
||||
}
|
||||
}
|
||||
|
||||
+bool GetAllDependentEdges(Node* node, std::vector<Edge*>* depend_edges,
|
||||
+ std::unordered_set<Node*>* visited_nodes=NULL,
|
||||
+ std::unordered_set<Edge*>* visited_edges=NULL) {
|
||||
+ if (visited_nodes == NULL || visited_edges == NULL) {
|
||||
+ std::unordered_set<Node*> visited_nodes_;
|
||||
+ std::unordered_set<Edge*> visited_edges_;
|
||||
+ return GetAllDependentEdges(node, depend_edges, &visited_nodes_, &visited_edges_);
|
||||
+ }
|
||||
+ if (node == NULL || depend_edges == NULL) {
|
||||
+ Error("Internal error");
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (visited_nodes->count(node)) {
|
||||
+ return true;
|
||||
+ } else {
|
||||
+ visited_nodes->insert(node);
|
||||
+ }
|
||||
+ Edge* edge = node->in_edge();
|
||||
+ // Leaf node
|
||||
+ if (!edge || visited_edges->count(edge)) {
|
||||
+ return true;
|
||||
+ } else {
|
||||
+ visited_edges->insert(edge);
|
||||
+ depend_edges->push_back(edge);
|
||||
+ }
|
||||
+ for (Node* input_node : edge->inputs_) {
|
||||
+ if (!GetAllDependentEdges(input_node, depend_edges, visited_nodes, visited_edges))
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
int NinjaMain::ToolCompilationDatabase(const Options* options, int argc, char* argv[]) {
|
||||
+ std::vector<Edge*>* edges_to_process = &(state_.edges_);
|
||||
+
|
||||
+ if (options->user_given_target) {
|
||||
+ string err;
|
||||
+ Node* user_given_target = CollectTarget(
|
||||
+ options->user_given_target, &err);
|
||||
+ if (!err.empty()) {
|
||||
+ Error("%s: %s", options->user_given_target, err.c_str());
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ std::vector<Edge*> user_interested_edges;
|
||||
+ if (!GetAllDependentEdges(user_given_target, &user_interested_edges))
|
||||
+ return 1;
|
||||
+ edges_to_process = &user_interested_edges;
|
||||
+ }
|
||||
+
|
||||
bool first = true;
|
||||
vector<char> cwd;
|
||||
|
||||
@@ -676,8 +729,8 @@ int NinjaMain::ToolCompilationDatabase(const Options* options, int argc, char* a
|
||||
}
|
||||
|
||||
putchar('[');
|
||||
- for (vector<Edge*>::iterator e = state_.edges_.begin();
|
||||
- e != state_.edges_.end(); ++e) {
|
||||
+ for (vector<Edge*>::iterator e = edges_to_process->begin();
|
||||
+ e != edges_to_process->end(); ++e) {
|
||||
if ((*e)->inputs_.empty())
|
||||
continue;
|
||||
for (int i = 0; i != argc; ++i) {
|
||||
@@ -1047,9 +1100,14 @@ int ReadFlags(int* argc, char*** argv,
|
||||
|
||||
int opt;
|
||||
while (!options->tool &&
|
||||
- (opt = getopt_long(*argc, *argv, "d:f:j:k:l:nt:vw:C:h", kLongOptions,
|
||||
+ (opt = getopt_long(*argc, *argv, "a:d:f:j:k:l:nt:vw:C:h", kLongOptions,
|
||||
NULL)) != -1) {
|
||||
switch (opt) {
|
||||
+ case 'a':
|
||||
+ options->user_given_target = optarg;
|
||||
+ if (!options->user_given_target)
|
||||
+ Fatal("Expecting one target name");
|
||||
+ break;
|
||||
case 'd':
|
||||
if (!DebugEnable(optarg))
|
||||
return 1;
|
Reference in New Issue
Block a user