Skip to content

Commit 0b405b4

Browse files
committed
ci: add Bazel RBE lane
1 parent 3bee227 commit 0b405b4

13 files changed

Lines changed: 705 additions & 1 deletion

File tree

.bazelignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.venv
3+
venv
4+
.orbit
5+
htmlcov

.bazelrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
common --enable_bzlmod
2+
common --announce_rc
3+
common --color=yes
4+
common --terminal_columns=120
5+
6+
build --verbose_failures
7+
build --experimental_repository_cache_hardlinks
8+
build --experimental_convenience_symlinks=ignore
9+
10+
test --test_output=errors
11+
test --test_summary=terse
12+
13+
build:remote-gcp-dev --remote_executor=grpc://127.0.0.1:8980
14+
build:remote-gcp-dev --remote_timeout=3600
15+
build:remote-gcp-dev --remote_download_toplevel
16+
build:remote-gcp-dev --remote_default_exec_properties=container-image=docker://gcr.io/cloud-marketplace/google/rbe-ubuntu24-04@sha256:70a81b361f88e9bc3668e6f7f1a45e7036f15fdf073aede238d9b64c548cc0c0
17+
build:remote-gcp-dev --host_platform=//bazel/platforms:linux_x86_64
18+
build:remote-gcp-dev --platforms=//bazel/platforms:linux_x86_64
19+
build:remote-gcp-dev --extra_execution_platforms=//bazel/platforms:linux_x86_64
20+
build:remote-gcp-dev --spawn_strategy=remote
21+
build:remote-gcp-dev --strategy=Genrule=remote
22+
build:remote-gcp-dev --strategy=PyCompile=remote
23+
build:remote-gcp-dev --jobs=32
24+
test:remote-gcp-dev --test_output=errors
25+
26+
try-import %workspace%/.bazelrc.user

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9.1.0

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self-hosted-runner:
2+
labels:
3+
- blacksmith-4vcpu-ubuntu-2404
4+
- evalops-orbit-agent-rbe
5+
- bazel-rbe

.github/workflows/bazel-rbe.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Bazel RBE
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".bazel*"
7+
- ".github/actionlint.yaml"
8+
- ".github/workflows/bazel-rbe.yml"
9+
- "BUILD.bazel"
10+
- "MODULE.bazel"
11+
- "MODULE.bazel.lock"
12+
- "bazel/**"
13+
- "evals/**"
14+
- "orbit_agent/**"
15+
- "playbooks/**"
16+
- "requirements-dev.lock"
17+
- "scripts/run-bazel-rbe.sh"
18+
- "tests/**"
19+
push:
20+
branches: [main]
21+
paths:
22+
- ".bazel*"
23+
- ".github/actionlint.yaml"
24+
- ".github/workflows/bazel-rbe.yml"
25+
- "BUILD.bazel"
26+
- "MODULE.bazel"
27+
- "MODULE.bazel.lock"
28+
- "bazel/**"
29+
- "evals/**"
30+
- "orbit_agent/**"
31+
- "playbooks/**"
32+
- "requirements-dev.lock"
33+
- "scripts/run-bazel-rbe.sh"
34+
- "tests/**"
35+
workflow_dispatch:
36+
37+
permissions:
38+
contents: read
39+
40+
jobs:
41+
smoke:
42+
if: github.event_name == 'workflow_dispatch' || vars.BAZEL_RBE_ENABLED == 'true'
43+
runs-on:
44+
- self-hosted
45+
- evalops-orbit-agent-rbe
46+
- bazel-rbe
47+
timeout-minutes: 30
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@de0facc42343c4c3d0f2fb3f1f251f9f7e3ce75b # v6.0.2
51+
52+
- name: Set up Go for Bazel tools
53+
uses: actions/setup-go@4a3601d38874680202d6939c4edd8cf679bd637a # v6.4.0
54+
with:
55+
go-version: "1.26.3"
56+
57+
- name: Install Bazel tools
58+
env:
59+
GOBIN: ${{ runner.temp }}/go-bin
60+
run: |
61+
go install github.com/bazelbuild/bazelisk@latest
62+
go install github.com/bazelbuild/buildtools/buildifier@latest
63+
echo "${GOBIN}" >> "${GITHUB_PATH}"
64+
65+
- name: Run Bazel checks
66+
run: make bazel-check
67+
68+
- name: Run Bazel RBE smoke
69+
run: make bazel-rbe-smoke

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ build/
1515
# Local data
1616
.orbit/
1717

18+
# Bazel
19+
/bazel-*
20+
1821
# IDE
1922
.idea/
2023
.vscode/

BUILD.bazel

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
load("@pypi//:requirements.bzl", "requirement")
2+
load("@rules_python//python:defs.bzl", "py_library", "py_test")
3+
4+
RUNTIME_DEPS = [
5+
requirement("dspy-ai"),
6+
requirement("Flask"),
7+
requirement("Flask-Limiter"),
8+
requirement("pydantic"),
9+
requirement("PyYAML"),
10+
requirement("python-dotenv"),
11+
requirement("requests"),
12+
requirement("rich"),
13+
requirement("twilio"),
14+
requirement("typer"),
15+
]
16+
17+
py_library(
18+
name = "orbit_agent",
19+
srcs = glob(["orbit_agent/**/*.py"]),
20+
data = glob([
21+
"evals/**/*.yaml",
22+
"playbooks/**/*.yaml",
23+
]),
24+
imports = ["."],
25+
visibility = ["//visibility:public"],
26+
deps = RUNTIME_DEPS,
27+
)
28+
29+
py_test(
30+
name = "pytest",
31+
srcs = glob(["tests/**/*.py"]),
32+
main = "tests/pytest_main.py",
33+
deps = [
34+
":orbit_agent",
35+
requirement("pytest"),
36+
],
37+
)

MODULE.bazel

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module(
2+
name = "evalops_orbit_agent",
3+
version = "0.0.0",
4+
)
5+
6+
bazel_dep(name = "platforms", version = "1.1.0")
7+
bazel_dep(name = "rules_python", version = "1.7.0")
8+
9+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
10+
python.toolchain(
11+
is_default = True,
12+
python_version = "3.11",
13+
)
14+
use_repo(python, "python_3_11")
15+
16+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
17+
pip.parse(
18+
hub_name = "pypi",
19+
python_version = "3.11",
20+
requirements_lock = "//:requirements-dev.lock",
21+
)
22+
use_repo(pip, "pypi")

0 commit comments

Comments
 (0)