Skip to content

refactor: use download_pingcap_oci_artifact.sh instead of download_pingcap_artifact.sh#4136

Open
wuhuizuo wants to merge 3 commits intomainfrom
refactor/download-pingcap-oci-artifact
Open

refactor: use download_pingcap_oci_artifact.sh instead of download_pingcap_artifact.sh#4136
wuhuizuo wants to merge 3 commits intomainfrom
refactor/download-pingcap-oci-artifact

Conversation

@wuhuizuo
Copy link
Contributor

@wuhuizuo wuhuizuo commented Feb 1, 2026

Changes

This PR refactors all Jenkins pipeline jobs that use to use the new script.

Key Changes

  1. Pod Templates (53 files): Added container to all integration test pod templates

    • Image:
  2. Pipeline Groovy Files (42 files):

    • Replace with
    • Execute download script in with
    • Add environment variable
    • Remove environment variable (no longer needed)
    • Remove step (script permissions are set in git)
    • Update version check commands to use relative paths ( instead of )

Affected Branches

  • : release-6.5, 8.2, 8.3, 8.4, 9.0-beta
  • : latest, release-7.1
  • : release-6.0, 6.2

Commits

  • : Add utils container to all integration test pod templates
  • : refactor: use download_pingcap_oci_artifact.sh in pipeline groovy files

This adds the utils container (ghcr.io/pingcap-qe/cd/utils/release:v2025.10.12-7-gfdd779c)
to all pod templates used by integration tests that will use the new
download_pingcap_oci_artifact.sh script.

Affected branches:
- pingcap/tidb: release-6.5, 8.2, 8.3, 8.4, 9.0-beta
- tikv/pd: latest, release-7.1
- pingcap-qe/tidb-test: release-6.0, 6.2
- Replace download_pingcap_artifact.sh with download_pingcap_oci_artifact.sh
- Use container("utils") to execute the download script in dir("bin")
- Add OCI_ARTIFACT_HOST environment variable
- Remove FILE_SERVER_URL environment variable
- Remove chmod step (script permissions are set in git)
- Update version check commands to use relative paths (./tikv-server -V)

Affected branches:
- pingcap/tidb: release-6.5, 8.2, 8.3, 8.4, 9.0-beta
- tikv/pd: latest, release-7.1
- pingcap-qe/tidb-test: release-6.0, 6.2
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 1, 2026

I Skip it since the diff size(157962 bytes > 80000 bytes) is too large

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 1, 2026

I Skip it since the diff size(157850 bytes > 80000 bytes) is too large

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wuhuizuo for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wuhuizuo for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @wuhuizuo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the Jenkins pipeline configurations by migrating from an older artifact download script to a new OCI-based one. The changes streamline the artifact retrieval process, standardize the environment across various integration tests, and improve the maintainability of the CI/CD pipelines by centralizing utility functions within a dedicated container.

Highlights

  • Pod Templates Refactoring: Added a dedicated 'utils' container to all integration test pod templates (53 files) to standardize utility operations.
  • Pipeline Script Update: Replaced the legacy 'download_pingcap_artifact.sh' script with the new 'download_pingcap_oci_artifact.sh' across 42 pipeline Groovy files.
  • Environment Variable Changes: Introduced the 'OCI_ARTIFACT_HOST' environment variable and removed the 'FILE_SERVER_URL' variable, aligning with the new artifact download mechanism.
  • Script Execution Context: Modified pipeline steps to execute the artifact download script within the newly introduced 'utils' container.
  • Permissions and Path Adjustments: Removed explicit 'chmod +x' steps for scripts (as permissions are now managed by Git) and updated version check commands to use relative paths for binaries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 1, 2026

@wuhuizuo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify-jenkins-pipelines 9fa0a81 link true /test pull-verify-jenkins-pipelines

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors numerous Jenkins pipeline jobs to use a new artifact download script. While the intent is good, the execution has introduced several critical errors across many pipeline files. The most common issues are syntactically incorrect script blocks in Groovy files, incorrect paths to binaries, incomplete logic for moving downloaded artifacts, and incorrect restructuring of pipeline stages which moves steps out of their necessary container environments. These errors appear to be the result of a systematic but flawed automated change and will likely cause many CI jobs to fail. I've highlighted several examples of these patterns in my comments, but a thorough review and correction of all changed files is required.

