Skip to content

Commit

Permalink
SDK: fix setting pipeline-wide artifact_location for ResourceOp and V…
Browse files Browse the repository at this point in the history
…olumeOp classes and add description field for create_experiment() function (#2025)

* fix setting pipeline-wide artifact_location for ResourceOp and VolumeOp classes

* add description field for create_experiment() function
  • Loading branch information
solovyevt authored and k8s-ci-robot committed Sep 4, 2019
1 parent 0cc9f69 commit 8fce006
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ def _get_url_prefix(self):
# In-cluster pod. We could use relative URL.
return '/pipeline'

def create_experiment(self, name):
def create_experiment(self, name, description=None):
"""Create a new experiment.
Args:
name: the name of the experiment.
description: description of the experiment
Returns:
An Experiment object. Most important field is id.
"""
Expand All @@ -189,7 +190,7 @@ def create_experiment(self, name):

if not experiment:
logging.info('Creating experiment {}.'.format(name))
experiment = kfp_server_api.models.ApiExperiment(name=name)
experiment = kfp_server_api.models.ApiExperiment(name=name, description=description)
experiment = self._experiment_api.create_experiment(body=experiment)

if self._is_ipython():
Expand Down
5 changes: 3 additions & 2 deletions sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,9 @@ def _compile(self, pipeline_func):
for op in p.ops.values():
# inject pipeline level artifact location into if the op does not have
# an artifact location config already.
if artifact_location and not op.artifact_location:
op.artifact_location = artifact_location
if hasattr(op, "artifact_location"):
if artifact_location and not op.artifact_location:
op.artifact_location = artifact_location

sanitized_name = K8sHelper.sanitize_k8s_name(op.name)
op.name = sanitized_name
Expand Down

0 comments on commit 8fce006

Please sign in to comment.