Skip to content

Commit 2af8584

Browse files
authored
Remove unused bazel go sdks in favor of docker build images (#2222)
Summary: Remove unused bazel go sdks in favor of docker build images #2217 introduced a mechanism for building stirling's test demo apps outside of bazel. This allows us to decouple our test build dependencies from Pixie's own Go dependencies and also aids in testing the upcoming low memory Go uprobes (see that PR for a more detailed description). Relevant Issues: N/A Type of change: /kind cleanup Test Plan: Existing tests pass --------- Signed-off-by: Dom Del Nano <[email protected]>
1 parent 0a0ffb6 commit 2af8584

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+370
-708
lines changed

WORKSPACE

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -210,32 +210,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
210210

211211
gazelle_dependencies(go_sdk = "go_sdk")
212212

213-
# Download alternative go toolchains after all other dependencies, so that they aren't used by external dependencies.
214-
go_download_sdk(
215-
name = "go_sdk_1_18",
216-
version = "1.18.10",
217-
)
218-
219-
go_download_sdk(
220-
name = "go_sdk_1_19",
221-
version = "1.19.13",
222-
)
223-
224-
go_download_sdk(
225-
name = "go_sdk_1_20",
226-
version = "1.20.14",
227-
)
228-
229-
go_download_sdk(
230-
name = "go_sdk_1_21",
231-
version = "1.21.13",
232-
)
233-
234-
go_download_sdk(
235-
name = "go_sdk_1_22",
236-
version = "1.22.12",
237-
)
238-
239213
go_download_sdk(
240214
name = "go_sdk_1_23",
241215
version = "1.23.10",

bazel/container_images.bzl

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,83 @@ def stirling_test_images():
287287
repository = "mongo",
288288
digest = "sha256:19b2e5c91f92c7b18113a1501c5a5fe52b71a6c6d2a5232eeebb4f2abacae04a",
289289
)
290+
291+
# Tag: 1.0
292+
# Arch: linux/amd64
293+
_container_image(
294+
name = "golang_1_18_https_server_with_buildinfo",
295+
repository = "golang_1_18_https_server_with_buildinfo",
296+
digest = "sha256:d4468289a2a4f2520effc48dd8894c998867b6638953302ef4156983dbf6e4e5",
297+
)
298+
299+
# Tag: 1.0
300+
# Arch: linux/amd64
301+
_container_image(
302+
name = "golang_1_19_https_server_with_buildinfo",
303+
repository = "golang_1_19_https_server_with_buildinfo",
304+
digest = "sha256:8a35dab46ccd9af53704f8c83a8d3b28bf142f8e038696b2ba30b7df1c46df73",
305+
)
306+
307+
# Tag: 1.0
308+
# Arch: linux/amd64
309+
_container_image(
310+
name = "golang_1_20_https_server_with_buildinfo",
311+
repository = "golang_1_20_https_server_with_buildinfo",
312+
digest = "sha256:c21f14e2213f4d9826926eeb3a0e7c7445789539561b43981bbca3efafcad8d7",
313+
)
314+
315+
# Tag: 1.0
316+
# Arch: linux/amd64
317+
_container_image(
318+
name = "golang_1_21_https_server_with_buildinfo",
319+
repository = "golang_1_21_https_server_with_buildinfo",
320+
digest = "sha256:abb4573171c0a46afd4c704d8bbd6d123f022c5ad0448869311b026d0586106b",
321+
)
322+
323+
# Tag: 1.0
324+
# Arch: linux/amd64
325+
_container_image(
326+
name = "golang_1_22_https_server_with_buildinfo",
327+
repository = "golang_1_22_https_server_with_buildinfo",
328+
digest = "sha256:0f14818a1046dfdb7d5ac27e173d99e071219897a1d9969c8d7604acbd0d9541",
329+
)
330+
331+
# Tag: 1.0
332+
# Arch: linux/amd64
333+
_container_image(
334+
name = "golang_1_18_grpc_server_with_buildinfo",
335+
repository = "golang_1_18_grpc_server_with_buildinfo",
336+
digest = "sha256:e59a94abb2c505f680829951161a0a0209de0d02307da951c5a76d7b84a72034",
337+
)
338+
339+
# Tag: 1.0
340+
# Arch: linux/amd64
341+
_container_image(
342+
name = "golang_1_19_grpc_server_with_buildinfo",
343+
repository = "golang_1_19_grpc_server_with_buildinfo",
344+
digest = "sha256:88b1ae2096af629152a645f77b9c47dcac45dde95fb78376c6fdf1f7183a652b",
345+
)
346+
347+
# Tag: 1.0
348+
# Arch: linux/amd64
349+
_container_image(
350+
name = "golang_1_20_grpc_server_with_buildinfo",
351+
repository = "golang_1_20_grpc_server_with_buildinfo",
352+
digest = "sha256:a35e24a44c53d6f984eb633bbb15e318374a61fa426ccc5e580d587ce7f6a788",
353+
)
354+
355+
# Tag: 1.0
356+
# Arch: linux/amd64
357+
_container_image(
358+
name = "golang_1_21_grpc_server_with_buildinfo",
359+
repository = "golang_1_21_grpc_server_with_buildinfo",
360+
digest = "sha256:998654168565a7d4ed1c73edbafc48042879ac26581972a8ba23fe5a39e520f2",
361+
)
362+
363+
# Tag: 1.0
364+
# Arch: linux/amd64
365+
_container_image(
366+
name = "golang_1_22_grpc_server_with_buildinfo",
367+
repository = "golang_1_22_grpc_server_with_buildinfo",
368+
digest = "sha256:67adba5e8513670fa37bd042862e7844f26239e8d2997ed8c3b0aa527bc04cc3",
369+
)

bazel/pl_build_system.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ load("@rules_python//python:defs.bzl", "py_test")
2424
load("//bazel:toolchain_transitions.bzl", "qemu_interactive_runner")
2525

2626
pl_boringcrypto_go_sdk = ["1.23.9"]
27-
pl_supported_go_sdk_versions = ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24"]
27+
pl_go_test_versions = ["1.18", "1.19", "1.20", "1.21", "1.22"]
28+
pl_supported_go_sdk_versions = ["1.23", "1.24"]
2829

2930
# The last version in this list corresponds to the boringcrypto go sdk version.
3031
pl_all_supported_go_sdk_versions = pl_supported_go_sdk_versions + pl_boringcrypto_go_sdk

src/stirling/bpf_tools/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pl_cc_bpf_test(
127127
],
128128
deps = [
129129
":cc_library",
130-
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_client_container",
131-
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_server_container",
130+
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_client_container",
131+
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_server_container",
132132
],
133133
)

