-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rely on tikv/pd#7493 --------- Signed-off-by: husharp <[email protected]> Co-authored-by: wuhuizuo <[email protected]> Co-authored-by: Purelind <[email protected]>
- Loading branch information
1 parent
19bf99a
commit 7163ba4
Showing
3 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
jobs/tikv/pd/latest/pull_integration_realcluster_test.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// REF: https://<your-jenkins-server>/plugin/job-dsl/api-viewer/index.html | ||
// For trunk and latest release branches. | ||
pipelineJob('tikv/pd/pull_integration_realcluster_test') { | ||
logRotator { | ||
daysToKeep(30) | ||
} | ||
parameters { | ||
// Ref: https://docs.prow.k8s.io/docs/jobs/#job-environment-variables | ||
stringParam("BUILD_ID") | ||
stringParam("PROW_JOB_ID") | ||
stringParam("JOB_SPEC", "", "Prow job spec struct data") | ||
} | ||
properties { | ||
buildFailureAnalyzer(false) | ||
githubProjectUrl("https://github.com/tikv/pd") | ||
} | ||
|
||
definition { | ||
cpsScm { | ||
lightweight(true) | ||
scriptPath("pipelines/tikv/pd/latest/pull_integration_realcluster_test.groovy") | ||
scm { | ||
git{ | ||
remote { | ||
url('https://github.com/PingCAP-QE/ci.git') | ||
} | ||
branch('main') | ||
extensions { | ||
cloneOptions { | ||
depth(1) | ||
shallow(true) | ||
timeout(5) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
pipelines/tikv/pd/latest/pod-pull_integration_realcluster_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
spec: | ||
securityContext: | ||
fsGroup: 1000 | ||
containers: | ||
- name: golang | ||
image: "hub.pingcap.net/jenkins/centos7_golang-1.21:latest" | ||
tty: true | ||
resources: | ||
requests: | ||
memory: 16Gi | ||
cpu: "6" | ||
limits: | ||
memory: 16Gi | ||
cpu: "6" | ||
- name: net-tool | ||
image: wbitt/network-multitool | ||
tty: true | ||
resources: | ||
limits: | ||
memory: 128Mi | ||
cpu: 100m | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: | ||
- amd64 |
65 changes: 65 additions & 0 deletions
65
pipelines/tikv/pd/latest/pull_integration_realcluster_test.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// REF: https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline | ||
// Keep small than 400 lines: https://issues.jenkins.io/browse/JENKINS-37984 | ||
@Library('tipipeline') _ | ||
|
||
final K8S_NAMESPACE = "jenkins-pd" | ||
final POD_TEMPLATE_FILE = 'pipelines/tikv/pd/latest/pod-pull_integration_realcluster_test.yaml' | ||
final REFS = readJSON(text: params.JOB_SPEC).refs | ||
|
||
pipeline { | ||
agent { | ||
kubernetes { | ||
namespace K8S_NAMESPACE | ||
yamlFile POD_TEMPLATE_FILE | ||
defaultContainer 'golang' | ||
} | ||
} | ||
environment { | ||
FILE_SERVER_URL = 'http://fileserver.pingcap.net' | ||
} | ||
options { | ||
timeout(time: 40, unit: 'MINUTES') | ||
parallelsAlwaysFailFast() | ||
} | ||
stages { | ||
stage('Debug info') { | ||
steps { | ||
sh label: 'Debug info', script: """ | ||
printenv | ||
echo "-------------------------" | ||
go env | ||
echo "-------------------------" | ||
echo "debug command: kubectl -n ${K8S_NAMESPACE} exec -ti ${NODE_NAME} bash" | ||
""" | ||
container(name: 'net-tool') { | ||
sh 'dig github.com' | ||
} | ||
} | ||
} | ||
stage('Checkout') { | ||
options { timeout(time: 10, unit: 'MINUTES') } | ||
steps { | ||
dir("pd") { | ||
cache(path: "./", includes: '**/*', key: prow.getCacheKey('git', REFS), restoreKeys: prow.getRestoreKeys('git', REFS)) { | ||
retry(2) { | ||
script { | ||
prow.checkoutRefs(REFS) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Tests') { | ||
options { timeout(time: 20, unit: 'MINUTES') } | ||
steps { | ||
dir('pd') { | ||
sh label: "PD Real Cluster Check", script: """ | ||
cd tests/integrations/realtiup | ||
make check | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
} |