Skip to content

Commit 46bbdf6

Browse files
committed
chore(tekton): add conditional service account suffix for odh-base-image components and new build-platform entries for specific components
1 parent 5bd3b9f commit 46bbdf6

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

scripts/generate_pull_request_pipelineruns.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def pull_request_pipelinerun_template(
5656
# Tekton uses Go's `regexp`
5757
on_comment_pattern = re.compile(rf"^/kfbuild\s+(all|{re.escape(component)}|{re.escape(str(dockerfile.parent))})")
5858

59+
maybe_poc = "-poc" if component.startswith("odh-base-image") else ""
60+
5961
return {
6062
"apiVersion": "tekton.dev/v1",
6163
"kind": "PipelineRun",
@@ -87,7 +89,7 @@ def pull_request_pipelinerun_template(
8789
"name": "multiarch-pull-request-pipeline",
8890
},
8991
"taskRunTemplate": {
90-
"serviceAccountName": f"build-pipeline-{component}",
92+
"serviceAccountName": f"build-pipeline-{component}{maybe_poc}",
9193
},
9294
"workspaces": [
9395
{
@@ -131,7 +133,14 @@ def transform_build_pipeline_to_pr_pipeline(push_pipeline_path: pathlib.Path):
131133

132134
component = push_pipeline["metadata"]["labels"]["appstudio.openshift.io/component"]
133135

134-
build_platforms = ["linux/x86_64"]
136+
# https://github.com/redhat-appstudio/infra-deployments/blob/main/components/multi-platform-controller/production-downstream/stone-prod-p02/host-config.yaml
137+
138+
if component in [
139+
"odh-workbench-codeserver-datascience-cpu-py312-ubi9",
140+
]:
141+
build_platforms = ["linux-extra-fast/amd64"]
142+
else:
143+
build_platforms = ["linux/x86_64"]
135144

136145
if component in [
137146
"odh-base-image-cuda-py311-c9s",
@@ -141,12 +150,20 @@ def transform_build_pipeline_to_pr_pipeline(push_pipeline_path: pathlib.Path):
141150
]:
142151
build_platforms.extend(["linux/arm64"])
143152

153+
if component in [
154+
"odh-workbench-codeserver-datascience-cpu-py312-ubi9",
155+
"odh-workbench-jupyter-tensorflow-cuda-py312-ubi9",
156+
"odh-workbench-jupyter-trustyai-cpu-py312-ubi9",
157+
]:
158+
build_platforms.extend(["linux-m2xlarge/arm64"])
159+
144160
if component in [
145161
"odh-workbench-codeserver-datascience-cpu-py312-ubi9",
146162
"odh-workbench-jupyter-datascience-cpu-py312-ubi9",
147163
"odh-workbench-jupyter-minimal-cpu-py312-ubi9",
148164
"odh-pipeline-runtime-minimal-cpu-py312-ubi9",
149165
"odh-pipeline-runtime-datascience-cpu-py312-ubi9",
166+
"odh-workbench-jupyter-trustyai-cpu-py312-ubi9",
150167
]:
151168
build_platforms.extend(["linux/ppc64le"])
152169

0 commit comments

Comments
 (0)