Skip to content

Conversation

@ji-yaqi
Copy link
Contributor

@ji-yaqi ji-yaqi commented Oct 15, 2021

No description provided.

@product-auto-label product-auto-label bot added the api: aiplatform Issues related to the AI Platform API. label Oct 15, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 15, 2021
@ji-yaqi ji-yaqi changed the title feat(PipelineJob): allow PipelineSpec as inputs in path. feat(PipelineJob): allow PipelineSpec as param Oct 15, 2021
builder.update_pipeline_root(pipeline_root)
builder.update_runtime_parameters(parameter_values)
runtime_config_dict = builder.build()
if pipeline_spec_only:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be covered by the else block. So you don't even need this flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I wasn't very clear with the last comment, I meant you could use PipelineRuntimeConfigBuilder.from_job_spec_json(pipeline_job) for both cases, something like:

if pipeline_json.get("pipelineSpec") is not None: pipeline_job = pipeline_json pipeline_root = ... else: pipeline_job = {"pipelineSpec": pipeline_json, "runtimeConfig": {}} pipeline_root = ... builder = pipeline_utils.PipelineRuntimeConfigBuilder.from_job_spec_json(pipeline_job) builder.update_pipeline_root(pipeline_root) builder.update_runtime_parameters(parameter_values) runtime_config_dict = builder.build() 

This will result shorter and cleaner code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

@chensun
Copy link
Member

chensun commented Oct 19, 2021

/lgtm
/approve

Thanks!

@ji-yaqi ji-yaqi merged commit f90a1bd into googleapis:main Oct 19, 2021
@ji-yaqi ji-yaqi deleted the pipeline_spec branch October 19, 2021 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: aiplatform Issues related to the AI Platform API. cla: yes This human has signed the Contributor License Agreement.

2 participants