Skip to content

Add docker images size change check#2133

Merged
ZePan110 merged 31 commits into
mainfrom
ze-ci/size
Jul 21, 2025
Merged

Add docker images size change check#2133
ZePan110 merged 31 commits into
mainfrom
ze-ci/size

Conversation

@ZePan110
Copy link
Copy Markdown
Collaborator

@ZePan110 ZePan110 commented Jul 11, 2025

Description

Add docker images size change check

  1. Overwrite the last automatic comment and keep only the last one.
  2. Keep the results of each commit in the workflow summary page.

Issues

opea-project/GenAIComps#1783

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

List the newly introduced 3rd party dependency if exists.

Tests

Test pssed:
https://github.com/opea-project/GenAIExamples/actions/runs/16362800522
#2133 (comment)
image

Signed-off-by: ZePan110 <ze.pan@intel.com>
Copilot AI review requested due to automatic review settings July 11, 2025 01:23
@ZePan110 ZePan110 requested a review from chensuyue as a code owner July 11, 2025 01:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 11, 2025

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

  • .github/workflows/pr-image-size.yml

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a GitHub Actions workflow that detects changes to Dockerfiles in pull requests, builds both the base and PR versions of each image, and reports size differences.

  • Identifies changed Dockerfiles in the PR.
  • Builds images from the base branch and PR branch.
  • Outputs byte-level size changes for each Dockerfile.
Comments suppressed due to low confidence (2)

.github/workflows/pr-image-size.yml:34

  • In case of renamed Dockerfiles, git diff --name-status outputs both old and new paths (old in $2, new in $3). Currently you're always picking $2, which will miss the new filename on renames. Consider checking the status code and using $3 for 'R' entries.
          files=$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '{print $2}' | grep -E 'Dockerfile$' || true)

.github/workflows/pr-image-size.yml:50

  • Only checking out the Dockerfile from the base branch means the build context still includes PR changes to other files, which may lead to incorrect size comparisons. It would be more accurate to checkout the entire directory (or full repo) at the base commit before building.
            git checkout origin/${{ github.base_ref }} -- "$dockerfile"

Comment thread .github/workflows/pr-image-size.yml Fixed
ZePan110 and others added 7 commits July 11, 2025 09:54
…ain permissions


Signed-off-by: ZePan110 <ze.pan@intel.com>

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
@ZePan110 ZePan110 force-pushed the ze-ci/size branch 7 times, most recently from 33bd367 to f136981 Compare July 14, 2025 09:02
Signed-off-by: ZePan110 <ze.pan@intel.com>
Comment thread SearchQnA/Dockerfile Outdated
Comment thread .github/workflows/pr-image-size.yml Outdated
@chensuyue chensuyue marked this pull request as draft July 15, 2025 01:51
@ZePan110 ZePan110 added the WIP label Jul 15, 2025
@ZePan110 ZePan110 marked this pull request as ready for review July 15, 2025 04:16
@ZePan110 ZePan110 force-pushed the ze-ci/size branch 11 times, most recently from a18efb7 to 2e4bd03 Compare July 18, 2025 02:22
ZePan110 added 4 commits July 18, 2025 10:34
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 18, 2025

ℹ️ INFO
File AudioQnA/Dockerfile resulted in a change in the image size from 422 -> 422 MB (diff: 0 MB)

ZePan110 added 4 commits July 18, 2025 11:20
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Comment thread SearchQnA/ui/docker/Dockerfile Outdated
@chensuyue
Copy link
Copy Markdown
Collaborator

"File 'MultimodalQnA/Dockerfile' resulted in a change in the image size from 422 -> 422 MB (diff: 0 MB) File 'SearchQnA/ui/docker/Dockerfile' resulted in a change in the image size from 1413 -> 1413 MB (diff: 0 MB) "

Please remove " in the head and end, make the log in good shape.

@chensuyue
Copy link
Copy Markdown
Collaborator

chensuyue commented Jul 18, 2025

"File 'MultimodalQnA/Dockerfile' resulted in a change in the image size from 422 -> 422 MB (diff: 0 MB) File 'SearchQnA/ui/docker/Dockerfile' resulted in a change in the image size from 1413 -> 1413 MB (diff: 0 MB) "

Please remove " in the head and end, make the log in good shape.

Maybe shows a warning like this:

⚠️ WARNING
File xxx/Dockerfile resulted in a change in the image size from 5500 -> 5600 MB (diff: 100 MB)

File 'MultimodalQnA/Dockerfile' resulted in a change in the image size from 422 -> 422 MB (diff: 0 MB)  
File 'SearchQnA/ui/docker/Dockerfile' resulted in a change in the image size from 1413 -> 1413 MB (diff: 0 MB)

ZePan110 added 2 commits July 18, 2025 14:18
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
@ZePan110
Copy link
Copy Markdown
Collaborator Author

ℹ️ just test comment

ZePan110 added 2 commits July 18, 2025 15:29
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
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.

6 participants