-
Notifications
You must be signed in to change notification settings - Fork 8
PIPE-1113 PIPE-1114: Add CLI support for pause, cancel, resume, and monitor Pipeline Runs #881
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
…ogging Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
clarifai/client/pipeline.py
Outdated
| Raises: | ||
| UserError: If the patch request fails. | ||
| """ | ||
| from google.rpc import status_pb2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot status_pb2 should be imported from clarifai_grpc.grpc.api.status similar to status_code_pb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1d6f78b. Changed to import status_pb2 from clarifai_grpc.grpc.api.status at the module level, consistent with the pattern used in model_runner.py and other parts of the codebase.
Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
…g message Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
| @click.option('--pipeline_id', required=False, help='Pipeline ID.') | ||
| @click.option('--pipeline_version_id', required=False, help='Pipeline Version ID.') | ||
| @click.pass_context | ||
| def pause( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot also add a monitor command i.e. clarifai pipelinerun monitor <pipeline_version_run_id>
It should work exactly similar to how --monitor flag works in clarifai pipeline run ... --monitor where the current status and logs are polled.
Similar to pause:
-
user_id, app_id, pipeline_id, pipeline_version_idshould be loaded fromconfig-lock.yamland user can also provide them. -
Resolve
pipeline_version_run_idfrom positional or flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 2aa20e9. The monitor command works exactly like clarifai pipeline run --monitor:
- Accepts
pipeline_version_run_idas positional arg or--pipeline_version_run_idflag - Loads
user_id,app_id,pipeline_id,pipeline_version_idfromconfig-lock.yamlor CLI flags - Supports
--timeoutand--monitor_intervaloptions (defaults: 3600s and 10s) - Supports
--log_fileoption to write logs to a file - Polls current status and displays logs in real-time
Usage: clarifai pr monitor <pipeline_version_run_id>
Co-authored-by: nitinbhojwani <9331380+nitinbhojwani@users.noreply.github.com>
Why
How
New CLI commands (
clarifai/cli/pipeline_run.py):clarifai pipelinerun(aliaspr) with subcommands:pause,cancel,resume,monitorpipeline_version_run_idas positional arg or explicit flaguser_id,app_id,pipeline_id,pipeline_version_idfromconfig-lock.yamlwhen presentmonitorcommand polls status and logs with configurable--timeoutand--monitor_intervaloptionsPipeline client method (
clarifai/client/pipeline.py):patch_pipeline_version_run()usesPatchPipelineVersionRunsRequestJOB_PAUSED(pause),JOB_CANCELLED(cancel),JOB_RUNNING(resume)status_pb2fromclarifai_grpc.grpc.api.statusfor consistency with codebase patternsDependencies:
clarifai-grpc>=11.11.3forJOB_PAUSEDstatus code supportTests
Notes
model_runner.py)monitorcommand works identically toclarifai pipeline run --monitorflag behaviorOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.