Skip to content

Commit 16f1577

Browse files
[CI] Fix Minor Issues in dispatch_job.py
There were a couple issues with dispatch_job.py that needed fixing: 1. BUILDBOT_REVISION/Platform were swapped. 2. k8s does not recognize commands in pod definitions, only command. 3. We need to use the function to load the in cluster config rather than load what kubectl would use. 4. Move the build step start message into the pod.
1 parent e2023f7 commit 16f1577

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

premerge/buildbot_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
- name: buildbot
1919
image: ghcr.io/llvm/premerge-buildbot:latest
2020
env:
21-
- name: BUILDBOT_NAME
21+
- name: BUILDBOT_USERNAME
2222
value: ${ buildbot_name }
2323
- name: BUILDBOT_PASSWORD
2424
valueFrom:

zorg/buildbot/builders/annotated/premerge/dispatch_job.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def start_build(k8s_client, pod_name: str, namespace: str, commands: list[str])
4646
{
4747
"name": "build",
4848
"image": "ghcr.io/llvm/ci-ubuntu-24.04",
49-
"commands": commands,
49+
"command": commands,
5050
}
5151
],
5252
"restartPolicy": "Never",
@@ -59,6 +59,7 @@ def start_build_linux(commit_sha: str, k8s_client) -> str:
5959
"""Starts a pod to build/test on Linux at the specified SHA."""
6060
pod_name = f"build-{commit_sha}"
6161
commands = [
62+
'echo "@@@BUILD_STEP Cloning Repository@@@"'
6263
"git clone --depth 100 https://github.com/llvm/llvm-project",
6364
"cd llvm-project",
6465
f"git checkout ${commit_sha}",
@@ -181,7 +182,7 @@ def print_logs(
181182

182183

183184
def main(commit_sha: str, platform: str):
184-
kubernetes.config.load_kube_config()
185+
kubernetes.config.load_incluster_config()
185186
k8s_client = kubernetes.client.ApiClient()
186187
if platform == "Linux":
187188
pod_name = start_build_linux(commit_sha, k8s_client)
@@ -192,7 +193,6 @@ def main(commit_sha: str, platform: str):
192193
namespace = PLATFORM_TO_NAMESPACE[platform]
193194
latest_time = datetime.datetime.min
194195
v1_api = kubernetes.client.CoreV1Api()
195-
print("@@@BUILD_STEP Build/Test@@@")
196196
while True:
197197
try:
198198
pod_finished, latest_time = print_logs(
@@ -219,4 +219,4 @@ def main(commit_sha: str, platform: str):
219219
if "BUILDBOT_REVISION" not in os.environ:
220220
logging.fatal("Expected to have BUILDBOT_REVISION environment variable set.")
221221
sys.exit(1)
222-
main(sys.argv[1], os.environ["BUILDBOT_REVISION"])
222+
main(os.environ["BUILDBOT_REVISION"], sys.argv[1])

0 commit comments

Comments
 (0)