Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions instill/clients/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,17 @@ def get_pipeline(
return RequestFactory(
method=self.hosts[self.instance].async_client.GetUserPipeline,
request=pipeline_interface.GetUserPipelineRequest(
name=f"{self.target_namespace}/pipelines/{name}"
name=f"{self.target_namespace}/pipelines/{name}",
view=pipeline_interface.Pipeline.VIEW_FULL,
),
metadata=self.hosts[self.instance].metadata,
).send_async()

return RequestFactory(
method=self.hosts[self.instance].client.GetUserPipeline,
request=pipeline_interface.GetUserPipelineRequest(
name=f"{self.target_namespace}/pipelines/{name}"
name=f"{self.target_namespace}/pipelines/{name}",
view=pipeline_interface.Pipeline.VIEW_FULL,
),
metadata=self.hosts[self.instance].metadata,
).send_sync()
Expand Down
11 changes: 10 additions & 1 deletion instill/resources/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import grpc
from google.longrunning import operations_pb2
from google.protobuf.field_mask_pb2 import FieldMask

import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_interface
from instill.clients import InstillClient
Expand Down Expand Up @@ -66,9 +67,17 @@ def trigger_async(self, task_inputs: list) -> operations_pb2.Operation:
self.resource.id, task_inputs
).operation

def get_recipe(self) -> str:
def get_recipe(self) -> pipeline_interface.Recipe:
return self.resource.recipe

def update_recipe(self, recipe: pipeline_interface.Recipe):
pipeline = self.resource
pipeline.recipe.CopyFrom(recipe)
self.client.pipeline_service.update_pipeline(
pipeline, FieldMask(paths=["recipe"])
)
self._update()

def validate_pipeline(self) -> bool:
try:
self.client.pipeline_service.validate_pipeline(
Expand Down