-
Notifications
You must be signed in to change notification settings - Fork 104
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
tikv-migration: support Kafka integration tests #2727
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
jobs/tikv/migration/latest/pull_integration_kafka_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/migration/pull_integration_kafka_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") | ||
} | ||
properties { | ||
// priority(0) // 0 fast than 1 | ||
githubProjectUrl("https://github.com/tikv/migration") | ||
} | ||
|
||
definition { | ||
cpsScm { | ||
lightweight(true) | ||
scriptPath("pipelines/tikv/migration/latest/pull_integration_kafka_test.groovy") | ||
scm { | ||
git{ | ||
remote { | ||
url('https://github.com/PingCAP-QE/ci.git') | ||
} | ||
branch('main') | ||
extensions { | ||
cloneOptions { | ||
depth(1) | ||
shallow(true) | ||
timeout(5) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
pipelines/tikv/migration/latest/pod-pull_integration_kafka_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,84 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
spec: | ||
securityContext: | ||
fsGroup: 1000 | ||
containers: | ||
- name: zookeeper | ||
image: wurstmeister/zookeeper | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 4Gi | ||
limits: | ||
cpu: 2000m | ||
memory: 4Gi | ||
tty: true | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: volume-0 | ||
- name: kafka | ||
image: wurstmeister/kafka:2.12-2.4.1 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: KAFKA_CREATE_TOPICS | ||
value: big-message-test:1:1 | ||
- name: KAFKA_BROKER_ID | ||
value: "1" | ||
- name: KAFKA_ZOOKEEPER_CONNECT | ||
value: localhost:2181 | ||
- name: KAFKA_MESSAGE_MAX_BYTES | ||
value: "11534336" | ||
- name: KAFKA_REPLICA_FETCH_MAX_BYTES | ||
value: "11534336" | ||
- name: KAFKA_ADVERTISED_LISTENERS | ||
value: PLAINTEXT://127.0.0.1:9092 | ||
- name: KAFKA_LISTENERS | ||
value: PLAINTEXT://127.0.0.1:9092 | ||
- name: ZK | ||
value: zk | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 4Gi | ||
limits: | ||
cpu: 2000m | ||
memory: 4Gi | ||
tty: true | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: volume-0 | ||
- name: golang | ||
image: "hub.pingcap.net/jenkins/centos7_golang-1.21:latest" | ||
tty: true | ||
resources: | ||
requests: | ||
memory: 8Gi | ||
cpu: "4" | ||
limits: | ||
memory: 8Gi | ||
cpu: "4" | ||
- name: net-tool | ||
image: hub.pingcap.net/jenkins/network-multitool | ||
tty: true | ||
resources: | ||
limits: | ||
memory: 128Mi | ||
cpu: 100m | ||
- name: report | ||
image: hub.pingcap.net/jenkins/python3-requests:latest | ||
tty: true | ||
resources: | ||
limits: | ||
memory: 256Mi | ||
cpu: 100m | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: | ||
- amd64 |
111 changes: 111 additions & 0 deletions
111
pipelines/tikv/migration/latest/pull_integration_kafka_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,111 @@ | ||
// REF: https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline | ||
// Keep small than 400 lines: https://issues.jenkins.io/browse/JENKINS-37984 | ||
// should triggerd for master and latest release branches | ||
@Library('tipipeline') _ | ||
|
||
final K8S_NAMESPACE = "jenkins-tidb" | ||
final GIT_FULL_REPO_NAME = 'tikv/migration' | ||
final GIT_CREDENTIALS_ID = 'github-sre-bot-ssh' | ||
final POD_TEMPLATE_FILE = 'pipelines/tikv/migration/latest/pod-pull_integration_kafka_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() | ||
skipDefaultCheckout() | ||
} | ||
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: 5, unit: 'MINUTES') } | ||
steps { | ||
dir("migration") { | ||
cache(path: "./", includes: '**/*', key: prow.getCacheKey('git', REFS), restoreKeys: prow.getRestoreKeys('git', REFS)) { | ||
retry(2) { | ||
script { | ||
prow.checkoutRefs(REFS) | ||
} | ||
} | ||
sh """ | ||
git rev-parse --show-toplevel | ||
git status | ||
git status -s . | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
stage('Prepare') { | ||
steps { | ||
dir('migration') { | ||
cache(path: "./cdc", includes: '**/*', key: "ws/${BUILD_TAG}/tikvcdc") { | ||
container("golang") { | ||
sh label: 'integration test prepare', script: """#!/usr/bin/env bash | ||
cd cdc/ | ||
make prepare_test_binaries | ||
make check_third_party_binary | ||
make integration_test_build | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Tests') { | ||
matrix { | ||
axes { | ||
axis { | ||
name 'TEST_GROUP' | ||
values 'G00', 'G01', 'G02', 'G03', 'G04', 'G05', 'G06', 'G07', 'G08', 'G09', 'G10', 'G11', 'G12', 'others' | ||
} | ||
} | ||
agent { | ||
kubernetes { | ||
namespace K8S_NAMESPACE | ||
yamlFile POD_TEMPLATE_FILE | ||
defaultContainer 'golang' | ||
} | ||
} | ||
stages { | ||
stage("Test") { | ||
options { timeout(time: 25, unit: 'MINUTES') } | ||
steps { | ||
dir('migration') { | ||
cache(path: "./cdc", includes: '**/*', key: "ws/${BUILD_TAG}/tikvcdc") { | ||
sh label: "TEST_GROUP ${TEST_GROUP}",script: """#!/usr/bin/env bash | ||
cd cdc/ | ||
./tests/integration_tests/run_group.sh kafka ${TEST_GROUP} | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure that the dependency binary is downloaded correctly for branch
^cdc-release-.*$
and^br-release-.*$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
prepare_test_binaries
will download TiDB release 6.5 and all CDC & BR releases are designed to be compatible with this release.