src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include "src/common/testing/testing.h"
2222
#include "src/stirling/bpf_tools/bcc_wrapper.h"
2323
#include "src/stirling/bpf_tools/macros.h"
24-
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h"
25-
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h"
24+
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_client_container.h"
25+
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_server_container.h"
2626

2727
namespace px {
2828
namespace stirling {
@@ -55,10 +55,10 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) {
5555
BCCWrapperImpl bcc_wrapper;
5656
ASSERT_OK(bcc_wrapper.InitBPFProgram(kBCCProgram));
5757

58-
::px::stirling::testing::Go1_19_GRPCServerContainer server1;
59-
::px::stirling::testing::Go1_19_GRPCServerContainer server2;
60-
::px::stirling::testing::Go1_19_GRPCClientContainer client1;
61-
::px::stirling::testing::Go1_19_GRPCClientContainer client2;
58+
::px::stirling::testing::Go1_24_GRPCServerContainer server1;
59+
::px::stirling::testing::Go1_24_GRPCServerContainer server2;
60+
::px::stirling::testing::Go1_24_GRPCClientContainer client1;
61+
::px::stirling::testing::Go1_24_GRPCClientContainer client2;
6262

6363
// A Uprobe template for the GRPCServerContainer.
6464
// Binary path is set later.
@@ -70,7 +70,7 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) {
7070
};
7171

7272
// A templated path to the server. We will replace $0 with the pid of the server instance.
73-
const std::string kServerPath = "/proc/$0/root/golang_1_19_grpc_tls_server_binary";
73+
const std::string kServerPath = "/proc/$0/root/golang_1_24_grpc_tls_server_binary";
7474

7575
// Run server 1 and attach uprobes to it.
7676
ASSERT_OK(server1.Run(std::chrono::seconds{60}));

src/stirling/e2e_tests/BUILD.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ pl_sh_bpf_test(
8888
srcs = ["stirling_wrapper_bpf_test.sh"],
8989
args = [
9090
"$(location //src/stirling/binaries:stirling_wrapper)",
91-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
92-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
91+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)",
92+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)",
9393
"-stirling_profiler_java_agent_libs %s" % agent_libs_arg,
9494
],
9595
data = [
9696
"//src/stirling/binaries:stirling_wrapper",
97-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
98-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
97+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client",
98+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs",
9999
] + agent_libs,
100100
# TODO(PL-1462): Uprobe attaching sometimes fails.
101101
flaky = True,
@@ -132,13 +132,13 @@ pl_sh_bpf_test(
132132
srcs = ["stirling_wrapper_container_bpf_test.sh"],
133133
args = [
134134
"$(location //src/stirling/binaries:stirling_wrapper_image.tar)",
135-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
136-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
135+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)",
136+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)",
137137
],
138138
data = [
139139
"//src/stirling/binaries:stirling_wrapper_image.tar",
140-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
141-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
140+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client",
141+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs",
142142
],
143143
flaky = True,
144144
tags = [

src/stirling/obj_tools/BUILD.bazel

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ pl_cc_test(
5252
"//src/stirling/obj_tools/testdata/cc:stripped_exe",
5353
"//src/stirling/obj_tools/testdata/cc:test_exe_debug_target",
5454
"//src/stirling/obj_tools/testdata/cc:test_exe_debuglink_target",
55-
"//src/stirling/obj_tools/testdata/go:test_go_1_19_binary",
56-
"//src/stirling/obj_tools/testdata/go:test_go_1_19_nm_output",
55+
"//src/stirling/obj_tools/testdata/go:test_go_1_24_binary",
56+
"//src/stirling/obj_tools/testdata/go:test_go_1_24_nm_output",
5757
],
5858
deps = [
5959
":cc_library",
@@ -89,7 +89,7 @@ pl_cc_test(
8989
data = [
9090
"//src/stirling/obj_tools/testdata/cc:test_exe_fixture",
9191
"//src/stirling/obj_tools/testdata/go:test_binaries",
92-
"//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary",
92+
"//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary",
9393
],
9494
deps = [
9595
":cc_library",
@@ -137,8 +137,7 @@ pl_cc_test(
137137
"//src/stirling/obj_tools/testdata/go:test_binaries",
138138
"//src/stirling/obj_tools/testdata/go:test_buildinfo_with_mods",
139139
"//src/stirling/obj_tools/testdata/go:test_go_1_17_binary",
140-
"//src/stirling/obj_tools/testdata/go:test_go_1_19_binary",
141-
"//src/stirling/obj_tools/testdata/go:test_go_1_21_binary",
140+
"//src/stirling/obj_tools/testdata/go:test_go_1_24_binary",
142141
],
143142
deps = [
144143
":cc_library",
@@ -185,7 +184,7 @@ pl_cc_binary(
185184
name = "dwarf_reader_benchmark",
186185
testonly = 1,
187186
srcs = ["dwarf_reader_benchmark.cc"],
188-
data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary"],
187+
data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary"],
189188
deps = [
190189
":cc_library",
191190
"//src/common/testing:cc_library",

src/stirling/obj_tools/dwarf_reader_benchmark.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ using px::stirling::obj_tools::DwarfReader;
2626
using px::testing::BazelRunfilePath;
2727

2828
constexpr std::string_view kBinary =
29-
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary_/"
30-
"golang_1_19_grpc_tls_server_binary";
29+
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary_/"
30+
"golang_1_24_grpc_tls_server_binary";
3131

3232
struct SymAddrs {
3333
// Members of net/http.http2serverConn.

src/stirling/obj_tools/dwarf_reader_test.cc

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,19 @@
2424
#include "src/common/testing/testing.h"
2525
#include "src/stirling/utils/detect_application.h"
2626

27-
constexpr std::string_view kTestGo1_17Binary =
28-
"src/stirling/obj_tools/testdata/go/test_go_1_17_binary";
29-
constexpr std::string_view kTestGo1_18Binary =
30-
"src/stirling/obj_tools/testdata/go/test_go_1_18_binary";
31-
constexpr std::string_view kTestGo1_19Binary =
32-
"src/stirling/obj_tools/testdata/go/test_go_1_19_binary";
33-
constexpr std::string_view kTestGo1_20Binary =
34-
"src/stirling/obj_tools/testdata/go/test_go_1_20_binary";
35-
constexpr std::string_view kTestGo1_21Binary =
36-
"src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
37-
constexpr std::string_view kTestGo1_22Binary =
38-
"src/stirling/obj_tools/testdata/go/test_go_1_22_binary";
3927
constexpr std::string_view kTestGo1_23Binary =
4028
"src/stirling/obj_tools/testdata/go/test_go_1_23_binary";
29+
constexpr std::string_view kTestGo1_24Binary =
30+
"src/stirling/obj_tools/testdata/go/test_go_1_23_binary";
4131
constexpr std::string_view kGoGRPCServer =
42-
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary";
32+
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary";
4333
constexpr std::string_view kCppBinary = "src/stirling/obj_tools/testdata/cc/test_exe_/test_exe";
4434
constexpr std::string_view kGoBinaryUnconventional =
4535
"src/stirling/obj_tools/testdata/go/sockshop_payments_service";
4636

4737
const auto kCPPBinaryPath = px::testing::BazelRunfilePath(kCppBinary);
48-
const auto kGo1_17BinaryPath = px::testing::BazelRunfilePath(kTestGo1_17Binary);
49-
const auto kGo1_18BinaryPath = px::testing::BazelRunfilePath(kTestGo1_18Binary);
50-
const auto kGo1_19BinaryPath = px::testing::BazelRunfilePath(kTestGo1_19Binary);
51-
const auto kGo1_20BinaryPath = px::testing::BazelRunfilePath(kTestGo1_20Binary);
52-
const auto kGo1_21BinaryPath = px::testing::BazelRunfilePath(kTestGo1_21Binary);
53-
const auto kGo1_22BinaryPath = px::testing::BazelRunfilePath(kTestGo1_22Binary);
5438
const auto kGo1_23BinaryPath = px::testing::BazelRunfilePath(kTestGo1_23Binary);
39+
const auto kGo1_24BinaryPath = px::testing::BazelRunfilePath(kTestGo1_24Binary);
5540
const auto kGoServerBinaryPath = px::testing::BazelRunfilePath(kGoGRPCServer);
5641
const auto kGoBinaryUnconventionalPath = px::testing::BazelRunfilePath(kGoBinaryUnconventional);
5742

@@ -578,20 +563,10 @@ INSTANTIATE_TEST_SUITE_P(CppDwarfReaderParameterizedTest, CppDwarfReaderTest,
578563
DwarfReaderTestParam{kCPPBinaryPath, false}));
579564

580565
INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedTest, GolangDwarfReaderTest,
581-
::testing::Values(DwarfReaderTestParam{kGo1_17BinaryPath, true},
582-
DwarfReaderTestParam{kGo1_17BinaryPath, false},
583-
DwarfReaderTestParam{kGo1_18BinaryPath, true},
584-
DwarfReaderTestParam{kGo1_18BinaryPath, false},
585-
DwarfReaderTestParam{kGo1_19BinaryPath, true},
586-
DwarfReaderTestParam{kGo1_19BinaryPath, false},
587-
DwarfReaderTestParam{kGo1_20BinaryPath, true},
588-
DwarfReaderTestParam{kGo1_20BinaryPath, false},
589-
DwarfReaderTestParam{kGo1_21BinaryPath, true},
590-
DwarfReaderTestParam{kGo1_21BinaryPath, false},
591-
DwarfReaderTestParam{kGo1_22BinaryPath, true},
592-
DwarfReaderTestParam{kGo1_22BinaryPath, false},
593-
DwarfReaderTestParam{kGo1_23BinaryPath, true},
594-
DwarfReaderTestParam{kGo1_23BinaryPath, false}));
566+
::testing::Values(DwarfReaderTestParam{kGo1_23BinaryPath, true},
567+
DwarfReaderTestParam{kGo1_23BinaryPath, false},
568+
DwarfReaderTestParam{kGo1_24BinaryPath, true},
569+
DwarfReaderTestParam{kGo1_24BinaryPath, false}));
595570

596571
INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedIndexTest, GolangDwarfReaderIndexTest,
597572
::testing::Values(true, false));

src/stirling/obj_tools/elf_reader_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ TEST(ElfReaderTest, FuncByteCode) {
303303

304304
TEST(ElfReaderTest, GolangAppRuntimeBuildVersion) {
305305
const std::string kPath =
306-
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_binary");
306+
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_binary");
307307
const std::string kGoBinNmOutput =
308-
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_nm_output");
308+
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_nm_output");
309309
ASSERT_OK_AND_ASSIGN(std::unique_ptr<ElfReader> elf_reader, ElfReader::Create(kPath));
310310
ASSERT_OK_AND_ASSIGN(ElfReader::SymbolInfo symbol,
311311
elf_reader->SearchTheOnlySymbol("runtime.buildVersion"));

0 commit comments

Comments
 (0)