1
0
Fork 0

go: re-do the entire thing

This is a mega-change, but attempting to split this up further is
probably not worth the effort.

Summary:

1. Bump up bazel, rules_go, and others.
2. Switch to new go target naming (bye bye go_default_library)
3. Move go deps to go.mod/go.sum, use make gazelle generate from that
4. Bump up Python deps a bit

And also whatever was required to actually get things to work - loads of
small useless changes.

Tested to work on NixOS and Ubuntu 20.04:

   $ bazel build //...
   $ bazel test //...

Change-Id: I8364bdaa1406b9ae4d0385a6b607f3e7989f98a9
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1583
Reviewed-by: q3k <q3k@hackerspace.pl>
master
q3k 2023-07-28 17:14:50 +00:00 committed by q3k
parent 291f554164
commit 97b5cd7b58
148 changed files with 7789 additions and 2536 deletions

View File

@ -6,3 +6,5 @@ build --stamp
build --workspace_status_command=./bzl/workspace-status.sh
test --build_tests_only
test --test_output=errors
build --cxxopt=-std=c++14
build --host_cxxopt=-std=c++14

View File

@ -1 +1 @@
5.2.0
5.4.1

15
BUILD
View File

@ -2,15 +2,24 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
# Used by //go/workspace tests.
exports_files(["WORKSPACE", "default.nix"])
exports_files([
"WORKSPACE",
"default.nix",
])
# gazelle:prefix code.hackerspace.pl/hscloud
# gazelle:go_naming_convention go_default_library
# gazelle:go_naming_convention import
# gazelle:exclude **/gomod-generated-placeholder.go
gazelle(name = "gazelle")
gazelle(
name = "gazelle",
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=third_party/go/repositories.bzl%go_repositories",
"-prune",
],
command = "update-repos",
)
config_setting(

184
WORKSPACE
View File

@ -2,50 +2,15 @@ workspace(
name = "hscloud",
)
local_repository(
name = "rules_jvm_external",
path = "/home/q3k/Software/rules_jvm_external",
)
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
# Protobuf deps (shared between many rules).
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
http_archive(
name = "com_google_protobuf",
sha256 = "8b28fdd45bab62d15db232ec404248901842e5340299a57765e48abe8a80d930",
strip_prefix = "protobuf-3.20.1",
urls = ["https://github.com/google/protobuf/archive/v3.20.1.tar.gz"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
rules_python_version = "0.13.0"
http_archive(
name = "rules_python",
sha256 = "8c8fe44ef0a9afc256d1e75ad5f448bb59b81aba149b8958f02f7b3a98f5d9b4",
strip_prefix = "rules_python-{}".format(rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
)
# Download Go/Gazelle rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "448e37e0dbf61d6fa8f00aaa12d191745e14f07c31cabfa731f0c8e8a4f41b97",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
],
)
# Gazelle started requiring this after we bumped the version to v0.28.0.
# Load skylib
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
@ -59,6 +24,67 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "5.4.1")
# Protobuf deps (shared between many rules).
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
http_archive(
name = "com_google_protobuf",
sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
strip_prefix = "protobuf-2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
],
)
http_archive(
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
rules_python_version = "0.24.0"
http_archive(
name = "rules_python",
sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
strip_prefix = "rules_python-{}".format(rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
)
# Download Go/Gazelle rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "51dc53293afe317d2696d4d6433a4c33feedb7748a9e352072e2ec3c0dafd2c6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("//third_party/go:repositories.bzl", "go_repositories")
# Python rules
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
@ -77,19 +103,38 @@ pip_parse(
)
load("@pydeps//:requirements.bzl", "install_deps")
install_deps()
# Setup Go toolchain.
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
go_register_toolchains(version = "1.18.3")
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
# gazelle:repository go_repository name=hscloud importpath=code.hackerspace.pl/hscloud
go_repositories()
load("@bazel_gazelle//:deps.bzl", "go_repository")
go_repository(
name = "org_golang_x_mod",
build_external = "external",
importpath = "golang.org/x/mod",
sum = "h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=",
version = "v0.10.0",
)
go_rules_dependencies()
go_register_toolchains(go_version = "1.20.5")
# IMPORTANT: match protobuf version above with the one loaded by grpc
http_archive(
name = "com_github_grpc_grpc",
sha256 = "419dba362eaf8f1d36849ceee17c3e2ff8ff12ac666b42d3ff02a164ebe090e9",
strip_prefix = "grpc-1.30.0",
urls = ["https://github.com/grpc/grpc/archive/v1.30.0.tar.gz"],
patch_args = ["-p1"],
patches = [
"//third_party:grpc_extra_deps.patch",
],
sha256 = "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa",
strip_prefix = "grpc-1.56.2",
urls = ["https://github.com/grpc/grpc/archive/v1.56.2.tar.gz"],
)
# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
@ -101,47 +146,20 @@ load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
go_rules_dependencies()
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
# Force newer version of golang.org/x/crypto that gazelle_dependencies would
# usually get.
go_repository(
name = "org_golang_x_crypto",
build_naming_convention = "go_default_library",
importpath = "golang.org/x/crypto",
sum = "h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=",
version = "v0.0.0-20210921155107-089bfa567519",
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
# Load Go third-party packages.
load("//third_party/go:repositories.bzl", "go_repositories")
go_repositories()
# Docker rules
http_archive(
name = "io_bazel_rules_docker",
sha256 = "27d53c1d646fc9537a70427ad7b034734d08a9c38924cc6357cc973fed300820",
strip_prefix = "rules_docker-0.24.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.24.0/rules_docker-v0.24.0.tar.gz"],
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)
load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
# This forces the use of Docker $HOME/.docker configuration.
docker_toolchain_configure(
name = "docker_config",
docker_path = "/usr/bin/docker",
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
@ -254,12 +272,16 @@ gerrit_owners_deps()
# Go image repos for Docker
load("@io_bazel_rules_docker//go:image.bzl", go_image_repositories = "repositories")
load(
"@io_bazel_rules_docker//go:image.bzl",
go_image_repos = "repositories",
)
go_image_repositories()
go_image_repos()
# //hswaw/site deps.
load("//hswaw/site:deps.bzl", "hswaw_site_deps")
hswaw_site_deps()
# noVNC, used by //dc/drackvm.
@ -287,7 +309,7 @@ filegroup(
http_file(
name = "calicoctl_3_15",
downloaded_file_path = "calicoctl",
urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
executable = True,
sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
)

View File

@ -22,10 +22,10 @@ go_test(
container_layer(
name = "layer_bin",
directory = "/app/matrix/",
files = [
":media-repo-proxy",
],
directory = "/app/matrix/",
)
container_image(
@ -38,10 +38,9 @@ container_image(
container_push(
name = "push",
image = ":runtime",
format = "Docker",
image = ":runtime",
registry = "registry.k0.hswaw.net",
repository = "q3k/media-repo-proxy",
tag = "1631791816-{STABLE_GIT_COMMIT}",
)

View File

@ -2,35 +2,35 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
name = "wellknown_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/app/matrix/wellknown",
visibility = ["//visibility:private"],
deps = [
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"//go/mirko",
"@com_github_golang_glog//:glog",
],
)
go_binary(
name = "wellknown",
embed = [":go_default_library"],
embed = [":wellknown_lib"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
name = "wellknown_test",
srcs = ["server_test.go"],
embed = [":go_default_library"],
deps = ["@com_github_go_test_deep//:go_default_library"],
embed = [":wellknown_lib"],
deps = ["@com_github_go_test_deep//:deep"],
)
container_layer(
name = "layer_bin",
directory = "/app/matrix/",
files = [
":wellknown",
],
directory = "/app/matrix/",
)
container_image(
@ -43,8 +43,8 @@ container_image(
container_push(
name = "push",
image = ":runtime",
format = "Docker",
image = ":runtime",
registry = "registry.k0.hswaw.net",
repository = "q3k/wellknown",
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",

View File

@ -1,32 +1,30 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
load("@subpar//:subpar.bzl", "par_binary")
load("@pydeps//:requirements.bzl", "requirement")
par_binary(
py_binary(
name = "ripe-sync",
srcs = [
"ripe-sync.py",
],
legacy_create_init = False,
deps = [
requirement("requests"),
"//bgpwtf/cccampix/proto:ix_py_proto",
"//bgpwtf/cccampix/proto:ix_grpc_proto",
"//bgpwtf/cccampix/proto:ix_py_proto",
],
legacy_create_init = False,
zip_safe = False,
)
container_layer(
name = "layer_bin",
files = [
"//bgpwtf/cccampix:ripe-sync.par",
"//bgpwtf/cccampix/irr:irr",
"//bgpwtf/cccampix/pgpencryptor:pgpencryptor",
"//bgpwtf/cccampix/peeringdb:peeringdb",
"//bgpwtf/cccampix/verifier:verifier",
"//bgpwtf/cccampix/frontend:frontend.par",
],
directory = "/ix/",
files = [
"//bgpwtf/cccampix:ripe-sync",
"//bgpwtf/cccampix/frontend",
"//bgpwtf/cccampix/irr",
"//bgpwtf/cccampix/peeringdb",
"//bgpwtf/cccampix/pgpencryptor",
"//bgpwtf/cccampix/verifier",
],
)
container_image(
@ -41,8 +39,8 @@ container_image(
container_push(
name = "push",
image = ":runtime",
format = "Docker",
image = ":runtime",
registry = "registry.k0.hswaw.net",
repository = "bgpwtf/cccampix",
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",

View File

@ -1,21 +1,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "birdie_lib",
srcs = ["birdie.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/birdie",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/proto:go_default_library",
"@com_github_golang_glog//:go_default_library",
"//bgpwtf/cccampix/proto",
"@com_github_golang_glog//:glog",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//credentials:go_default_library",
"@org_golang_google_grpc//credentials",
],
)
go_binary(
name = "birdie",
embed = [":go_default_library"],
embed = [":birdie_lib"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
)

View File

@ -1,11 +1,10 @@
load("@subpar//:subpar.bzl", "par_binary")
load("@pydeps//:requirements.bzl", "requirement")
py_library(
name = "frontend_lib",
srcs = [
"frontend.py",
"channel.py",
"frontend.py",
],
data = glob([
"templates/**",
@ -15,8 +14,8 @@ py_library(
requirement("flask"),
requirement("werkzeug"),
requirement("itsdangerous"),
"//bgpwtf/cccampix/proto:ix_py_proto",
"//bgpwtf/cccampix/proto:ix_grpc_proto",
"//bgpwtf/cccampix/proto:ix_py_proto",
],
)
@ -31,22 +30,21 @@ py_binary(
],
)
par_binary(
py_binary(
name = "frontend",
main = "server.py",
srcs = [
"server.py",
],
legacy_create_init = False,
main = "server.py",
visibility = [
"//bgpwtf/cccampix:__pkg__",
],
deps = [
":frontend_lib",
requirement("gevent"),
requirement("gunicorn"),
requirement("greenlet"),
],
visibility = [
"//bgpwtf/cccampix:__pkg__",
],
legacy_create_init = False,
zip_safe = False,
#no_remove = True,
)

View File

@ -1,22 +1,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "irr_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/irr/provider:go_default_library",
"//bgpwtf/cccampix/proto:go_default_library",
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"//bgpwtf/cccampix/irr/provider",
"//bgpwtf/cccampix/proto",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
go_binary(
name = "irr",
embed = [":go_default_library"],
embed = [":irr_lib"],
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
name = "provider",
srcs = [
"arin.go",
"iana.go",
@ -12,21 +12,21 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr/provider",
visibility = ["//visibility:public"],
deps = [
"//bgpwtf/cccampix/irr/whois:go_default_library",
"//bgpwtf/cccampix/proto:go_default_library",
"@com_github_golang_collections_go_datastructures//augmentedtree:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"//bgpwtf/cccampix/irr/whois",
"//bgpwtf/cccampix/proto",
"@com_github_golang_collections_go_datastructures//augmentedtree",
"@com_github_golang_glog//:glog",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
go_test(
name = "go_default_test",
name = "provider_test",
srcs = ["rpsl_test.go"],
embed = [":go_default_library"],
embed = [":provider"],
deps = [
"//bgpwtf/cccampix/proto:go_default_library",
"@com_github_go_test_deep//:go_default_library",
"//bgpwtf/cccampix/proto",
"@com_github_go_test_deep//:deep",
],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "whois",
srcs = ["whois.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr/whois",
visibility = ["//visibility:public"],

View File

@ -2,17 +2,17 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
container_layer(
name = "layer_bin",
files = [
"@com_github_cloudflare_cfrpki//cmd/octorpki:octorpki",
"entrypoint.sh",
],
directory = "/octorpki/",
files = [
"entrypoint.sh",
"@com_github_cloudflare_cfrpki//cmd/octorpki",
],
visibility = ["//bgpwtf/cccampix:__pkg__"],
)
container_layer(
name = "layer_tals",
files = glob(["tals/*"]),
directory = "/octorpki/tals/",
files = glob(["tals/*"]),
visibility = ["//bgpwtf/cccampix:__pkg__"],
)

View File

@ -0,0 +1,8 @@
//go:build tools
// +tools
package octorpki
import (
_ "github.com/cloudflare/cfrpki/cmd/octorpki"
)

View File

@ -1,22 +1,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "peeringdb_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/peeringdb",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/peeringdb/schema:go_default_library",
"//bgpwtf/cccampix/proto:go_default_library",
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"//bgpwtf/cccampix/peeringdb/schema",
"//bgpwtf/cccampix/proto",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
go_binary(
name = "peeringdb",
embed = [":go_default_library"],
embed = [":peeringdb_lib"],
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "schema",
srcs = [
"schema.go",
"urls.go",

View File

@ -1,25 +1,25 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "pgpencryptor_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/pgpencryptor/gpg:go_default_library",
"//bgpwtf/cccampix/pgpencryptor/hkp:go_default_library",
"//bgpwtf/cccampix/pgpencryptor/model:go_default_library",
"//bgpwtf/cccampix/proto:go_default_library",
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_lib_pq//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"//bgpwtf/cccampix/pgpencryptor/gpg",
"//bgpwtf/cccampix/pgpencryptor/hkp",
"//bgpwtf/cccampix/pgpencryptor/model",
"//bgpwtf/cccampix/proto",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@com_github_lib_pq//:pq",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
go_binary(
name = "pgpencryptor",
embed = [":go_default_library"],
embed = [":pgpencryptor_lib"],
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "gpg",
srcs = ["gpg.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/gpg",
visibility = ["//visibility:public"],

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "hkp",
srcs = ["hkp.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/hkp",
visibility = ["//visibility:public"],

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "model",
srcs = [
"model.go",
"pgp.go",
@ -10,10 +10,10 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/model",
visibility = ["//visibility:public"],
deps = [
"//bgpwtf/cccampix/pgpencryptor/model/migrations:go_default_library",
"@com_github_golang_migrate_migrate_v4//:go_default_library",
"@com_github_golang_migrate_migrate_v4//database/cockroachdb:go_default_library",
"@com_github_jmoiron_sqlx//:go_default_library",
"@com_github_lib_pq//:go_default_library",
"//bgpwtf/cccampix/pgpencryptor/model/migrations",
"@com_github_golang_migrate_migrate_v4//:migrate",
"@com_github_golang_migrate_migrate_v4//database/cockroachdb",
"@com_github_jmoiron_sqlx//:sqlx",
"@com_github_lib_pq//:pq",
],
)

View File

@ -4,12 +4,12 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
go_embed_data(
name = "migrations_data",
srcs = glob(["*.sql"]),
package = "migrations",
flatten = True,
package = "migrations",
)
go_library(
name = "go_default_library",
name = "migrations",
srcs = [
"migrations.go",
":migrations_data", # keep
@ -17,7 +17,7 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/model/migrations",
visibility = ["//bgpwtf/cccampix/pgpencryptor/model:__subpackages__"],
deps = [
"//go/mirko:go_default_library",
"@com_github_golang_migrate_migrate_v4//:go_default_library",
"//go/mirko",
"@com_github_golang_migrate_migrate_v4//:migrate",
],
)

View File

@ -1,7 +1,7 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
proto_library(
name = "ix_proto",
@ -18,7 +18,7 @@ go_proto_library(
)
go_library(
name = "go_default_library",
name = "proto",
embed = [":ix_go_proto"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto",
visibility = ["//visibility:public"],
@ -26,13 +26,13 @@ go_library(
py_proto_library(
name = "ix_py_proto",
deps = [":ix_proto"],
visibility = ["//visibility:public"],
deps = [":ix_proto"],
)
py_grpc_library(
name = "ix_grpc_proto",
srcs = [":ix_proto"],
deps = [":ix_py_proto"],
visibility = ["//visibility:public"],
deps = [":ix_py_proto"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "verifier_lib",
srcs = [
"main.go",
"processor_irr.go",
@ -17,24 +17,24 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/proto:go_default_library",
"//bgpwtf/cccampix/verifier/model:go_default_library",
"//go/mirko:go_default_library",
"//go/pki:go_default_library",
"//go/statusz:go_default_library",
"@com_github_dustin_go_humanize//:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_lib_pq//:go_default_library",
"@com_github_sethvargo_go_password//password:go_default_library",
"//bgpwtf/cccampix/proto",
"//bgpwtf/cccampix/verifier/model",
"//go/mirko",
"//go/pki",
"//go/statusz",
"@com_github_dustin_go_humanize//:go-humanize",
"@com_github_golang_glog//:glog",
"@com_github_lib_pq//:pq",
"@com_github_sethvargo_go_password//password",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@org_golang_x_net//trace:go_default_library",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_x_net//trace",
],
)
go_binary(
name = "verifier",
embed = [":go_default_library"],
embed = [":verifier_lib"],
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "model",
srcs = [
"allowed_prefixes.go",
"checkable_peers.go",
@ -17,12 +17,12 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier/model",
visibility = ["//visibility:public"],
deps = [
"//bgpwtf/cccampix/proto:go_default_library",
"//bgpwtf/cccampix/verifier/model/migrations:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_golang_migrate_migrate_v4//:go_default_library",
"@com_github_golang_migrate_migrate_v4//database/cockroachdb:go_default_library",
"@com_github_jmoiron_sqlx//:go_default_library",
"@com_github_lib_pq//:go_default_library",
"//bgpwtf/cccampix/proto",
"//bgpwtf/cccampix/verifier/model/migrations",
"@com_github_golang_glog//:glog",
"@com_github_golang_migrate_migrate_v4//:migrate",
"@com_github_golang_migrate_migrate_v4//database/cockroachdb",
"@com_github_jmoiron_sqlx//:sqlx",
"@com_github_lib_pq//:pq",
],
)

View File

@ -4,12 +4,12 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
go_embed_data(
name = "migrations_data",
srcs = glob(["*.sql"]),
package = "migrations",
flatten = True,
package = "migrations",
)
go_library(
name = "go_default_library",
name = "migrations",
srcs = [
"migrations.go",
":migrations_data", # keep
@ -17,7 +17,7 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier/model/migrations",
visibility = ["//bgpwtf/cccampix/verifier/model:__subpackages__"],
deps = [
"//go/mirko:go_default_library",
"@com_github_golang_migrate_migrate_v4//:go_default_library",
"//go/mirko",
"@com_github_golang_migrate_migrate_v4//:migrate",
],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
name = "invoice_lib",
srcs = [
"calc.go",
"main.go",
@ -13,27 +13,28 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/invoice/proto:go_default_library",
"//bgpwtf/invoice/templates:go_default_library",
"//go/mirko:go_default_library",
"//go/statusz:go_default_library",
"@com_github_golang_glog//:go_default_library",
"//bgpwtf/invoice/proto",
"//bgpwtf/invoice/templates",
"//go/mirko",
"//go/statusz",
"@com_github_golang_glog//:glog",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_mattn_go_sqlite3//:go_default_library",
"@com_github_sebastiaanklippert_go_wkhtmltopdf//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@com_github_mattn_go_sqlite3//:go-sqlite3",
"@com_github_sebastiaanklippert_go_wkhtmltopdf//:go-wkhtmltopdf",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
go_binary(
name = "invoice",
embed = [":go_default_library"],
embed = [":invoice_lib"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
name = "invoice_test",
srcs = ["calc_test.go"],
embed = [":go_default_library"],
embed = [":invoice_lib"],
deps = ["//bgpwtf/invoice/proto"],
)

View File

@ -20,7 +20,7 @@ go_proto_library(
)
go_library(
name = "go_default_library",
name = "proto",
embed = [":proto_go_proto"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice/proto",
visibility = ["//visibility:public"],

View File

@ -1,14 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "recurrent_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice/recurrent",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/invoice/proto:go_default_library",
"//go/pki:go_default_library",
"@com_github_golang_glog//:go_default_library",
"//bgpwtf/invoice/proto",
"//go/pki",
"@com_github_golang_glog//:glog",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
],
@ -16,6 +16,6 @@ go_library(
go_binary(
name = "recurrent",
embed = [":go_default_library"],
embed = [":recurrent_lib"],
visibility = ["//visibility:public"],
)

View File

@ -7,7 +7,7 @@ import (
"strings"
"time"
wkhtml "github.com/sebastiaanklippert/go-wkhtmltopdf"
wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf"
pb "code.hackerspace.pl/hscloud/bgpwtf/invoice/proto"
"code.hackerspace.pl/hscloud/bgpwtf/invoice/templates"

View File

@ -9,7 +9,7 @@ bindata(
)
go_library(
name = "go_default_library",
name = "templates",
srcs = [
":templates_bindata", # keep
],

View File

@ -4,7 +4,11 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
go_embed_data(
name = "static",
srcs = ["index.html", "speedtest.js", "speedtest_worker.js"],
srcs = [
"index.html",
"speedtest.js",
"speedtest_worker.js",
],
package = "static",
)
@ -17,17 +21,17 @@ go_library(
)
container_image(
name="latest",
base="@prodimage-bionic//image",
files = ["//bgpwtf/speedtest/backend:backend"],
name = "latest",
base = "@prodimage-bionic//image",
directory = "/hscloud",
entrypoint = ["/hscloud/backend"],
files = ["//bgpwtf/speedtest/backend"],
)
container_push(
name = "push",
image = ":latest",
format = "Docker",
image = ":latest",
registry = "registry.k0.hswaw.net",
repository = "q3k/speedetst",
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",

View File

@ -1,24 +1,24 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
name = "backend_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/speedtest/backend",
visibility = ["//visibility:private"],
deps = [
"@com_github_golang_glog//:go_default_library",
"//bgpwtf/speedtest:static_go", # keep
"//bgpwtf/speedtest:static_go", # keep
"@com_github_golang_glog//:glog",
],
)
go_binary(
name = "backend",
embed = [":go_default_library"],
embed = [":backend_lib"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
name = "backend_test",
srcs = ["main_test.go"],
embed = [":go_default_library"],
embed = [":backend_lib"],
)

View File

@ -30,7 +30,7 @@ echo STABLE_GIT_COMMIT $(git rev-parse HEAD)
echo STABLE_GIT_VERSION $(rev .)
echo STABLE_BUILDER $(id -un)@$(hostname -f):$(pwd)
# Kubernetes compatibility - see //third_party/go/kubernetes:version.bzl.
# Kubernetes compatibility - see //third_party/go:kubernetes_version_def.bzl.
echo STABLE_KUBERNETES_buildDate $(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo STABLE_KUBERNETES_gitCommit $(git rev-parse HEAD)
echo STABLE_KUBERNETES_gitMajor $KUBE_MAJOR

View File

@ -2,7 +2,7 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
name = "admitomatic_lib",
srcs = [
"ingress.go",
"main.go",
@ -11,40 +11,40 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic",
visibility = ["//visibility:private"],
deps = [
"//cluster/admitomatic/config:go_default_library",
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@io_k8s_api//admission/v1beta1:go_default_library",
"@io_k8s_api//networking/v1beta1:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@org_golang_google_protobuf//encoding/prototext:go_default_library",
"//cluster/admitomatic/config",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@io_k8s_api//admission/v1beta1",
"@io_k8s_api//networking/v1beta1",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
"@org_golang_google_protobuf//encoding/prototext",
],
)
go_binary(
name = "admitomatic",
embed = [":go_default_library"],
embed = [":admitomatic_lib"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
name = "admitomatic_test",
srcs = ["ingress_test.go"],
embed = [":go_default_library"],
embed = [":admitomatic_lib"],
deps = [
"@io_k8s_api//admission/v1beta1:go_default_library",
"@io_k8s_api//networking/v1beta1:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_api//admission/v1beta1",
"@io_k8s_api//networking/v1beta1",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
"@io_k8s_apimachinery//pkg/runtime",
],
)
container_layer(
name = "layer_bin",
directory = "/cluster/admitomatic/",
files = [
":admitomatic",
],
directory = "/cluster/admitomatic/",
)
container_image(
@ -57,8 +57,8 @@ container_image(
container_push(
name = "push",
image = ":runtime",
format = "Docker",
image = ":runtime",
registry = "registry.k0.hswaw.net",
repository = "cluster/admitomatic",
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",

View File

@ -16,7 +16,7 @@ go_proto_library(
)
go_library(
name = "go_default_library",
name = "config",
embed = [":config_go_proto"],
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic/config",
visibility = ["//visibility:public"],

View File

@ -4,15 +4,15 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
go_embed_data(
name = "certs_data",
srcs = glob(["*.crt"]),
package = "certs",
flatten = True,
package = "certs",
)
go_library(
name = "go_default_library",
name = "certs",
srcs = [
":certs_data", # keep
],
importpath = "code.hackerspace.pl/cluster/certs",
importpath = "code.hackerspace.pl/hscloud/cluster/certs", # keep
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
name = "clustercfg_lib",
srcs = [
"cmd_admincreds.go",
"cmd_gencerts.go",
@ -10,16 +10,16 @@ go_library(
importpath = "code.hackerspace.pl/hscloud/cluster/clustercfg",
visibility = ["//visibility:private"],
deps = [
"//cluster/clustercfg/certs:go_default_library",
"//go/workspace:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@io_k8s_client_go//tools/clientcmd:go_default_library",
"@io_k8s_client_go//tools/clientcmd/api:go_default_library",
"//cluster/clustercfg/certs",
"//go/workspace",
"@com_github_spf13_cobra//:cobra",
"@io_k8s_client_go//tools/clientcmd",
"@io_k8s_client_go//tools/clientcmd/api",
],
)
go_binary(
name = "clustercfg",
embed = [":go_default_library"],
embed = [":clustercfg_lib"],
visibility = ["//visibility:public"],
)

View File

@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
name = "certs",
srcs = [
"certs.go",
"generator.go",