Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into windows-snet
Browse files Browse the repository at this point in the history
  • Loading branch information
lschulz committed Feb 27, 2025
2 parents d1f152c + 32ca823 commit 203b28d
Show file tree
Hide file tree
Showing 359 changed files with 4,056 additions and 3,682 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### common options for all subcommands (help, query, build, ...)
common --show_timestamps --enable_platform_specific_config
common --show_timestamps --enable_platform_specific_config --noenable_bzlmod

# connect to buchgr/bazel-remote cache
# These flags can unfortunately not be specified for `common`, as they are not accepted by all subcommands (help, version, dump)
Expand All @@ -26,7 +26,7 @@ build --define gotags=sqlite_modernc,netgo
build:osx --define gotags=sqlite_modernc

### options for test
test --build_tests_only --print_relative_test_log_paths --test_output=errors --nobuild_python_zip
test --build_tests_only --print_relative_test_log_paths --test_output=errors --nobuild_python_zip --spawn_strategy=remote,worker,processwrapper-sandbox,local

### predefined configurations (use with --config, eg. `bazel test --config=unit_all`)
test:race --@io_bazel_rules_go//go/config:race
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
7.5.0
2 changes: 1 addition & 1 deletion .golangcilint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linters:
- typecheck
- unused
# Extended linters.
- exportloopref
- copyloopvar
- rowserrcheck
- sqlclosecheck
- unconvert
Expand Down
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
110 changes: 110 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ GO_BUILD_TAGS_ARG=$(shell bazel info --ui_event_filters=-stdout,-stderr --announ
lint-go-golangci:
$(info ==> $@)
@if [ -t 1 ]; then tty=true; else tty=false; fi; \
tools/quiet docker run --tty=$$tty --rm -v golangci-lint-modcache:/go -v golangci-lint-buildcache:/root/.cache -v "${PWD}:/src" -w /src golangci/golangci-lint:v1.60.3 golangci-lint run --config=/src/.golangcilint.yml --timeout=3m $(GO_BUILD_TAGS_ARG) --skip-dirs doc ./...
tools/quiet docker run --tty=$$tty --rm -v golangci-lint-modcache:/go -v golangci-lint-buildcache:/root/.cache -v "${PWD}:/src" -w /src golangci/golangci-lint:v1.64.5 golangci-lint run --config=/src/.golangcilint.yml --timeout=3m $(GO_BUILD_TAGS_ARG) --skip-dirs doc ./...

lint-go-semgrep:
$(info ==> $@)
Expand Down
5 changes: 1 addition & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe

go_rules_dependencies()

go_register_toolchains(
nogo = "@//:nogo",
version = "1.22.7",
)
go_register_toolchains(version = "1.24.0")

# Gazelle
http_archive(
Expand Down
5 changes: 5 additions & 0 deletions acceptance/common/raw.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def raw_test(
deps = [],
data = [],
tags = [],
imports = ["."],
homedir = "",
local = False):
py_library(
Expand All @@ -33,6 +34,7 @@ def raw_test(
args = ["setup"] + args,
main = src,
deps = [":%s_lib" % name],
imports = imports,
data = data,
)

Expand All @@ -42,6 +44,7 @@ def raw_test(
args = ["run"] + args,
main = src,
deps = [":%s_lib" % name],
imports = imports,
data = data,
)

Expand All @@ -51,6 +54,7 @@ def raw_test(
args = ["teardown"],
main = src,
deps = [":%s_lib" % name],
imports = imports,
data = data,
)

Expand All @@ -61,6 +65,7 @@ def raw_test(
main = src,
args = args,
deps = [":%s_lib" % name],
imports = imports,
data = data,
tags = tags + ["integration", "exclusive"],
local = local,
Expand Down
1 change: 1 addition & 0 deletions acceptance/router_benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ py_binary(
data = [
"//acceptance/router_benchmark/brload",
],
imports = ["."],
visibility = ["//visibility:public"],
deps = [
"benchmarklib",
Expand Down
42 changes: 29 additions & 13 deletions acceptance/router_benchmark/brload/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,35 @@ go_library(
],
importpath = "github.com/scionproto/scion/acceptance/router_benchmark/brload",
visibility = ["//visibility:private"],
deps = [
"//acceptance/router_benchmark/cases:go_default_library",
"//pkg/log:go_default_library",
"//pkg/private/serrors:go_default_library",
"//pkg/scrypto:go_default_library",
"//pkg/slayers:go_default_library",
"//private/keyconf:go_default_library",
"@com_github_google_gopacket//:go_default_library",
"@com_github_google_gopacket//afpacket:go_default_library",
"@com_github_google_gopacket//layers:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
],
deps = select({
"@io_bazel_rules_go//go/platform:android": [
"//acceptance/router_benchmark/cases:go_default_library",
"//pkg/log:go_default_library",
"//pkg/private/serrors:go_default_library",
"//pkg/scrypto:go_default_library",
"//pkg/slayers:go_default_library",
"//private/keyconf:go_default_library",
"@com_github_gopacket_gopacket//:go_default_library",
"@com_github_gopacket_gopacket//afpacket:go_default_library",
"@com_github_gopacket_gopacket//layers:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
],
"@io_bazel_rules_go//go/platform:linux": [
"//acceptance/router_benchmark/cases:go_default_library",
"//pkg/log:go_default_library",
"//pkg/private/serrors:go_default_library",
"//pkg/scrypto:go_default_library",
"//pkg/slayers:go_default_library",
"//private/keyconf:go_default_library",
"@com_github_gopacket_gopacket//:go_default_library",
"@com_github_gopacket_gopacket//afpacket:go_default_library",
"@com_github_gopacket_gopacket//layers:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
],
"//conditions:default": [],
}),
)

scion_go_binary(
Expand Down
14 changes: 8 additions & 6 deletions acceptance/router_benchmark/brload/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 SCION Association
// Copyright 2025 SCION Association
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux

package main

import (
Expand All @@ -25,9 +27,9 @@ import (
"reflect"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/afpacket"
"github.com/google/gopacket/layers"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/afpacket"
"github.com/gopacket/gopacket/layers"
"github.com/spf13/cobra"

"github.com/scionproto/scion/acceptance/router_benchmark/cases"
Expand Down Expand Up @@ -215,12 +217,12 @@ func run(cmd *cobra.Command) int {
numPkt := 0
for time.Since(begin) < testDuration {
// we break every 1000 batches to check the time
for i := 0; i < 1000; i++ {
for range 1000 {
// Rotate through flowIDs. We patch it directly into the SCION header of the packet. The
// SCION header starts at offset 42. The flowID is the 20 least significant bits of the
// first 32 bit field. To make our life simpler, we only use the last 16 bits (so no
// more than 64K flows).
for j := 0; j < batchSize; j++ {
for j := range batchSize {
binary.BigEndian.PutUint16(allPkts[j][44:46], uint16(numPkt%int(numStreams)))
numPkt++
}
Expand Down
6 changes: 4 additions & 2 deletions acceptance/router_benchmark/brload/mmsg.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 SCION Association
// Copyright 2025 SCION Association
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux

package main

import (
"reflect"
"unsafe"

"github.com/google/gopacket/afpacket"
"github.com/gopacket/gopacket/afpacket"
"golang.org/x/sys/unix"
)

Expand Down
4 changes: 2 additions & 2 deletions acceptance/router_benchmark/cases/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ go_library(
"//pkg/slayers:go_default_library",
"//pkg/slayers/path:go_default_library",
"//pkg/slayers/path/scion:go_default_library",
"@com_github_google_gopacket//:go_default_library",
"@com_github_google_gopacket//layers:go_default_library",
"@com_github_gopacket_gopacket//:go_default_library",
"@com_github_gopacket_gopacket//layers:go_default_library",
"@com_github_mdlayher_arp//:go_default_library",
"@com_github_mdlayher_ethernet//:go_default_library",
],
Expand Down
2 changes: 1 addition & 1 deletion acceptance/router_benchmark/cases/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package cases

import (
"github.com/google/gopacket"
"github.com/gopacket/gopacket"
)

// We make the assumption os protocol sanity: the length and checksum fields are of fixed size
Expand Down
2 changes: 1 addition & 1 deletion acceptance/router_benchmark/cases/topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"time"

"github.com/google/gopacket/layers"
"github.com/gopacket/gopacket/layers"
"github.com/mdlayher/arp"
"github.com/mdlayher/ethernet"

Expand Down
4 changes: 2 additions & 2 deletions acceptance/router_benchmark/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
# Those values are valid expectations only when running in the CI environment.
TEST_CASES = {
"in": 700000,
"out": 730000,
"out": 723000,
"in_transit": 700000,
"out_transit": 720000,
"out_transit": 716000,
"br_transit": 720000,
}

Expand Down
1 change: 0 additions & 1 deletion control/beacon/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
deps = [
"//pkg/addr:go_default_library",
"//pkg/log:go_default_library",
"//pkg/private/common:go_default_library",
"//pkg/private/ptr:go_default_library",
"//pkg/private/serrors:go_default_library",
"//pkg/proto/control_plane:go_default_library",
Expand Down
1 change: 0 additions & 1 deletion control/beacon/beacon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func TestBeaconDiversity(t *testing.T) {
},
}
mctrl := gomock.NewController(t)
defer mctrl.Finish()

g := graph.NewDefaultGraph(mctrl)
bseg := testBeacon(g, tests[0].beacon...)
Expand Down
Loading

0 comments on commit 203b28d

Please sign in to comment.