Skip to content

Commit

Permalink
pd: support pd real cluster (#2655)
Browse files Browse the repository at this point in the history
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
3 people authored Dec 8, 2023
1 parent 19bf99a commit 7163ba4
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
39 changes: 39 additions & 0 deletions jobs/tikv/pd/latest/pull_integration_realcluster_test.groovy
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)
}
}
}
}
}
}
}
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 pipelines/tikv/pd/latest/pull_integration_realcluster_test.groovy
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
"""
}
}
}
}
}

0 comments on commit 7163ba4

Please sign in to comment.