-
Notifications
You must be signed in to change notification settings - Fork 1
enable imagelist argument for image build script #95
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
base: dev
Are you sure you want to change the base?
Conversation
…le docker image instead of whole service
There was a problem hiding this 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/--imagelistcommand-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) |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
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.
| 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) |
|
|
||
| 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) |
There was a problem hiding this comment.
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?
|
can |
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:
to build log-manager-cleaner but not build log-manager-nginx