setup image pipeline#30233
Conversation
Summary of ChangesHello @lesongjia, 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 establishes a new, dedicated image pipeline for SyncMind, enabling the automated building and publishing of Dify Docker images to Alibaba Cloud ACR. The changes introduce the necessary scripts and documentation to streamline the deployment process for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request sets up an image pipeline by adding a script and documentation for building and publishing Docker images to Alibaba Cloud ACR. The changes are well-contained within a new syncmind directory. My review focuses on improving code quality and documentation completeness. I've suggested refactoring the build script to remove code duplication, which will improve maintainability. I also pointed out that the documentation references a workflow file that is not included in this PR, which could cause confusion. Overall, these are good additions, and with the suggested improvements, the new pipeline will be more robust and user-friendly.
|
|
||
| ### GitHub Actions | ||
|
|
||
| Workflow: `.github/workflows/syncmind-push-acr.yml` |
There was a problem hiding this comment.
This documentation references the workflow file .github/workflows/syncmind-push-acr.yml, but the file itself is not included in this pull request. This can be confusing for anyone trying to set up or understand the CI/CD pipeline. To make the documentation complete, please either add the workflow file in this PR or add a note indicating that it will be provided in a future change.
| root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
|
|
||
| api_image="$REGISTRY/$NAMESPACE/dify-api:$TAG" | ||
| web_image="$REGISTRY/$NAMESPACE/dify-web:$TAG" | ||
|
|
||
| cd "$root_dir" | ||
|
|
||
| docker buildx build \ | ||
| --platform "$PLATFORM" \ | ||
| --build-arg "COMMIT_SHA=$(git rev-parse HEAD)" \ | ||
| -t "$api_image" \ | ||
| --push \ | ||
| api | ||
|
|
||
| docker buildx build \ | ||
| --platform "$PLATFORM" \ | ||
| --build-arg "COMMIT_SHA=$(git rev-parse HEAD)" \ | ||
| -t "$web_image" \ | ||
| --push \ | ||
| web |
There was a problem hiding this comment.
The script contains duplicated docker buildx build blocks for the api and web images. To improve maintainability and follow the DRY (Don't Repeat Yourself) principle, this logic can be refactored into a reusable function. This will also make it easier to update the build process in the future. Additionally, git rev-parse HEAD is called twice; it can be called once at the start of the script and stored in a variable.
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
COMMIT_SHA="$(git rev-parse HEAD)"
build_and_push() {
local context="$1"
local image_name="$2"
echo "INFO: Building and pushing $image_name from context $context..."
docker buildx build \
--platform "$PLATFORM" \
--build-arg "COMMIT_SHA=$COMMIT_SHA" \
-t "$image_name" \
--push \
"$context"
}
api_image="$REGISTRY/$NAMESPACE/dify-api:$TAG"
web_image="$REGISTRY/$NAMESPACE/dify-web:$TAG"
cd "$root_dir"
build_and_push "api" "$api_image"
build_and_push "web" "$web_image"There was a problem hiding this comment.
Pull request overview
This PR sets up infrastructure for building and publishing Dify Docker images to Alibaba Cloud Container Registry (ACR) for the SyncMind project. The implementation provides both automated GitHub Actions workflows and manual local build options.
- Adds a GitHub Actions workflow for manual image builds and pushes to ACR
- Provides a bash script for local Docker image building and publishing
- Includes comprehensive documentation for both automated and manual workflows
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/syncmind-push-acr.yml |
GitHub Actions workflow that builds and pushes dify-api and dify-web images to Alibaba ACR on manual trigger |
syncmind/scripts/push-acr-latest.sh |
Bash script for local Docker image building and pushing with configurable registry, namespace, and platform settings |
syncmind/README.md |
Documentation explaining the image pipeline setup, including registry details, GitHub Actions configuration, and local usage instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods