feat: remove deprecated CI runtime images and workflows#1014
Conversation
Remove the `dockerfiles/ci/` directory including base, Jenkins, TiKV, TiFlash, and Tici Dockerfiles, along with their associated GitHub Actions workflows for pull and release publishing. Update `packages/delivery.yaml` and `packages/packages.yaml.tmpl` to replace references from `hub.pingcap.net` to `us-docker.pkg.dev/pingcap-testing-account/hub`. Also remove the internal image skip check in `ci.sh` and update default registry in `gen-package-offline-package-with-config.sh`.
There was a problem hiding this comment.
I have already done a preliminary review for you, and I hope to help you do a better job.
Summary
This pull request removes deprecated CI runtime images and associated workflows, updates references from hub.pingcap.net to us-docker.pkg.dev/pingcap-testing-account/hub, and modifies scripts to align with the new registry and deployment structure. The approach involves deleting unused Dockerfiles and workflows, cleaning up scripts, and updating references in configuration files. Overall, the changes are straightforward but impactful for simplifying the CI pipeline and reducing maintenance overhead. The PR is well-structured, but there are minor areas for improvement in script integrity and documentation.
Critical Issues
- File:
.github/scripts/ci.sh, Line 6
Issue: Removing the internal image skip check without validation could cause unintended behavior for images that might not exist in the new registry (us-docker.pkg.dev).
Suggestion: Add a fallback or validation mechanism to handle cases where the image is missing. For example:if ! crane digest $img > /dev/null; then echo "Error: Image $img does not exist in the registry." exit 1 fi
Code Improvements
-
File:
packages/scripts/gen-package-offline-package-with-config.sh, Line 12
Issue: Hardcoding the default registry value (us-docker.pkg.dev/pingcap-testing-account/hub) reduces flexibility for future migrations or testing environments.
Suggestion: Make the registry configurable through an environment variable or command-line argument:local registry="${8:-${DEFAULT_DOCKER_REGISTRY:-us-docker.pkg.dev/pingcap-testing-account/hub}}"
-
File:
packages/scripts/get-delivery-target-images.ts, Line 140
Issue: The registry default value (us-docker.pkg.dev/pingcap-testing-account/hub) is hardcoded, making it less adaptable.
Suggestion: Use a configuration file or environment variable to define the default registry:const registry = Deno.env.get("DOCKER_REGISTRY") || "us-docker.pkg.dev/pingcap-testing-account/hub";
Best Practices
-
Documentation Needs:
The removal of CI workflows (pull-ci-runtime-images.yaml,release-ci-runtime-images.yaml) and Dockerfiles affects the CI/CD pipeline. Add clear documentation outlining:- The rationale for the removal.
- Steps for transitioning to the new registry.
- Instructions for building and testing images in the new environment.
Update the README or a dedicated migration guide.
-
Testing Coverage Gaps:
The PR removes significant portions of CI workflows and Dockerfiles without detailing the testing strategy for the new registry setup. Ensure that:- Existing tests validate image availability in
us-docker.pkg.dev. - Scripts (
ci.sh,gen-package-offline-package-with-config.sh) are tested for edge cases, such as missing images or invalid configurations.
- Existing tests validate image availability in
-
Hardcoded Defaults:
Multiple files (e.g.,delivery.yaml,packages.yaml.tmpl) use hardcoded references to the new registry (us-docker.pkg.dev). These should be replaced with variables or configuration entries to facilitate future updates. For instance:default_registry: "us-docker.pkg.dev/pingcap-testing-account/hub"
-
Style Guideline Deviations:
Inget-delivery-target-images.ts, inconsistent spacing is used for imports. Clean up the formatting to match project-wide conventions:import { parse, parseRange, satisfies, } from "jsr:@std/semver@^1.0.3";
Final Notes
While the PR achieves its goal of simplifying the CI pipeline and removing deprecated assets, the changes introduce potential risks due to hardcoded values and missing fallback mechanisms. Addressing these issues will improve the maintainability and robustness of the updated scripts and configurations.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wuhuizuo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Remove the
dockerfiles/ci/directory including base, Jenkins, TiKV,TiFlash, and Tici Dockerfiles, along with their associated GitHub
Actions workflows for pull and release publishing.
Update
packages/delivery.yamlandpackages/packages.yaml.tmpltoreplace references from
hub.pingcap.nettous-docker.pkg.dev/pingcap-testing-account/hub.Also remove the internal image skip check in
ci.shand updatedefault registry in
gen-package-offline-package-with-config.sh.