Skip to content

Conversation

@fgksgf
Copy link
Member

@fgksgf fgksgf commented Jul 30, 2025

What problem does this PR solve?

  • Add fast development build system that reduces image build time from minutes to ~2 seconds
  • Enable rapid iteration during operator development and e2e testing

What is changed and how does it work?

Skip Go module downloads and compilation by using pre-compiled local binaries when use make dev-image/xxx

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 30, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign fengou1 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 requested review from howardlau1999 and shonge July 30, 2025 04:09
@github-actions github-actions bot added the v2 for operator v2 label Jul 30, 2025
@github-actions
Copy link

/run-pull-e2e-kind-v2

@ti-chi-bot ti-chi-bot bot added the size/L label Jul 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.12%. Comparing base (f5527ea) to head (a24fa86).

Additional details and impacted files
@@             Coverage Diff             @@
##           feature/v2    #6339   +/-   ##
===========================================
  Coverage       45.12%   45.12%           
===========================================
  Files             317      317           
  Lines           21218    21218           
===========================================
  Hits             9574     9574           
  Misses          11644    11644           
Flag Coverage Δ
unittest 45.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fgksgf fgksgf force-pushed the huaxi/polish-dev-push branch from 55a2d1c to 2374ffd Compare July 30, 2025 04:16
@github-actions
Copy link

/run-pull-e2e-kind-v2

@fgksgf fgksgf force-pushed the huaxi/polish-dev-push branch from 2374ffd to d5f43fc Compare July 30, 2025 05:07
@github-actions
Copy link

/run-pull-e2e-kind-v2

@fgksgf fgksgf closed this Jul 30, 2025
@fgksgf fgksgf reopened this Aug 6, 2025
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

/run-pull-e2e-kind-v2

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

/run-pull-e2e-kind-v2

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

/run-pull-e2e-kind-v2

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

/run-pull-e2e-kind-v2

3 similar comments
@fgksgf
Copy link
Member Author

fgksgf commented Aug 7, 2025

/run-pull-e2e-kind-v2

@fgksgf
Copy link
Member Author

fgksgf commented Aug 7, 2025

/run-pull-e2e-kind-v2

@fgksgf
Copy link
Member Author

fgksgf commented Aug 8, 2025

/run-pull-e2e-kind-v2

@fgksgf fgksgf requested a review from Copilot August 12, 2025 03:03
Copy link

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 fast development build system for operator images to accelerate the development and testing workflow. Instead of rebuilding Go binaries during Docker image creation, it uses pre-compiled local binaries, reducing build time from minutes to approximately 2 seconds.

Key changes:

  • Adds a development-specific Dockerfile that copies pre-compiled binaries instead of compiling from source
  • Enhances the build system with DEV_MODE flag to toggle between development and production builds
  • Updates documentation to explain the new fast build workflow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
image/Dockerfile.dev New development Dockerfile that copies pre-compiled binaries for faster builds
hack/lib/image.sh Enhanced image build script with support for custom Dockerfile and dockerignore files
docs/CONTRIBUTING.md Updated documentation explaining the new DEV_MODE build system
Makefile Added DEV_MODE logic for image and push targets with dev-prepare-output helper
.github/licenserc.yaml Added .dockerignore.dev to license check exclusions
.dockerignore.dev New dockerignore file optimized for development builds

if [[ -n "$dockerignore" ]]; then
# Backup original .dockerignore if it exists
if [[ -f "$ROOT/.dockerignore" ]]; then
dockerignore_backup="$ROOT/.dockerignore.backup.$$"
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

Using $$ (process ID) for backup filename could cause race conditions if multiple builds run simultaneously. Consider using a more unique identifier like $(date +%s%N) or mktemp to generate unique backup filenames.

Suggested change
dockerignore_backup="$ROOT/.dockerignore.backup.$$"
dockerignore_backup="$(mktemp "$ROOT/.dockerignore.backup.XXXXXX")"

Copilot uses AI. Check for mistakes.
fi
# Copy custom dockerignore
cp "$ROOT/$dockerignore" "$ROOT/.dockerignore"
fi
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The cp command could fail if the source dockerignore file doesn't exist, but there's no error handling. Add a check to ensure the source file exists before copying.

Suggested change
fi
if [[ ! -f "$ROOT/$dockerignore" ]]; then
echo "Error: Custom dockerignore file '$ROOT/$dockerignore' does not exist." >&2
# Restore original .dockerignore if it was backed up
if [[ -n "$dockerignore_backup" && -f "$dockerignore_backup" ]]; then
mv "$dockerignore_backup" "$ROOT/.dockerignore"
fi
exit 1
fi
cp "$ROOT/$dockerignore" "$ROOT/.dockerignore"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L v2 for operator v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants