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

remove default namespace #2250

Merged
merged 3 commits into from
Sep 27, 2019
Merged
Changes from 2 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
9 changes: 5 additions & 4 deletions sdk/python/kfp/containers/_component_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _configure_logger(logger):
logger.addHandler(error_handler)


def build_python_component(component_func, target_image, base_image=None, dependency=[], staging_gcs_path=None, timeout=600, namespace='kubeflow', target_component_file=None, python_version='python3'):
def build_python_component(component_func, target_image, base_image=None, dependency=[], staging_gcs_path=None, timeout=600, namespace=None, target_component_file=None, python_version='python3'):
""" build_component automatically builds a container image for the component_func
based on the base_image and pushes to the target_image.

Expand All @@ -177,7 +177,7 @@ def build_python_component(component_func, target_image, base_image=None, depend
staging_gcs_path (str): GCS blob that can store temporary build files
target_image (str): target image path
timeout (int): the timeout for the image build(in secs), default is 600 seconds
namespace (str): the namespace within which to run the kubernetes kaniko job, default is "kubeflow"
namespace (str): the namespace within which to run the kubernetes kaniko job, default is None
dependency (list): a list of VersionedDependency, which includes the package name and versions, default is empty
python_version (str): choose python2 or python3, default is python3
Raises:
Expand Down Expand Up @@ -266,7 +266,7 @@ def build_python_component(component_func, target_image, base_image=None, depend
return task_factory_function


def build_docker_image(staging_gcs_path, target_image, dockerfile_path, timeout=600, namespace='kubeflow'):
def build_docker_image(staging_gcs_path, target_image, dockerfile_path, timeout=600, namespace=None):
""" build_docker_image automatically builds a container image based on the specification in the dockerfile and
pushes to the target_image.

Expand All @@ -275,7 +275,8 @@ def build_docker_image(staging_gcs_path, target_image, dockerfile_path, timeout=
target_image (str): gcr path to push the final image
dockerfile_path (str): local path to the dockerfile
timeout (int): the timeout for the image build(in secs), default is 600 seconds
namespace (str): the namespace within which to run the kubernetes kaniko job, default is "kubeflow"
namespace (str): the namespace within which to run the kubernetes kaniko job. Default is None, build_python_component
internally will find the current namespace if it is run in the GKE cluster when set to None.
"""
_configure_logger(logging.getLogger())

Expand Down