2021-04-08 06:37:51 +00:00
|
|
|
# WORKSPACE
|
|
|
|
#
|
|
|
|
# This file exists to configure the Bazel (https://bazel.build/) build tool to our needs.
|
|
|
|
# Particularly, it installs rule definitions and other capabilities which aren't in Bazel core.
|
|
|
|
# In the future we may have our own modifications to this config.
|
|
|
|
|
|
|
|
# Install the blessed Python and PyPi rule support
|
|
|
|
# From https://github.com/bazelbuild/rules_python
|
|
|
|
|
|
|
|
workspace(
|
|
|
|
name = "arrdem_source",
|
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
|
|
|
"@bazel_tools//tools/build_defs/repo:http.bzl",
|
|
|
|
"http_archive",
|
|
|
|
"http_file",
|
|
|
|
)
|
|
|
|
load(
|
|
|
|
"@bazel_tools//tools/build_defs/repo:git.bzl",
|
|
|
|
"git_repository",
|
|
|
|
)
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
# Skylib
|
|
|
|
####################################################################################################
|
|
|
|
git_repository(
|
|
|
|
name = "bazel_skylib",
|
|
|
|
remote = "https://github.com/bazelbuild/bazel-skylib.git",
|
|
|
|
tag = "1.0.3",
|
|
|
|
)
|
|
|
|
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|
|
|
bazel_skylib_workspace()
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
# Python support
|
|
|
|
####################################################################################################
|
2021-08-30 01:23:39 +00:00
|
|
|
|
2021-04-08 06:37:51 +00:00
|
|
|
# Using rules_python at a more recent SHA than the last release like a baws
|
|
|
|
git_repository(
|
|
|
|
name = "rules_python",
|
|
|
|
remote = "https://github.com/bazelbuild/rules_python.git",
|
2022-04-12 07:49:12 +00:00
|
|
|
# tag = "0.4.0",
|
2022-11-20 06:54:45 +00:00
|
|
|
commit = "f0efec5cf8c0ae16483ee677a09ec70737a01bf5",
|
2021-04-08 06:37:51 +00:00
|
|
|
)
|
|
|
|
|
2021-08-30 03:59:32 +00:00
|
|
|
register_toolchains("//tools/python:python3_toolchain")
|
|
|
|
|
2021-04-08 06:37:51 +00:00
|
|
|
# pip package pinnings need to be initialized.
|
|
|
|
# this generates a bunch of bzl rules so that each pip dep is a bzl target
|
2021-09-19 23:59:18 +00:00
|
|
|
load("@rules_python//python:pip.bzl", "pip_parse")
|
2021-04-08 06:37:51 +00:00
|
|
|
|
2021-09-19 23:59:18 +00:00
|
|
|
pip_parse(
|
2021-04-08 06:37:51 +00:00
|
|
|
name = "arrdem_source_pypi",
|
2021-09-19 23:59:18 +00:00
|
|
|
requirements_lock = "//tools/python:requirements.txt",
|
2022-05-12 06:20:59 +00:00
|
|
|
python_interpreter_target = "//tools/python:pythonshim",
|
2021-04-08 06:37:51 +00:00
|
|
|
)
|
|
|
|
|
2021-09-19 23:59:18 +00:00
|
|
|
# Load the starlark macro which will define your dependencies.
|
|
|
|
load("@arrdem_source_pypi//:requirements.bzl", "install_deps")
|
|
|
|
|
|
|
|
# Call it to define repos for your requirements.
|
|
|
|
install_deps()
|
|
|
|
|
2022-05-12 06:20:59 +00:00
|
|
|
git_repository(
|
2022-11-20 06:54:45 +00:00
|
|
|
name = "rules_zapp",
|
|
|
|
remote = "https://git.arrdem.com/arrdem/rules_zapp.git",
|
2022-11-26 21:18:51 +00:00
|
|
|
commit = "72f82e0ace184fe862f1b19c4f71c3bc36cf335b",
|
2022-11-20 06:54:45 +00:00
|
|
|
# tag = "0.1.2",
|
2021-04-08 06:37:51 +00:00
|
|
|
)
|
2022-05-12 06:20:59 +00:00
|
|
|
|
|
|
|
# local_repository(
|
|
|
|
# name = "rules_zapp",
|
2022-11-26 21:18:51 +00:00
|
|
|
# path = "/home/arrdem/Documents/hobby/programming/lang/python/rules_zapp",
|
2022-05-12 06:20:59 +00:00
|
|
|
# )
|
2022-11-20 06:54:45 +00:00
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
# Docker support
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "io_bazel_rules_docker",
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
|
|
|
|
docker_toolchain_configure(
|
|
|
|
name = "docker_config",
|
|
|
|
docker_flags = [
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
|
|
|
"@io_bazel_rules_docker//repositories:repositories.bzl",
|
|
|
|
container_repositories = "repositories",
|
|
|
|
)
|
|
|
|
container_repositories()
|
|
|
|
|
|
|
|
load(
|
|
|
|
"@io_bazel_rules_docker//repositories:deps.bzl",
|
|
|
|
container_deps = "deps"
|
|
|
|
)
|
|
|
|
|
|
|
|
container_deps()
|
|
|
|
|
|
|
|
load(
|
|
|
|
"@io_bazel_rules_docker//container:container.bzl",
|
|
|
|
"container_pull",
|
|
|
|
)
|
|
|
|
|
|
|
|
# container_pull(
|
|
|
|
# name = "python_base",
|
|
|
|
# registry = "index.docker.io",
|
|
|
|
# repository = "library/python",
|
|
|
|
# tag = "3.10.8-alpine"
|
|
|
|
# # sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
|
|
|
|
# )
|
|
|
|
|
|
|
|
# container_pull(
|
|
|
|
# name = "python_base",
|
|
|
|
# registry = "gcr.io",
|
|
|
|
# repository = "distroless/python3-debian11",
|
|
|
|
# tag = "latest"
|
|
|
|
# # sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
|
|
|
|
# )
|
|
|
|
|
|
|
|
container_pull(
|
|
|
|
name = "python_base",
|
|
|
|
registry = "index.docker.io",
|
|
|
|
repository = "library/python",
|
|
|
|
tag = "3.11-buster"
|
|
|
|
# sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
|
|
|
|
)
|