2022-03-28 16:39:36 +02:00
|
|
|
load("@io_bazel_rules_docker//python:image.bzl", "py_layer")
|
2021-04-23 17:23:02 +02:00
|
|
|
load("@io_bazel_rules_docker//python3:image.bzl", "py3_image")
|
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
2021-04-24 13:15:41 +02:00
|
|
|
|
2021-04-23 17:23:02 +02:00
|
|
|
load("@pip_modules//:requirements.bzl", "requirement")
|
|
|
|
|
|
|
|
alias(
|
|
|
|
name = "binary",
|
|
|
|
actual = ":image.binary",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2022-03-28 16:39:36 +02:00
|
|
|
DEPS = [
|
|
|
|
requirement("aiochclient"),
|
|
|
|
requirement("aiohttp"),
|
2022-09-02 17:44:56 +02:00
|
|
|
requirement("aiosumma"),
|
2022-03-28 16:39:36 +02:00
|
|
|
requirement("cachetools"),
|
2022-09-02 17:44:56 +02:00
|
|
|
requirement("en_core_web_sm"),
|
2022-03-28 16:39:36 +02:00
|
|
|
requirement("grpcio"),
|
|
|
|
requirement("lightgbm"),
|
|
|
|
requirement("numpy"),
|
|
|
|
requirement("protobuf"),
|
|
|
|
requirement("recordclass"),
|
|
|
|
requirement("uvloop"),
|
|
|
|
"//library/aiogrpctools",
|
2022-09-02 17:44:56 +02:00
|
|
|
requirement("aiokit"),
|
2022-03-28 16:39:36 +02:00
|
|
|
"//library/aiopostgres",
|
|
|
|
"//library/configurator",
|
|
|
|
"//library/logging",
|
|
|
|
"//nexus/meta_api/proto:grpc_py",
|
|
|
|
"//nexus/models/proto:proto_py",
|
|
|
|
"//nexus/views/telegram",
|
2022-09-02 17:44:56 +02:00
|
|
|
requirement("izihawa_nlptools"),
|
2022-03-28 16:39:36 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
py_layer(
|
|
|
|
name = "common_deps",
|
|
|
|
filter = "//pkg/common",
|
|
|
|
deps = DEPS,
|
|
|
|
)
|
|
|
|
|
|
|
|
py_layer(
|
|
|
|
name = "common_external_deps",
|
|
|
|
filter = "@",
|
|
|
|
deps = [":common_deps"],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_layer(
|
|
|
|
name = "external_deps",
|
|
|
|
filter = "@",
|
|
|
|
deps = DEPS,
|
|
|
|
)
|
|
|
|
|
2021-04-23 17:23:02 +02:00
|
|
|
py3_image(
|
|
|
|
name = "image",
|
|
|
|
srcs = glob(
|
|
|
|
["**/*.py"],
|
|
|
|
exclude = ["proto/**/*.py"],
|
|
|
|
),
|
|
|
|
base = "//images/production:base-python-image",
|
|
|
|
data = [
|
|
|
|
"configs/base.yaml",
|
|
|
|
"configs/logging.yaml",
|
|
|
|
"models/classic.txt",
|
|
|
|
],
|
2022-03-28 16:39:36 +02:00
|
|
|
layers = [
|
|
|
|
":common_external_deps",
|
|
|
|
":common_deps",
|
|
|
|
":external_deps",
|
|
|
|
],
|
2021-04-23 17:23:02 +02:00
|
|
|
main = "main.py",
|
|
|
|
srcs_version = "PY3ONLY",
|
|
|
|
visibility = ["//visibility:public"],
|
2022-03-28 16:39:36 +02:00
|
|
|
deps = DEPS,
|
2021-04-23 17:23:02 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
py_binary(
|
|
|
|
name = "cli",
|
|
|
|
srcs = ["cli.py"],
|
|
|
|
main = "cli.py",
|
|
|
|
deps = [
|
|
|
|
requirement("fire"),
|
2021-04-24 13:15:41 +02:00
|
|
|
"//nexus/meta_api/aioclient",
|
2021-04-23 17:23:02 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
container_push(
|
|
|
|
name = "push-public-latest",
|
|
|
|
format = "Docker",
|
|
|
|
image = ":image",
|
|
|
|
registry = "registry.hub.docker.com",
|
2021-04-30 15:05:39 +02:00
|
|
|
repository = "thesuperpirate/nexus-meta-api",
|
2021-04-23 17:23:02 +02:00
|
|
|
tag = "latest",
|
|
|
|
)
|
|
|
|
|
|
|
|
container_push(
|
|
|
|
name = "push-public-testing",
|
|
|
|
format = "Docker",
|
|
|
|
image = ":image",
|
|
|
|
registry = "registry.hub.docker.com",
|
2021-04-30 15:05:39 +02:00
|
|
|
repository = "thesuperpirate/nexus-meta-api",
|
2021-04-23 17:23:02 +02:00
|
|
|
tag = "testing",
|
|
|
|
)
|