Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apps/prod/tekton/configs): support tibuild trigger with custom builder image #1170

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/prod/tekton/configs/pipelines/pingcap-build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ spec:
- name: registry
description: the base OCI registry server for store artifacts, it can be set with prefix repo path.
default: "hub.pingcap.net"
- name: force-builder-image
description: >
The builder image to use for building binaries by force, if empty.
Default the task will complete one from config in artifacts.git repo.
type: string
default: ""
results:
- name: pushed-binaries
description: pushed binaries.
Expand Down Expand Up @@ -118,6 +124,8 @@ spec:
value: "$(params.profile)"
- name: version
value: "$(tasks.get-release-ver.results.version)"
- name: force-builder-image
value: "$(params.force-builder-image)"
- name: build-binaries
runAfter:
- checkout-ext
Expand Down
14 changes: 13 additions & 1 deletion apps/prod/tekton/configs/tasks/pingcap-get-builder-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Task
metadata:
name: pingcap-get-builder-image
labels:
app.kubernetes.io/version: "0.1"
app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/platforms: "linux/amd64,linux/arm64"
spec:
Expand All @@ -28,10 +28,22 @@ spec:
default: release
description: >
supports: 'release' or 'failpoint' or others.
- name: force-builder-image
type: string
description: >
force to use a specific builder image, it will be used as the base
image for building binaries.
default: ""
steps:
- name: get
image: ghcr.io/pingcap-qe/cd/utils/release:v20231216-37-g8e0ca7e
script: |
if [ -n "$(params.force-builder-image)" ]; then
echo "use force builder image: $(params.force-builder-image)"
printf "%s" "$(params.force-builder-image)" > $(results.image-url.path)
exit 0
fi

git clone --depth=1 --branch=main https://github.com/PingCAP-QE/artifacts.git /workspace/artifacts

out="/workspace/builder-package-artifacts.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ spec:
'tikv/pd': '32Gi',
'tikv/tikv': '64Gi',
}[body.repository.full_name]
- key: custom-params
expression: >-
{
'builder-image': header.canonical('ce-param-builder-image')
}
bindings:
- ref: github-branch-push
- ref: ce-context
Expand All @@ -61,5 +66,6 @@ spec:
- { name: builder-resources-cpu, value: $(extensions.builder-resources-cpu) }
- { name: builder-resources-memory, value: $(extensions.builder-resources-memory) }
- { name: registry, value: hub.pingcap.net/devbuild }
- { name: force-builder-image, value: $(extensions.custom-params.force-builder-image) }
template:
ref: build-component
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ spec:
'tikv/pd': '32Gi',
'tikv/tikv': '64Gi',
}[body.repository.full_name]
- key: custom-params
expression: >-
{
'builder-image': header.canonical('ce-param-builder-image'),
}
bindings:
- ref: github-pr
- ref: ce-context
Expand All @@ -61,5 +66,6 @@ spec:
- { name: builder-resources-cpu, value: $(extensions.builder-resources-cpu) }
- { name: builder-resources-memory, value: $(extensions.builder-resources-memory) }
- { name: registry, value: hub.pingcap.net/devbuild }
- { name: force-builder-image, value: $(extensions.custom-params.force-builder-image) }
template:
ref: build-component
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ spec:
'tikv/pd': '32Gi',
'tikv/tikv': '64Gi',
}[body.repository.full_name]
- key: custom-params
expression: >-
{
'builder-image': header.canonical('ce-param-builder-image'),
}
bindings:
- ref: github-tag-create
- ref: ce-context
Expand All @@ -63,5 +68,6 @@ spec:
- { name: builder-resources-cpu, value: $(extensions.builder-resources-cpu) }
- { name: builder-resources-memory, value: $(extensions.builder-resources-memory) }
- { name: registry, value: hub.pingcap.net/devbuild }
- { name: force-builder-image, value: $(extensions.custom-params.force-builder-image) }
template:
ref: build-component