Skip to content

Conversation

@hippogr
Copy link
Contributor

@hippogr hippogr commented Oct 14, 2025

This PR is used to add -imagelist argument for pai-build script when building the docker image. With this argument, we can build a single docker image in a service without building the whole service. For example:

 ./build/pai_build.py build -c ../config-test/ -n -s log-manager -i log-manager-cleaner

to build log-manager-cleaner but not build log-manager-nginx

Copilot AI review requested due to automatic review settings October 14, 2025 06:21
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 adds support for an -imagelist argument to the pai-build script, enabling selective building of specific Docker images within a service instead of building all images in the service. This allows developers to build only the images they need, improving build efficiency and reducing unnecessary build time.

  • Added -i/--imagelist command-line argument to specify which images to build
  • Modified the build pipeline to pass the imagelist filter through the build components
  • Updated the build logic to conditionally build only specified images when the filter is provided

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
build/pai_build.py Added imagelist argument parser and passed args to BuildCenter
build/core/build_center.py Modified constructor to accept arg_config and pass imagelist to build handler
build/core/build_handler.py Added imagelist parameter to build_single_component with conditional image building

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

build_worker.copy_dependency_folder(os.path.join(self.codeDir,inedge),
os.path.join(self.graph.services[item].path,self.dependencyDir+inedge))
build_worker.build_single_component(self.graph.services[item])
build_worker.build_single_component(self.graph.services[item], self.arg_config.imagelist)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Potential AttributeError if arg_config is None. When arg_config is None (default parameter), accessing self.arg_config.imagelist will raise an AttributeError. Should check if self.arg_config is not None before accessing its attributes.

Suggested change
build_worker.build_single_component(self.graph.services[item], self.arg_config.imagelist)
imagelist = self.arg_config.imagelist if self.arg_config is not None else None
build_worker.build_single_component(self.graph.services[item], imagelist)

Copilot uses AI. Check for mistakes.

def build_service(args, config_model):
pai_build = build_center.BuildCenter(config_model, args.service, 'k8s')
pai_build = build_center.BuildCenter(config_model, args.service, 'k8s', args)

Choose a reason for hiding this comment

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

why not args.imagelist directly?

@zhogu
Copy link

zhogu commented Oct 29, 2025

can ./build/pai_build.py push -s [service] -i [image] support this feature?

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.

4 participants