Skip to content

Commit

Permalink
main.star: triple sharding amount for misc-compile builders
Browse files Browse the repository at this point in the history
It completes in under 30 minutes as is. Go with a tentative target
of 10 minutes for now (via golang/go#17104), we can revisit it later.

In comparison, the previous build system currently uses effectively
the equivalent of 33 shards (that each handle one port), so even 12
shards is only about a third of that.

For golang/go#61698.
For golang/go#17104.

Change-Id: Ie641e0574127fcb72b081219f540fb5e7a9cf020
Reviewed-on: https://go-review.googlesource.com/c/build/+/515735
TryBot-Bypass: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Aug 3, 2023
1 parent 55f16a4 commit dec5a27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
18 changes: 9 additions & 9 deletions generated/cr-buildbucket.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ buckets {
' "golang/ci/x_vulndb-go1.20-linux-amd64-misccompile",'
' "golang/ci/x_website-go1.20-linux-amd64-misccompile"'
' ],'
' "num_test_shards": 1,'
' "num_test_shards": 12,'
' "test_builder": "golang/ci/go1.20-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -3259,7 +3259,7 @@ buckets {
' "golang/ci/x_vulndb-go1.21-linux-amd64-misccompile",'
' "golang/ci/x_website-go1.21-linux-amd64-misccompile"'
' ],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/ci/go1.21-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -5471,7 +5471,7 @@ buckets {
' "golang/ci/x_vulndb-gotip-linux-amd64-misccompile",'
' "golang/ci/x_website-gotip-linux-amd64-misccompile"'
' ],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/ci/gotip-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -48430,7 +48430,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/go1.20-internal-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 1,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/go1.20-internal-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -50129,7 +50129,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/go1.20-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 1,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/go1.20-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -52064,7 +52064,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/go1.21-internal-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/go1.21-internal-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -53763,7 +53763,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/go1.21-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/go1.21-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -55703,7 +55703,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/gotip-internal-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/gotip-internal-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down Expand Up @@ -57408,7 +57408,7 @@ buckets {
' "coord_mode": {'
' "build_builder": "golang/try/gotip-linux-amd64-misccompile-build_go",'
' "builders_to_trigger_after_toolchain_build": [],'
' "num_test_shards": 4,'
' "num_test_shards": 12,'
' "test_builder": "golang/try/gotip-linux-amd64-misccompile-test_only"'
' },'
' "env": {},'
Expand Down
11 changes: 6 additions & 5 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,13 @@ def define_builder(bucket, project, go_branch_short, builder_type, gerrit_host =

# Emit the builder definitions.
if project == "go":
define_go_builder(name, bucket, go_branch_short, builder_type, base_props, base_dims, emit_builder)
define_go_builder(name, bucket, go_branch_short, builder_type, run_mods, base_props, base_dims, emit_builder)
else:
define_subrepo_builder(name, base_props, base_dims, emit_builder)

return bucket + "/" + name

def define_go_builder(name, bucket, go_branch_short, builder_type, base_props, base_dims, emit_builder):
def define_go_builder(name, bucket, go_branch_short, builder_type, run_mods, base_props, base_dims, emit_builder):
# Create 3 builders: the main entrypoint/coordinator builder,
# a builder just to run make.bash, and a builder to run tests.
#
Expand All @@ -446,12 +446,13 @@ def define_go_builder(name, bucket, go_branch_short, builder_type, base_props, b
test_name = name + "-test_only"

# Determine if we should be sharding tests, and how many shards.
#
# TODO(mknyszek): Remove the exception for the go1.20 branch once it
# is no longer supported.
test_shards = 1
if not is_capacity_constrained(builder_type) and go_branch_short != "go1.20":
# TODO(mknyszek): Remove the exception for the go1.20 branch once it
# is no longer supported.
test_shards = 4
if "misccompile" in run_mods:
test_shards = 12

# The main repo builder also triggers subrepo builders of the same builder type.
#
Expand Down

0 comments on commit dec5a27

Please sign in to comment.