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: support env and product dockerfile #2615

Merged
merged 2 commits into from
Nov 15, 2023
Merged

feat: support env and product dockerfile #2615

merged 2 commits into from
Nov 15, 2023

Conversation

jayl1e
Copy link
Contributor

@jayl1e jayl1e commented Nov 15, 2023

Why:

  • fips need special env var and image

How:

  • add option to support build with env var
  • support customized product image
  • support pass builder image

Signed-off-by: lijie <lijie@pingcap.com>
Copy link

ti-chi-bot bot commented Nov 15, 2023

I have already done a preliminary review for you, and I hope to help you do a better job.

Review for Pull Request feat: support env and product dockerfile

Summary

This pull request adds support for building Docker images with customized environment variables and product Dockerfiles.

Potential Problems

There are no major issues with this pull request. However, there are some minor issues that can be fixed:

  • The name of the BuildEnv parameter in jenkins/jobs/cd/devbuild.groovy is not consistent with the defaultValue and should be changed to BUILD_ENV.
  • In jenkins/pipelines/cd/dev-build.groovy, the parameters section is commented out and should be removed.
  • In jenkins/pipelines/cd/dev-build.groovy, there is a typo in the ProductDockerfile parameter name in the if (params.ProductDockerfile){} statement. It should be params.ProductDockerfile.

Fix Suggestions

  • The name of the BuildEnv parameter in jenkins/jobs/cd/devbuild.groovy should be changed to BUILD_ENV to be consistent with the defaultValue.
  • Remove the commented out parameters section in jenkins/pipelines/cd/dev-build.groovy.
  • Change the parameter name to params.ProductDockerfile in the if (params.ProductDockerfile){} statement in jenkins/pipelines/cd/dev-build.groovy.

@ti-chi-bot ti-chi-bot bot added the size/L label Nov 15, 2023
Signed-off-by: lijie <lijie@pingcap.com>
Copy link

ti-chi-bot bot commented Nov 15, 2023

I have already done a preliminary review for you, and I hope to help you do a better job.
Pull Request Review

The changes in the pull request aim to add support for customized product images and environment variables during the build process. The changes made include adding new parameters for dockerfile, builder image, and environment variables. Also, a function named 'do_release' is added to support the execution of a command with environment variables.

The changes seem to be reasonable and well-documented. However, there are some potential problems that need to be addressed:

  1. The new parameters added may cause confusion among the users, especially since many of them have similar names to the existing ones. It would be better to use more descriptive names to avoid any ambiguity.
  2. The addition of environment variables is not thoroughly tested, and there is no indication of how they will be used in the build process. Further documentation and testing are needed to ensure that they work as intended.
  3. The use of hardcoded values for CPU and memory requests in the 'run_with_pod' function is not ideal, and it would be better to make these values configurable.

Suggestions for fixing these problems:

  1. Use more descriptive names for the new parameters, such as 'CustomDockerfile', 'BuilderImage', and 'BuildEnvironment'.
  2. Provide more documentation and testing for the use of environment variables during the build process.
  3. Make the CPU and memory requests configurable by adding new parameters for them.

Overall, the changes made in the pull request are valuable, but some improvements are needed to ensure that they are easy to use and work as intended.

@wuhuizuo
Copy link
Collaborator

/lgtm
/approve

Copy link

ti-chi-bot bot commented Nov 15, 2023

[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

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

Copy link

ti-chi-bot bot commented Nov 15, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-15 11:23:43.279344922 +0000 UTC m=+4248220.866455064: ☑️ agreed by wuhuizuo.

@ti-chi-bot ti-chi-bot bot added the approved label Nov 15, 2023
@ti-chi-bot ti-chi-bot bot merged commit d7fb5ab into main Nov 15, 2023
2 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feat/fips branch November 15, 2023 11:24
ti-chi-bot bot pushed a commit that referenced this pull request Nov 23, 2023
Add new param for build-common, relate to
#2615.

Signed-off-by: purelind <purelind@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants