[EAGLE-7196]: Various improvement in CLI/SDK for model upload, logs, etc.#939
[EAGLE-7196]: Various improvement in CLI/SDK for model upload, logs, etc.#939
Conversation
luv-bansal
left a comment
There was a problem hiding this comment.
deployment logs feature not seems to work, and few comments. apart of it looks good
| @click.pass_context | ||
| def create(ctx, nodepool_id, deployment_id, config): | ||
| """Create a new Deployment with the given config file.""" | ||
| def create(ctx, config): |
There was a problem hiding this comment.
I see wait=True parameter to nodepool.create_deployment(), we can also have --wait flag in CLI as well
There was a problem hiding this comment.
oh, I think default value is True, so it's fine, but still good to have a flag
There was a problem hiding this comment.
yeah feel free to run with this PR and add any improvements.
| self.logger.info( | ||
| f"Waiting for deployment '{deployment_id}' to reach {min_replicas} running replicas..." | ||
| ) | ||
| self.logger.info("Streaming logs (runner and runner.events):\n") |
There was a problem hiding this comment.
We can remove (runner and runner.events) in this log, user don't care about it and probably won't understand
| ] | ||
| return f"Deployment Details: \n{', '.join(attribute_strings)}\n" | ||
|
|
||
| def logs( |
There was a problem hiding this comment.
I test uploading a cpu model with --autodeploy flag and my pod is scheduled but logs just stuck at below, something is wrong
⏳ Deploying model...
[INFO] 17:27:04.530160 Deployment with ID 'deploy-browser-mcp-server-110286' is created:
code: SUCCESS
description: "Ok"
req_id: "sdk-python-12.1.7-bbd76943e5b54ca2af7124eb2f11bfab"
| thread=8588059200
[INFO] 17:27:04.534269 Waiting for deployment 'deploy-browser-mcp-server-110286' to reach 1 running replicas... | thread=8588059200
[INFO] 17:27:04.534343 Streaming logs (runner and runner.events):
| thread=8588059200
There was a problem hiding this comment.
yeah this is my experience as well. I'll post about it in CO channel the reason why
This pull request introduces several improvements to the Clarifai CLI, focusing on better automation support, enhanced user experience, and expanded functionality for deployment and context management. The most significant changes are grouped below:
Automation and non-interactive mode improvements:
inputprompts with theprompt_yes_noutility throughoutartifact.pyandmodel.pyfor improved automation and scriptability, including default behaviors for yes/no questions. [1] [2] [3] [4] [5] [6] [7]sys.stdin.isatty()) in context and login commands, enforcing required arguments and aborting gracefully when user input isn't possible. [1] [2] [3]Deployment functionality enhancements:
nodepool_idandcompute_cluster_id. Also updated help text and examples for clarity. [1] [2]Deploymentclient class by filtering kwargs to match proto fields and adding arefreshmethod to sync deployment info from the API. [1] [2] [3]Context and credential management improvements:
HF_TOKEN) in context listings and expanded command aliases. [1] [2]Model upload and initialization changes:
--autodeployflag to the model upload command for automatic deployment after upload, and removed unnecessary manual prompts during initialization. [1] [2] [3] [4]These changes collectively make the CLI more robust for both interactive and automated workflows, improve clarity for users, and expand deployment and context management capabilities.