Skip to content

Commit 7429455

Browse files
committed
[SDK] Enable resource specification for trial containers
1 parent c749d27 commit 7429455

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sdk/python/v1beta1/kubeflow/katib/api/katib_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def tune(
147147
retain_trials: bool = False,
148148
packages_to_install: List[str] = None,
149149
pip_index_url: str = "https://pypi.org/simple",
150+
resources: Optional[client.V1ResourceRequirements] = None,
150151
):
151152
"""Create HyperParameter Tuning Katib Experiment from the objective function.
152153
@@ -182,6 +183,9 @@ def tune(
182183
to the base image packages. These packages are installed before
183184
executing the objective function.
184185
pip_index_url: The PyPI url from which to install Python packages.
186+
resources: An optional kubernetes.client.V1ResourceRequirements object that lets
187+
you manually specify cpu and memory limits and requests for the trial container.
188+
Additional details are available at https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ResourceRequirements.md.
185189
186190
Raises:
187191
ValueError: Objective function has invalid arguments.
@@ -297,6 +301,7 @@ def tune(
297301
image=base_image,
298302
command=["bash", "-c"],
299303
args=[exec_script],
304+
resources=resources,
300305
)
301306
],
302307
),

0 commit comments

Comments
 (0)