Comment on lines +71 to 81
dir("bin") { container("utils") { sh label: 'download binary', script: """
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"



./tikv-server -V
./pd-server -V
"""
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is syntactically incorrect. It appears to have a nested Groovy container and sh step within the shell script string, which will cause the pipeline to fail. The entire block needs to be refactored to have a valid structure, with only shell commands inside the sh script's triple quotes.

Comment on lines 73 to 84
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"
rm -rf bin/ && mkdir -p bin/
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
mkdir -p bin

mv pd-server bin/
ls -alh bin/
chmod +x bin/*
./bin/tikv-server -V
./bin/pd-server -V
./tikv-server -V
./pd-server -V
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is syntactically incorrect due to a nested container and sh step within the script string. Additionally, the logic is flawed: it attempts to move pd-server but not tikv-server, and then tries to check the version of tikv-server from a location it hasn't been moved to. This will cause multiple failures.

Comment on lines +85 to 93
sh label: 'download tikv', script: """
${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --tikv=${REFS.base_ref}
mkdir -p bin

mv pd-server bin/
ls -alh bin/
bin/pd-server -V
bin/tikv-server -V
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The logic in this script is incorrect. It attempts to move pd-server, which is not downloaded in this step. It also downloads tikv-server but fails to move it into the bin directory. This will cause the version checks and subsequent test stages to fail.

                        sh label: 'download tikv', script: """
                        ${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --tikv=${REFS.base_ref}
                        mv tikv-server bin/
                        ls -alh bin/
                        bin/pd-server -V
                        bin/tikv-server -V
                        """

Comment on lines +72 to 81
dir("bin") { container("utils") { sh label: 'download binary', script: """
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"



./tikv-server -V
./pd-server -V
"""
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is syntactically incorrect. It appears to have a nested Groovy container and sh step within the shell script string, which will cause the pipeline to fail. The entire block needs to be refactored to have a valid structure, with only shell commands inside the sh script's triple quotes.

Comment on lines 74 to 85
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"
rm -rf bin/ && mkdir -p bin/
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
mkdir -p bin

mv pd-server bin/
ls -alh bin/
chmod +x bin/*
./bin/tikv-server -V
./bin/pd-server -V
./tikv-server -V
./pd-server -V
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is syntactically incorrect due to a nested container and sh step within the script string. Additionally, the logic is flawed: it attempts to move pd-server but not tikv-server, and then tries to check the version of tikv-server from a location it hasn't been moved to. This will cause multiple failures.

Comment on lines 70 to 81
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"



ls -alh bin/
chmod +x bin/*
./bin/tidb-server -V
./bin/tikv-server -V
./bin/pd-server -V
./tikv-server -V
./pd-server -V
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is broken. It has nested Groovy syntax inside a shell script string, which is invalid. It also fails to move the downloaded binaries, so the version checks for tikv-server and pd-server will fail as they won't be in the expected path.

Comment on lines 71 to 79
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
container("utils") {
sh label: 'download binary', script: "${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}"
mkdir -p bin

mv pd-server bin/
ls -alh bin/
chmod +x bin/*
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script block is syntactically incorrect with nested Groovy syntax. It also only moves pd-server and not tikv-server, which will cause failures in later steps that require tikv-server.

Comment on lines 64 to 95
container('nodejs') {
dir('tidb') {
sh label: 'tidb-server', script: '[ -f bin/tidb-server ] || make'
retry(2) {
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
rm -rf bin/bin
ls -alh bin/
chmod +x bin/*
"""
}
}
dir('tidb-test') {
cache(path: "./", includes: '**/*', key: "ws/${BUILD_TAG}/tidb-test") {
sh label: "prepare", script: """
touch ws-${BUILD_TAG}
mkdir -p bin
cp ${WORKSPACE}/tidb/bin/* bin/ && chmod +x bin/*
ls -alh bin/
./bin/tidb-server -V
./bin/tikv-server -V
./bin/pd-server -V
"""
}
dir('tidb') {
dir("bin") {
container('utils') {
retry(2) {
sh label: 'download binary', script: """
${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
ls -alh
chmod +x *
"""
}
}
}
}
dir('tidb-test') {
cache(path: "./", includes: '**/*', key: "ws/${BUILD_TAG}/tidb-test") {
sh label: "prepare", script: """
touch ws-${BUILD_TAG}
mkdir -p bin
cp ${WORKSPACE}/tidb/bin/* bin/ && chmod +x bin/*
ls -alh bin/
./bin/tidb-server -V
./tikv-server -V
./pd-server -V
"""
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The refactoring has moved the dir('tidb-test') block outside of the container('nodejs'). The tests for Node.js are executed in later stages and will likely fail because they are no longer in the correct container environment. The dir('tidb') block for downloading binaries and the dir('tidb-test') block should be within the container('nodejs') scope.

Comment on lines 70 to 78
sh label: 'download binary', script: """
chmod +x ${WORKSPACE}/scripts/artifacts/*.sh
${WORKSPACE}/scripts/artifacts/download_pingcap_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}
mv third_bin/tikv-server bin/
mv third_bin/pd-server bin/
${WORKSPACE}/scripts/artifacts/download_pingcap_oci_artifact.sh --pd=${REFS.base_ref} --tikv=${REFS.base_ref}



rm -rf bin/bin
ls -alh bin/
chmod +x bin/*
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This script downloads binaries but does not move them into the bin directory. As a result, the subsequent commands ls -alh bin/ and chmod +x bin/* will likely fail because the bin directory will be empty or non-existent, and later stages will not find the required binaries.

dir('tidb-test/mysql_test') {
sh """
mkdir -p bin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The mkdir -p bin command has been removed. The subsequent mv command will fail if the bin directory doesn't exist. It's safer to restore this command to ensure the directory is created before moving files into it.

                                    mkdir -p bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant