Skip to content
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

SDK - Containers - Getting rid of _get_default_image_builder #2255

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions sdk/python/kfp/containers/_build_image_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

__all__ = [
'build_image_from_working_dir',
'default_image_builder',
]


Expand All @@ -35,14 +36,7 @@
_container_work_dir = '/python_env'


_default_image_builder = None


def _get_default_image_builder():
global _default_image_builder
if _default_image_builder is None:
_default_image_builder = ContainerBuilder()
return _default_image_builder
default_image_builder = ContainerBuilder()


def _generate_dockerfile_text(context_dir: str, dockerfile_path: str, base_image: str = None) -> str:
Expand Down Expand Up @@ -122,7 +116,7 @@ def build_image_from_working_dir(image_name: str = None, working_dir: str = None
return cached_image_name

if builder is None:
builder = _get_default_image_builder()
builder = default_image_builder
image_name = builder.build(
local_dir=context_dir,
target_image=image_name,
Expand Down