Skip to content

Commit

Permalink
feat(apps/prod/tekton/configs): add cache for crypress installtion
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhuizuo committed Sep 9, 2024
1 parent 3be1409 commit 62636a7
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 14 deletions.
9 changes: 7 additions & 2 deletions apps/prod/tekton/configs/pipelines/pingcap-build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
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: >
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
Expand All @@ -61,7 +61,10 @@ spec:
description: secret containing a .gitconfig and .git-credentials file.
optional: true
- name: cargo-home
description: cache for cargo pacakges when build binaries
description: cache for cargo packages when build binaries
optional: true
- name: cypress-cache
description: cache for cypress installation files when building frontend projects.
optional: true
tasks:
- name: checkout
Expand Down Expand Up @@ -161,6 +164,8 @@ spec:
workspace: dockerconfig
- name: cargo-home
workspace: cargo-home
- name: cypress-cache
workspace: cypress-cache
- name: build-images
when:
- input: "$(params.push)"
Expand Down
12 changes: 6 additions & 6 deletions apps/prod/tekton/configs/pipelines/pingcap-release-ga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ spec:
runAfter:
- "compose-offline-pkgs-amd64-community"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
params:
- { name: version, value: "$(params.version)" }
- { name: edition, value: community }
Expand All @@ -141,7 +141,7 @@ spec:
runAfter:
- "compose-offline-pkgs-amd64-enterprise"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
params:
- { name: version, value: "$(params.version)" }
- { name: edition, value: enterprise }
Expand All @@ -162,7 +162,7 @@ spec:
runAfter:
- "compose-offline-pkgs-amd64-dm"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
workspaces:
- { name: aws-secrets, workspace: aws-secrets }
params:
Expand All @@ -185,7 +185,7 @@ spec:
runAfter:
- "compose-offline-pkgs-arm64-community"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
params:
- { name: version, value: "$(params.version)" }
- { name: edition, value: community }
Expand All @@ -206,7 +206,7 @@ spec:
runAfter:
- "compose-offline-pkgs-arm64-enterprise"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
params:
- { name: version, value: "$(params.version)" }
- { name: edition, value: enterprise }
Expand All @@ -227,7 +227,7 @@ spec:
runAfter:
- "compose-offline-pkgs-arm64-dm"
taskRef:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
workspaces:
- { name: aws-secrets, workspace: aws-secrets }
params:
Expand Down
11 changes: 11 additions & 0 deletions apps/prod/tekton/configs/pvcs/cypress-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cypress-cache
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: ceph-block
1 change: 1 addition & 0 deletions apps/prod/tekton/configs/pvcs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cargo-home.yaml
- cypress-cache.yaml
- tiup-locks.yaml
2 changes: 1 addition & 1 deletion apps/prod/tekton/configs/tasks/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resources:
- pingcap-get-set-release-version.yaml
- pingcap-git-clone-ext.yaml
- pingcap-upload-enterprise-plugins.yaml
- pingcap-upload-offline-packages.yaml
- pingcap-upload-offline-package.yaml
- publish-tiup-from-oci-artifact.yaml
- release/create-pr-to-add-release-anchor-commit.yaml
- release/create-pr-to-bump-tikv-version.yaml
Expand Down
6 changes: 6 additions & 0 deletions apps/prod/tekton/configs/tasks/pingcap-build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
description: Cache for cargo packages.
mountPath: /workspace/.cargo
optional: true
- name: cypress-cache
description: Cache for cypress installation files.
mountPath: /workspace/.cache/Cypress
optional: true
- name: dockerconfig
description: Includes a docker `config.json`
mountPath: /root/.docker
Expand Down Expand Up @@ -97,6 +101,8 @@ spec:
value: /workspace/.cargo
- name: NPM_CONFIG_REGISTRY
value: https://registry.npmmirror.com
- name: CYPRESS_CACHE_FOLDER
value: /workspace/.cache/Cypress
script: |
script="/workspace/build-package-artifacts.sh"
if [ ! -f "$script" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: pingcap-upload-offline-pacakges
name: pingcap-upload-offline-package
labels:
app.kubernetes.io/version: "0.2"
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
set -exo pipefail
if [ ! -f /workspace/publish.sh ]; then
echo "No tiup pacakges are need to published."
echo "No tiup packages are need to published."
exit 0
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down Expand Up @@ -173,6 +176,9 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ spec:
secretName: git-credentials-basic
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down Expand Up @@ -175,3 +178,6 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
'pingcap/tiflow/package',
'pingcap/tidb-binlog/package',
'pingcap/tidb-ctl/package',
'tikv/pd/pacakge',
'tikv/pd/package',
'tikv/tikv/package'
] &&
body.event_data.resources[0].tag.matches('^(master|main)(-[0-9a-f]{7,10})_(darwin|linux)_(amd64|arm64)$')
Expand Down Expand Up @@ -66,7 +66,7 @@ spec:
'pingcap/tiflow/package',
'pingcap/tidb-binlog/package',
'pingcap/tidb-ctl/package',
'tikv/pd/pacakge',
'tikv/pd/package',
'tikv/tikv/package'
] &&
body.event_data.resources[0].tag.matches('^release-[0-9]+[.][0-9]+(-[0-9a-f]{7,10})_(darwin|linux)_(amd64|arm64)$')
Expand Down

0 comments on commit 62636a7

Please sign in to comment.