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(dockerfiles/cd/utils/release): add aws-cli tool #533

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

wuhuizuo
Copy link
Contributor

No description provided.

@ti-chi-bot ti-chi-bot bot requested a review from purelind January 16, 2025 09:59
Copy link

ti-chi-bot bot commented Jan 16, 2025

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

Based on the title of the pull request and the diff, it seems that the developer has added the aws-cli tool to the Dockerfile located at dockerfiles/cd/utils/release/Dockerfile. The aws-cli tool is used to interact with Amazon Web Services (AWS) services via the command line, and it is commonly used in CI/CD pipelines.

One potential problem that I see in the diff is that there is a redundant RUN command in the aws-cli installation step. The RUN command is used to execute a command during the Docker image build process, but it should only be used once per step. In this case, the RUN command is used twice in the aws-cli installation step, which could cause the build process to fail or produce unexpected results.

To fix this issue, the developer should remove the first RUN command in the aws-cli installation step.

Here is the updated diff:

diff --git a/dockerfiles/cd/utils/release/Dockerfile b/dockerfiles/cd/utils/release/Dockerfile
index 3cfa969d..7b8cf57f 100644
--- a/dockerfiles/cd/utils/release/Dockerfile
+++ b/dockerfiles/cd/utils/release/Dockerfile
@@ -34,3 +34,11 @@ RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \
     wget -q -O - https://tiup-mirrors.pingcap.com/tiup-v${TIUP_VER}-${OS}-${ARCH}.tar.gz | tar -zxvf - -C /usr/local/bin && \
     chmod 755 /usr/local/bin/tiup && \
     mkdir -p "$HOME/.tiup/bin"
+
+# install tools: aws-cli
+ARG AWS_CLI_VERSION=2.23.0
+RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo aarch64); \
+    curl "https://awscli.amazonaws.com/awscli-exe-${OS}-{ARCH}-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" && \
+    unzip awscliv2.zip && \
+    ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \
+    rm -rf awscliv2.zip aws

Overall, the proposed changes seem reasonable and the addition of the aws-cli tool is a useful addition to the Dockerfile.

@ti-chi-bot ti-chi-bot bot added the size/XS label Jan 16, 2025
@wuhuizuo wuhuizuo force-pushed the feature/add-aws-cli-to-release-util-image branch from 57cec55 to 478f187 Compare January 16, 2025 12:07
Copy link

ti-chi-bot bot commented Jan 16, 2025

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

Based on the pull request title and diff, the key change made is the addition of the aws-cli tool to the Dockerfile located at dockerfiles/cd/utils/release/Dockerfile. This was achieved by adding a few lines of code under the comment # install tools: aws-cli.

One potential problem with this change is that it may increase the size of the container image, which may lead to longer build and deployment times. Additionally, the use of --no-deps option during the installation of the awscli-plugin-endpoint package may lead to missing dependencies if they are required in the future.

To fix this, I suggest using the --no-cache option during the installation of the aws-cli tool to reduce the size of the container image. Also, it is recommended to install the awscli-plugin-endpoint package with its dependencies to avoid any missing dependencies in the future. Finally, the use of the head -1 command in the aws configure set plugins.cli_legacy_plugin_path command may fail if there are multiple directories returned. It is recommended to use a more specific command to retrieve the correct path.

@wuhuizuo wuhuizuo force-pushed the feature/add-aws-cli-to-release-util-image branch from 478f187 to 400ce32 Compare January 16, 2025 12:13
Copy link

ti-chi-bot bot commented Jan 16, 2025

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

Based on the PR title and diff, it looks like the change is adding the aws-cli tool to the Dockerfile located in dockerfiles/cd/utils/release. This tool is being installed via apk package manager and pip3. The awscli-plugin-endpoint package is also being installed along with setting some AWS configuration values.

One potential problem I can see is that the aws-cli installation may take up additional space on the container, which could impact the overall size and performance of the container. Another issue could be the potential for conflicts with other installed packages or dependencies.

To address these issues, it may be helpful to consider using a smaller base image for the container and removing any unnecessary packages or dependencies. Additionally, it may be helpful to test the container with the added aws-cli tool to ensure it is still functioning as expected.

@wuhuizuo
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Jan 16, 2025

[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

@ti-chi-bot ti-chi-bot bot added the approved label Jan 16, 2025
@ti-chi-bot ti-chi-bot bot merged commit f13e219 into main Jan 16, 2025
4 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feature/add-aws-cli-to-release-util-image branch January 16, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant