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

feat(dubboctl): add support for using CN mirror of buildpacks toolchain #317

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

yin1999
Copy link
Contributor

@yin1999 yin1999 commented Aug 18, 2024

What is the purpose of the change

Part of #48 (may fix it). Considering that creating custom builders will increase maintenance costs, providing a mirror for the general builder (from Paketo Buildpacks) for users in mainland China is a lower-cost approach.

Brief changelog

  • feat(dubboctl): add support for using CN mirror of buildpacks toolchain
  • chore(dubboctl): add a comment about using CN mirror in the generated dubbo.yaml

Verifying this change

Using the following command to compile and build the dubboctl

go build -ldflags='-s -w -buildid=' -trimpath -o bin/dubboctl ./app/dubboctl/

And than using the dubboctl command to build a image (create any project of Golang, or Java) with the dubbo.yaml config:

# dubbo.yaml
runtime: java # or 'go' for golang project
image: test-server:latest
created: 2020-03-18T07:32:39.8834Z
build:
  buildEnvs:
  - name: BP_DEPENDENCY_MIRROR_GITHUB_COM # for java runtime
    value: mirror.example.com # may provide after we create the github release mirror
  - name: GOPROXY # for Golang runtime
    value: https://goproxy.cn,direct
  # Using the CN mirror for builders and lifecycle images
  cnMirror: true
/path/to/dubboctl build generate --image test-http-server:latest --push=false --force

CheckList

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

Comment on lines +80 to +83
latestImageTagMapping = map[string]string{
"paketobuildpacks/builder-jammy-tiny": "0.0.271",
"paketobuildpacks/run-jammy-tiny": "0.2.46",
"buildpacksio/lifecycle": "0.17.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://docker.aityp.com/ does not support latest tag, using tag mapping to resolve it.

}
}
f.Build.BuildEnvs = envs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The buildEnvs configured in dubbo.yaml would be shadowed.

@yin1999 yin1999 marked this pull request as ready for review August 19, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant