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

pd: support pd real cluster #2655

Merged
merged 8 commits into from
Dec 8, 2023
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: 12Gi
cpu: "4"
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
66 changes: 66 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,66 @@
// 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 GIT_FULL_REPO_NAME = 'tikv/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
"""
}
}
}
}
}