Skip to content

Commit

Permalink
Create RBE instance when required.
Browse files Browse the repository at this point in the history
Also switch to e2-standard-2 instances
  • Loading branch information
fejta committed Aug 12, 2021
1 parent d16a6c8 commit f66c4e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rbe/install-k8s-prow-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ proj=k8s-prow-builds
pool=prow-pool
workers=200
disk=600
machine=n1-standard-2
machine=e2-standard-2
[email protected]

"$(dirname "$0")/install.sh" "$proj" "$pool" "$workers" "$disk" "$machine" "$bot"
2 changes: 1 addition & 1 deletion rbe/install-k8s-prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ proj=k8s-prow
pool=prow-pool
workers=20
disk=600
machine=n1-standard-2
machine=e2-standard-2
bots=(
[email protected]
[email protected]
Expand Down
19 changes: 14 additions & 5 deletions rbe/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ log() {

log gcloud services enable remotebuildexecution.googleapis.com "--project=$proj"

check=(
gcloud alpha remote-build-execution
worker-pools describe
"$pool" "--project=$proj" --instance=default_instance
check_instance=(
gcloud alpha remote-build-execution instances describe default_instance "--project=$proj"
)

check_pools=(
gcloud alpha remote-build-execution worker-pools describe "$pool" "--project=$proj" --instance=default_instance
)

if ! "${check_instance[@]}" 2>/dev/null; then
log gcloud alpha remote-build-execution instances create \
default_instance \
"--project=$proj"
fi

if [[ -z $pool ]]; then
echo "Existing pools:" >&2
for i in $(gcloud alpha remote-build-execution worker-pools list \
Expand All @@ -67,7 +75,8 @@ if [[ -z $pool ]]; then
exit 1
fi

if ! "${check[@]}" 2>/dev/null; then

if ! "${check_pools[@]}" 2>/dev/null; then
log gcloud alpha remote-build-execution worker-pools create \
"$pool" \
"--project=$proj" \
Expand Down

0 comments on commit f66c4e8

Please sign in to comment.