blob: eb77d5e29c1c4b4a2ffb9745d81168e4bc735e92 [file] [log] [blame]
Leopold Schabel5c80aca2019-10-22 15:48:58 +02001load("@bazel_gazelle//:def.bzl", "gazelle")
Serge Bazanski0ef96292021-05-21 15:41:32 +02002load("@io_bazel_rules_go//go:def.bzl", "go_path")
Leopoldbe326c22023-01-04 20:42:59 +01003load("@bazeldnf//:def.bzl", "bazeldnf")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02004
Serge Bazanski31370b02021-01-07 16:31:14 +01005# gazelle:prefix source.monogon.dev
Lorenz Brund13c1c62022-03-30 19:58:58 +02006# gazelle:go_naming_convention import
Serge Bazanskifdc3a242022-04-06 15:56:38 +02007# gazelle:exclude **/gomod-generated-placeholder.go
Leopold7fbf1042023-01-06 19:57:37 +01008# gazelle:exclude .bazeldnf/**
Leopold Schabel5c80aca2019-10-22 15:48:58 +02009gazelle(name = "gazelle")
Leopold Schabeld868d692019-11-17 17:28:29 +010010
Serge Bazanskiee4bfdb2022-04-06 15:30:52 +020011gazelle(
12 name = "gazelle-update-repos",
13 args = [
14 "-from_file=go.mod",
15 "-to_macro=third_party/go/repositories.bzl%go_repositories",
16 "-prune",
17 ],
18 command = "update-repos",
Serge Bazanski116c4a62021-09-24 14:22:27 +020019)
Serge Bazanskif369cfa2020-05-22 18:36:42 +020020
Leopold Schabeld868d692019-11-17 17:28:29 +010021# Shortcut for the Go SDK
22alias(
23 name = "go",
24 actual = "@go_sdk//:bin/go",
Leopold Schabela4516f92019-12-04 20:27:05 +000025 visibility = ["//visibility:public"],
26)
27
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010028load("@rules_python//python:defs.bzl", "py_runtime_pair")
29
30# Python toolchains - just use the host python for now.
31# TODO(T649): move to external (nix?) interpreters.
32py_runtime(
33 name = "host_python3",
34 interpreter_path = "/usr/bin/python3",
35 python_version = "PY3",
Serge Bazanski6af91052023-02-23 09:36:27 +000036 # Necessary on NixOS, as the nixpkgs-packaged Bazel has this overriden to
37 # the local /nix/store.
38 stub_shebang = "#!/usr/bin/python3",
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010039)
40
41py_runtime(
42 name = "host_python2",
43 interpreter_path = "/usr/bin/python2",
44 python_version = "PY2",
Serge Bazanski6af91052023-02-23 09:36:27 +000045 stub_shebang = "#!/usr/bin/python2",
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010046)
47
48py_runtime_pair(
49 name = "host_python_pair",
50 py2_runtime = ":host_python2",
51 py3_runtime = ":host_python3",
52)
53
54toolchain(
55 name = "host_python",
56 toolchain = ":host_python_pair",
57 toolchain_type = "@rules_python//python:toolchain_type",
58)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010059
Leopoldbe326c22023-01-04 20:42:59 +010060# bazeldnf binary
61bazeldnf(name = "bazeldnf")
62
Leopold Schabel26d41992020-12-15 19:27:58 +010063# Shortcuts for top-level binaries/tools
64
Serge Bazanski2fb13a82020-02-11 12:41:37 +010065# Shortcut for kubectl when running through bazel run
66# (don't depend on this, it might turn into an env-based PATH shortcut, use
Serge Bazanskibb7db922020-04-30 12:43:10 +020067# @io_k8s_kubernetes//cmd/kubectl instead)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010068alias(
69 name = "kubectl",
Serge Bazanskibb7db922020-04-30 12:43:10 +020070 actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
Serge Bazanski2fb13a82020-02-11 12:41:37 +010071)
Leopold Schabel3058b7a2020-06-03 17:51:07 +020072
73# Shortcut for the Delve debugger for interactive debugging
74alias(
75 name = "dlv",
76 actual = "@com_github_go_delve_delve//cmd/dlv:dlv",
77)
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020078
Serge Bazanski662b5b32020-12-21 13:49:00 +010079# Shortcut for launching a single Metropolis node instance in a VM.
Leopolde2a302a2023-01-15 15:39:18 +010080test_suite(
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020081 name = "launch",
Leopolde2a302a2023-01-15 15:39:18 +010082 tags = ["manual"],
83 tests = [
84 "//metropolis/test/launch/cli/launch",
85 ],
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020086)
Lorenz Brun52f7f292020-06-24 16:42:02 +020087
Serge Bazanski662b5b32020-12-21 13:49:00 +010088# Shortcut for launching a virtual network a Metropolis cluster consisting of two nodes.
Leopolde2a302a2023-01-15 15:39:18 +010089test_suite(
Lorenz Brun52f7f292020-06-24 16:42:02 +020090 name = "launch-multi2",
Leopolde2a302a2023-01-15 15:39:18 +010091 tags = ["manual"],
92 tests = [
93 "//metropolis/test/launch/cli/launch-multi2",
94 ],
Lorenz Brun52f7f292020-06-24 16:42:02 +020095)
Leopold Schabel26d41992020-12-15 19:27:58 +010096
97alias(
Leopold Schabeld2120142021-12-03 21:30:49 +010098 name = "metroctl",
99 actual = "//metropolis/cli/metroctl:metroctl",
100)
101
102alias(
Leopold Schabel26d41992020-12-15 19:27:58 +0100103 name = "goimports",
104 actual = "@org_golang_x_tools//cmd/goimports:goimports",
105 visibility = ["//visibility:public"],
106)