Use Configuration contexts in Model Upload CLI#649
Merged
srikanthbachala20 merged 3 commits intomasterfrom Jul 1, 2025
Merged
Conversation
Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Use Config contexts in Model Upload CLI
Use Configuration contexts in Model Upload CLI
Jun 25, 2025
Minimum allowed line rate is |
mogith-pn
approved these changes
Jul 1, 2025
Contributor
mogith-pn
left a comment
There was a problem hiding this comment.
LGTM. Let's merge this for now, but we may have to write a test for validating config /context before upload.
Contributor
|
looks good to me. |
srikanthbachala20
added a commit
that referenced
this pull request
Jul 29, 2025
* Initial plan * Implement config contexts support in Model Upload CLI Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> * Fix Linting --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> Co-authored-by: Srikanth Bachala <srikanth.bachala@clarifai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Model Upload CLI (
clarifai model upload .) now uses Configuration contexts instead of relying solely on environment variables likeCLARIFAI_PAT.Problem
Previously, the model upload command required users to set environment variables directly:
This approach was inconsistent with other CLI commands like
clarifai model local-devwhich properly use the configuration context system.Solution
The upload command now integrates with the configuration context system:
Changes Made
@click.pass_contextandvalidate_context(ctx)to the upload commandctx.obj.current.patandctx.obj.current.api_baseto the backendpatandbase_urlparameters to constructorBackward Compatibility
✅ Fully maintained - existing code using environment variables continues to work unchanged:
Testing
download-checkpoints,signatures) remain unaffectedFixes #648.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
samples.clarifai.compython -m pytest tests/REDACTEDs/test_model_signatures.py -xvs --tb=short(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.