blob: 8244c90f13ff0aad7f74cab9528e6f9a783d88ee [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")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02003
Serge Bazanski31370b02021-01-07 16:31:14 +01004# gazelle:prefix source.monogon.dev
Lorenz Brund13c1c62022-03-30 19:58:58 +02005# gazelle:go_naming_convention import
Leopold Schabel5c80aca2019-10-22 15:48:58 +02006gazelle(name = "gazelle")
Leopold Schabeld868d692019-11-17 17:28:29 +01007
Serge Bazanskiee4bfdb2022-04-06 15:30:52 +02008gazelle(
9 name = "gazelle-update-repos",
10 args = [
11 "-from_file=go.mod",
12 "-to_macro=third_party/go/repositories.bzl%go_repositories",
13 "-prune",
14 ],
15 command = "update-repos",
Serge Bazanski116c4a62021-09-24 14:22:27 +020016)
Serge Bazanskif369cfa2020-05-22 18:36:42 +020017
Leopold Schabeld868d692019-11-17 17:28:29 +010018# Shortcut for the Go SDK
19alias(
20 name = "go",
21 actual = "@go_sdk//:bin/go",
Leopold Schabela4516f92019-12-04 20:27:05 +000022 visibility = ["//visibility:public"],
23)
24
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010025load("@rules_python//python:defs.bzl", "py_runtime_pair")
26
27# Python toolchains - just use the host python for now.
28# TODO(T649): move to external (nix?) interpreters.
29py_runtime(
30 name = "host_python3",
31 interpreter_path = "/usr/bin/python3",
32 python_version = "PY3",
33)
34
35py_runtime(
36 name = "host_python2",
37 interpreter_path = "/usr/bin/python2",
38 python_version = "PY2",
39)
40
41py_runtime_pair(
42 name = "host_python_pair",
43 py2_runtime = ":host_python2",
44 py3_runtime = ":host_python3",
45)
46
47toolchain(
48 name = "host_python",
49 toolchain = ":host_python_pair",
50 toolchain_type = "@rules_python//python:toolchain_type",
51)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010052
Leopold Schabel26d41992020-12-15 19:27:58 +010053# Shortcuts for top-level binaries/tools
54
Serge Bazanski2fb13a82020-02-11 12:41:37 +010055# Shortcut for kubectl when running through bazel run
56# (don't depend on this, it might turn into an env-based PATH shortcut, use
Serge Bazanskibb7db922020-04-30 12:43:10 +020057# @io_k8s_kubernetes//cmd/kubectl instead)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010058alias(
59 name = "kubectl",
Serge Bazanskibb7db922020-04-30 12:43:10 +020060 actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
Serge Bazanski2fb13a82020-02-11 12:41:37 +010061)
Leopold Schabel3058b7a2020-06-03 17:51:07 +020062
63# Shortcut for the Delve debugger for interactive debugging
64alias(
65 name = "dlv",
66 actual = "@com_github_go_delve_delve//cmd/dlv:dlv",
67)
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020068
Serge Bazanski662b5b32020-12-21 13:49:00 +010069# Shortcut for launching a single Metropolis node instance in a VM.
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020070alias(
71 name = "launch",
Serge Bazanski77cb6c52020-12-19 00:09:22 +010072 actual = "//metropolis/test/launch/cli/launch",
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020073)
Lorenz Brun52f7f292020-06-24 16:42:02 +020074
Serge Bazanski662b5b32020-12-21 13:49:00 +010075# Shortcut for launching a virtual network a Metropolis cluster consisting of two nodes.
Lorenz Brun52f7f292020-06-24 16:42:02 +020076alias(
77 name = "launch-multi2",
Serge Bazanski77cb6c52020-12-19 00:09:22 +010078 actual = "//metropolis/test/launch/cli/launch-multi2",
Lorenz Brun52f7f292020-06-24 16:42:02 +020079)
Leopold Schabel26d41992020-12-15 19:27:58 +010080
81alias(
Leopold Schabeld2120142021-12-03 21:30:49 +010082 name = "metroctl",
83 actual = "//metropolis/cli/metroctl:metroctl",
84)
85
86alias(
Leopold Schabel26d41992020-12-15 19:27:58 +010087 name = "goimports",
88 actual = "@org_golang_x_tools//cmd/goimports:goimports",
89 visibility = ["//visibility:public"],
90)