Allow docker packaging of podcast review example
Some checks failed
/ setup (push) Has been cancelled
Some checks failed
/ setup (push) Has been cancelled
This commit is contained in:
parent
f9cacf6491
commit
b767a74350
2 changed files with 76 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
|||
load("//:py_repl.bzl", "py_repl")
|
||||
load("@databuild//databuild:rules.bzl", "databuild_job", "databuild_graph")
|
||||
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
|
||||
load("@databuild//databuild:rules.bzl", "databuild_graph", "databuild_job")
|
||||
load("@pypi//:requirements.bzl", "requirement")
|
||||
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
|
||||
load("//:py_repl.bzl", "py_repl")
|
||||
|
||||
compile_pip_requirements(
|
||||
name = "py_requirements",
|
||||
|
|
@ -9,6 +9,22 @@ compile_pip_requirements(
|
|||
requirements_txt = "requirements_lock.txt",
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "linux_arm",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:arm64",
|
||||
],
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "linux_x86",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
# Podcast Reviews Graph
|
||||
databuild_graph(
|
||||
name = "podcast_reviews_graph",
|
||||
|
|
@ -39,7 +55,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "extract_reviews_binary",
|
||||
srcs = ["extract_reviews_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"duckdb_utils.py",
|
||||
"extract_reviews_job.py",
|
||||
],
|
||||
main = "extract_reviews_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -58,7 +77,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "extract_podcasts_binary",
|
||||
srcs = ["extract_podcasts_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"duckdb_utils.py",
|
||||
"extract_podcasts_job.py",
|
||||
],
|
||||
main = "extract_podcasts_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -77,7 +99,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "categorize_reviews_binary",
|
||||
srcs = ["categorize_reviews_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"categorize_reviews_job.py",
|
||||
"duckdb_utils.py",
|
||||
],
|
||||
main = "categorize_reviews_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -96,7 +121,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "phrase_modeling_binary",
|
||||
srcs = ["phrase_modeling_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"duckdb_utils.py",
|
||||
"phrase_modeling_job.py",
|
||||
],
|
||||
main = "phrase_modeling_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -115,7 +143,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "phrase_stats_binary",
|
||||
srcs = ["phrase_stats_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"duckdb_utils.py",
|
||||
"phrase_stats_job.py",
|
||||
],
|
||||
main = "phrase_stats_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -134,7 +165,10 @@ databuild_job(
|
|||
|
||||
py_binary(
|
||||
name = "daily_summary_binary",
|
||||
srcs = ["daily_summary_job.py", "duckdb_utils.py"],
|
||||
srcs = [
|
||||
"daily_summary_job.py",
|
||||
"duckdb_utils.py",
|
||||
],
|
||||
main = "daily_summary_job.py",
|
||||
deps = [
|
||||
requirement("duckdb"),
|
||||
|
|
@ -160,15 +194,15 @@ py_binary(
|
|||
py_binary(
|
||||
name = "test_jobs",
|
||||
srcs = [
|
||||
"test_jobs.py",
|
||||
"extract_reviews_job.py",
|
||||
"extract_podcasts_job.py",
|
||||
"categorize_reviews_job.py",
|
||||
"daily_summary_job.py",
|
||||
"duckdb_utils.py",
|
||||
"extract_podcasts_job.py",
|
||||
"extract_reviews_job.py",
|
||||
"job_lookup.py",
|
||||
"phrase_modeling_job.py",
|
||||
"phrase_stats_job.py",
|
||||
"daily_summary_job.py",
|
||||
"job_lookup.py",
|
||||
"duckdb_utils.py",
|
||||
"test_jobs.py",
|
||||
],
|
||||
main = "test_jobs.py",
|
||||
deps = [
|
||||
|
|
@ -184,5 +218,5 @@ py_repl(
|
|||
deps = [
|
||||
requirement("duckdb"),
|
||||
requirement("pydantic"),
|
||||
]
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -23,5 +23,30 @@ pip.parse(
|
|||
python_version = "3.13",
|
||||
requirements_lock = "//:requirements_lock.txt",
|
||||
)
|
||||
|
||||
use_repo(pip, "pypi")
|
||||
|
||||
# Rules OCI - necessary for producing a docker container
|
||||
bazel_dep(name = "rules_oci", version = "2.2.6")
|
||||
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
|
||||
|
||||
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
|
||||
|
||||
# Declare external images you need to pull, for example:
|
||||
oci.pull(
|
||||
name = "debian",
|
||||
image = "docker.io/library/python",
|
||||
platforms = [
|
||||
"linux/arm64/v8",
|
||||
"linux/amd64",
|
||||
],
|
||||
# 'latest' is not reproducible, but it's convenient.
|
||||
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
|
||||
# values which you can use here in place of 'tag' to pin for reproducibility.
|
||||
tag = "3.12-bookworm",
|
||||
)
|
||||
|
||||
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
|
||||
use_repo(oci, "debian", "debian_linux_amd64", "debian_linux_arm64_v8")
|
||||
|
||||
# Platforms for specifying linux/arm
|
||||
bazel_dep(name = "platforms", version = "0.0.11")
|
||||
|
|
|
|||
Loading…
Reference in a new issue