diff --git a/cmd/coordinator/internal/dashboard/handler.go b/cmd/coordinator/internal/dashboard/handler.go index 63f98a4cd7..e4db5587f9 100644 --- a/cmd/coordinator/internal/dashboard/handler.go +++ b/cmd/coordinator/internal/dashboard/handler.go @@ -23,6 +23,7 @@ import ( "cloud.google.com/go/datastore" "golang.org/x/build/cmd/coordinator/internal/lucipoll" "golang.org/x/build/dashboard" + "golang.org/x/build/internal/migration" "golang.org/x/build/internal/releasetargets" "golang.org/x/build/maintner/maintnerd/apipb" "google.golang.org/grpc" @@ -128,7 +129,7 @@ func (d *Handler) getBuilders(conf map[string]*dashboard.BuildConfig, luci lucip if !b.BuildsRepoPostSubmit("go", "master", "master") { continue } - if dashboard.BuildersPortedToLUCI[b.Name] && len(luci.Builders) > 0 { + if migration.BuildersPortedToLUCI[b.Name] && len(luci.Builders) > 0 { // Don't display old builders that have been ported // to LUCI if willing to show LUCI builders as well. continue diff --git a/cmd/coordinator/internal/legacydash/ui.go b/cmd/coordinator/internal/legacydash/ui.go index 82eb2a42b7..f533f6d285 100644 --- a/cmd/coordinator/internal/legacydash/ui.go +++ b/cmd/coordinator/internal/legacydash/ui.go @@ -26,6 +26,7 @@ import ( bbpb "go.chromium.org/luci/buildbucket/proto" "golang.org/x/build/cmd/coordinator/internal/lucipoll" "golang.org/x/build/dashboard" + "golang.org/x/build/internal/migration" "golang.org/x/build/internal/releasetargets" "golang.org/x/build/maintner/maintnerd/apipb" "golang.org/x/build/repos" @@ -482,7 +483,7 @@ func (tb *uiTemplateDataBuilder) buildTemplateData(ctx context.Context, datastor } if len(luci.Builders) > 0 { for name := range builders { - if dashboard.BuildersPortedToLUCI[name] { + if migration.BuildersPortedToLUCI[name] { // Don't display old builders that have been ported // to LUCI if willing to show LUCI builders as well. delete(builders, name) @@ -525,7 +526,7 @@ func (tb *uiTemplateDataBuilder) buildTemplateData(ctx context.Context, datastor } if len(luci.Builders) > 0 { for name := range builders { - if dashboard.BuildersPortedToLUCI[name] { + if migration.BuildersPortedToLUCI[name] { // Don't display old builders that have been ported // to LUCI if willing to show LUCI builders as well. delete(builders, name) diff --git a/dashboard/builders.go b/dashboard/builders.go index 08acee6804..4d6e071d10 100644 --- a/dashboard/builders.go +++ b/dashboard/builders.go @@ -16,6 +16,7 @@ import ( "golang.org/x/build/buildenv" "golang.org/x/build/internal/gophers" + "golang.org/x/build/internal/migration" "golang.org/x/build/maintner/maintnerd/maintapi/version" "golang.org/x/build/types" ) @@ -2861,97 +2862,6 @@ func init() { }) } -// BuildersPortedToLUCI lists coordinator builders that have been ported -// over to LUCI and don't need to continue to run. Their results will be -// hidden from the build.golang.org page and new builds won't be started -// if stopPortedBuilder (below) returns true. -// -// See go.dev/issue/65913 -// and go.dev/issue/63471. -var BuildersPortedToLUCI = map[string]bool{ - // macOS builders. - "darwin-amd64-10_15": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_10.15. - "darwin-amd64-11_0": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_11. - "darwin-amd64-12_0": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_12. - "darwin-amd64-13": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_13. - "darwin-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64-longtest. - "darwin-amd64-nocgo": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64-nocgo. - "darwin-arm64-11": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-arm64_11. - "darwin-arm64-12": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-arm64_12. - - // Linux builders (just those covering first-class ports). - "linux-386": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386. - "linux-386-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-longtest. - "linux-386-clang": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-clang15 (a newer clang, but we won't be adding exactly -clang7 to LUCI by now). - "linux-386-softfloat": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-softfloat. - "linux-arm-aws": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm. - "linux-amd64": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64. - "linux-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-longtest. - "linux-amd64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-race. - "linux-amd64-longtest-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-longtest-race. - "linux-amd64-racecompile": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-racecompile. - "linux-amd64-nocgo": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-nocgo. - "linux-amd64-noopt": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-noopt. - "linux-amd64-clang": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-clang15 (a newer clang, but we won't be adding exactly -clang7 to LUCI by now). - "linux-amd64-goamd64v3": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-goamd64v3. - "linux-amd64-boringcrypto": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-boringcrypto. - "linux-amd64-ssacheck": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-ssacheck. - "linux-amd64-staticlockranking": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-staticlockranking. - "linux-amd64-newinliner": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-newinliner. - "linux-arm64": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64. - "linux-arm64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-longtest. - "linux-arm64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-race. - "linux-arm64-boringcrypto": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-boringcrypto. - - // Windows builders. - "windows-386-2016": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-386. - "windows-amd64-2016": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64. - "windows-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64-longtest. - "windows-amd64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64-race. - "windows-arm64-11": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-arm64. - - "linux-riscv64-jsing": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-riscv64. - "linux-riscv64-unmatched": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-riscv64 (this builder is testing the same port as on the line above). - - "linux-ppc64le-buildlet": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power8. - "linux-ppc64le-power9osu": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power9. - "linux-ppc64le-power10osu": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power10. - "linux-ppc64-sid-buildlet": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64_power8. - "linux-ppc64-sid-power10": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64_power10. - "linux-loong64-3a5000": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-loong64. - - "netbsd-arm64-bsiegert": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-netbsd-arm64. - - "openbsd-amd64-72": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-openbsd-amd64. - - "solaris-amd64-oraclerel": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-solaris-amd64. - - // WebAssembly builders. - "js-wasm-node18": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-js-wasm. - "wasip1-wasm-wasmedge": true, // Would be 'wasip1-wasm_wasmedge' but put off until go.dev/issue/60097 picks up activity. - "wasip1-wasm-wasmer": true, // Would be 'wasip1-wasm_wasmer' but put off until go.dev/issue/59907 picks up activity. - "wasip1-wasm-wasmtime": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-wasip1-wasm_wasmtime. - "wasip1-wasm-wazero": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-wasip1-wasm_wazero. -} - -// stopPortedBuilder reports whether the named ported builder should be stopped, -// instead of just made invisible in the web UI. -func stopPortedBuilder(builderName string) (stop bool) { - nameKeyList := []string{ - "linux-loong64", - "linux-ppc64", - "-wasm-", - } - - for _, key := range nameKeyList { - if strings.Contains(builderName, key) { - return true - } - } - - return false -} - // addBuilder adds c to the Builders map after doing some checks. func addBuilder(c BuildConfig) { if c.Name == "" { @@ -2988,7 +2898,7 @@ func addBuilder(c BuildConfig) { panic(fmt.Sprintf("build config %q host type inconsistent (must be Reverse, Image, or VM)", c.Name)) } - if BuildersPortedToLUCI[c.Name] && stopPortedBuilder(c.Name) { + if migration.BuildersPortedToLUCI[c.Name] && migration.StopPortedBuilder(c.Name) { c.buildsRepo = func(_, _, _ string) bool { return false } c.Notes = "Unavailable in the coordinator. Use LUCI (https://go.dev/wiki/LUCI) instead." } diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go index 3562395b7a..96989c9c28 100644 --- a/dashboard/builders_test.go +++ b/dashboard/builders_test.go @@ -15,6 +15,8 @@ import ( "strings" "testing" "time" + + "golang.org/x/build/internal/migration" ) func TestOSARCHAccessors(t *testing.T) { @@ -1239,7 +1241,7 @@ func TestHostsSort(t *testing.T) { func TestBuildersPortedToLUCI(t *testing.T) { // Check that map keys refer to builder names that exist, // otherwise the entry is a no-op. Mostly to catch typos. - for name := range BuildersPortedToLUCI { + for name := range migration.BuildersPortedToLUCI { if _, ok := Builders[name]; !ok { t.Errorf("BuildersPortedToLUCI contains an unknown legacy builder name %v", name) } diff --git a/internal/migration/migration.go b/internal/migration/migration.go new file mode 100644 index 0000000000..28b67fca0f --- /dev/null +++ b/internal/migration/migration.go @@ -0,0 +1,104 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package migration holds some knobs related to the migration from the +// now-legacy build infrastructure to the new LUCI build infrastructure. +package migration + +import "strings" + +const ( + StopLegacyMiscCompileTryBots = false +) + +// BuildersPortedToLUCI lists coordinator builders that have been ported +// over to LUCI and don't need to continue to run. Their results will be +// hidden from the build.golang.org page and new builds won't be started +// if StopPortedBuilder (below) returns true. +// +// See go.dev/issue/65913 +// and go.dev/issue/63471. +var BuildersPortedToLUCI = map[string]bool{ + // macOS builders. + "darwin-amd64-10_15": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_10.15. + "darwin-amd64-11_0": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_11. + "darwin-amd64-12_0": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_12. + "darwin-amd64-13": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64_13. + "darwin-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64-longtest. + "darwin-amd64-nocgo": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-amd64-nocgo. + "darwin-arm64-11": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-arm64_11. + "darwin-arm64-12": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-darwin-arm64_12. + + // Linux builders (just those covering first-class ports). + "linux-386": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386. + "linux-386-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-longtest. + "linux-386-clang": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-clang15 (a newer clang, but we won't be adding exactly -clang7 to LUCI by now). + "linux-386-softfloat": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-386-softfloat. + "linux-arm-aws": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm. + "linux-amd64": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64. + "linux-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-longtest. + "linux-amd64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-race. + "linux-amd64-longtest-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-longtest-race. + "linux-amd64-racecompile": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-racecompile. + "linux-amd64-nocgo": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-nocgo. + "linux-amd64-noopt": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-noopt. + "linux-amd64-clang": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-clang15 (a newer clang, but we won't be adding exactly -clang7 to LUCI by now). + "linux-amd64-goamd64v3": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-goamd64v3. + "linux-amd64-boringcrypto": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-boringcrypto. + "linux-amd64-ssacheck": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-ssacheck. + "linux-amd64-staticlockranking": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-staticlockranking. + "linux-amd64-newinliner": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-amd64-newinliner. + "linux-arm64": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64. + "linux-arm64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-longtest. + "linux-arm64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-race. + "linux-arm64-boringcrypto": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-arm64-boringcrypto. + + // Windows builders. + "windows-386-2016": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-386. + "windows-amd64-2016": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64. + "windows-amd64-longtest": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64-longtest. + "windows-amd64-race": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-amd64-race. + "windows-arm64-11": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-windows-arm64. + + "linux-riscv64-jsing": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-riscv64. + "linux-riscv64-unmatched": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-riscv64 (this builder is testing the same port as on the line above). + + "linux-ppc64le-buildlet": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power8. + "linux-ppc64le-power9osu": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power9. + "linux-ppc64le-power10osu": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64le_power10. + "linux-ppc64-sid-buildlet": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64_power8. + "linux-ppc64-sid-power10": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-ppc64_power10. + "linux-loong64-3a5000": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-linux-loong64. + + "netbsd-arm64-bsiegert": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-netbsd-arm64. + + "openbsd-amd64-72": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-openbsd-amd64. + + "solaris-amd64-oraclerel": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-solaris-amd64. + + // WebAssembly builders. + "js-wasm-node18": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-js-wasm. + "wasip1-wasm-wasmedge": true, // Would be 'wasip1-wasm_wasmedge' but put off until go.dev/issue/60097 picks up activity. + "wasip1-wasm-wasmer": true, // Would be 'wasip1-wasm_wasmer' but put off until go.dev/issue/59907 picks up activity. + "wasip1-wasm-wasmtime": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-wasip1-wasm_wasmtime. + "wasip1-wasm-wazero": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-wasip1-wasm_wazero. +} + +// StopPortedBuilder reports whether the named ported builder should be stopped, +// instead of just made invisible in the web UI. +func StopPortedBuilder(builderName string) (stop bool) { + nameKeyList := []string{ + "linux-loong64", + "linux-ppc64", + "-wasm-", + } + + for _, key := range nameKeyList { + if strings.Contains(builderName, key) { + return true + } + } + + return false +}