-
Notifications
You must be signed in to change notification settings - Fork 3.4k
{Cognitive Services} Manage Compute Deployment Support #33338
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
Open
achauhan-scc
wants to merge
8
commits into
Azure:dev
Choose a base branch
from
achauhan-scc:maap-support
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
506e19b
Add CRUD commands for managed-compute-deployment under cognitiveservi…
achauhan-scc b3f032e
Update HISTORY.rst with managed-compute-deployment changelog entry
achauhan-scc 9a4e424
Fix CI: lazy-import ManagedComputeDeployment models
achauhan-scc 329bef2
Fix linter: use custom_show_command for show, add agent logs delete e…
achauhan-scc e44a70d
Bump azure-mgmt-cognitiveservices to 15.0.0b2
achauhan-scc d56ae3f
retrigger CI
achauhan-scc 69a1714
Update test recordings for SDK 15.0.0b2 API version change
achauhan-scc 9ac476c
Merge remote-tracking branch 'origin/dev' into maap-support
achauhan-scc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
100 changes: 100 additions & 0 deletions
100
...ure/cli/command_modules/cognitiveservices/tests/latest/test_managed_compute_deployment.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| import unittest | ||
|
|
||
| from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer | ||
| from azure.cli.testsdk.decorators import serial_test | ||
|
|
||
|
|
||
| class CognitiveServicesManagedComputeDeploymentTests(ScenarioTest): | ||
| @serial_test() | ||
| @ResourceGroupPreparer() | ||
| def test_cognitiveservices_managed_compute_deployment(self, resource_group): | ||
| sname = self.create_random_name(prefix='cs_cli_test_', length=16) | ||
|
achauhan-scc marked this conversation as resolved.
Outdated
|
||
|
|
||
| self.kwargs.update({ | ||
| 'sname': sname, | ||
| 'kind': 'AIServices', | ||
| 'sku': 'S0', | ||
| 'location': 'eastus', | ||
| 'deployment_name': 'test-mcd', | ||
| 'model': 'azureml://registries/azureml-openai-oss/models/gpt-oss-120b/versions/4', | ||
| 'deployment_template': 'azureml://registries/azureml-openai-oss/deploymenttemplates/' | ||
| 'gpt-oss-120b-short-context/versions/1', | ||
| 'accelerator_type': 'H100_80GB', | ||
| 'sku_name': 'GlobalManagedCompute', | ||
| 'sku_capacity': '1', | ||
| }) | ||
|
|
||
| # create cognitive services account | ||
| self.cmd( | ||
| 'az cognitiveservices account create -n {sname} -g {rg} ' | ||
| '--kind {kind} --sku {sku} -l {location} --yes', | ||
| checks=[ | ||
| self.check('name', '{sname}'), | ||
| self.check('properties.provisioningState', 'Succeeded'), | ||
| ]) | ||
|
|
||
| # list should be empty initially | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment list ' | ||
| '-n {sname} -g {rg}', | ||
| checks=[self.check('length(@)', 0)]) | ||
|
|
||
| # create managed compute deployment | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment create ' | ||
| '-n {sname} -g {rg} ' | ||
| '--deployment-name {deployment_name} ' | ||
| '--model "{model}" ' | ||
| '--deployment-template "{deployment_template}" ' | ||
| '--accelerator-type {accelerator_type} ' | ||
| '--sku-name {sku_name} ' | ||
| '--sku-capacity {sku_capacity} ' | ||
| '--tags environment=test') | ||
|
|
||
| # show the deployment | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment show ' | ||
| '-n {sname} -g {rg} ' | ||
| '--deployment-name {deployment_name}', | ||
| checks=[ | ||
| self.check('name', '{deployment_name}'), | ||
| self.check('properties.model', '{model}'), | ||
| self.check('sku.name', '{sku_name}'), | ||
| ]) | ||
|
|
||
| # list should contain the deployment | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment list ' | ||
| '-n {sname} -g {rg}', | ||
| checks=[self.check('length(@)', 1)]) | ||
|
|
||
| # update sku capacity | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment update ' | ||
| '-n {sname} -g {rg} ' | ||
| '--deployment-name {deployment_name} ' | ||
| '--sku-capacity 2') | ||
|
|
||
| # delete the deployment | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment delete ' | ||
| '-n {sname} -g {rg} ' | ||
| '--deployment-name {deployment_name}') | ||
|
|
||
| # verify deletion | ||
| self.cmd( | ||
| 'az cognitiveservices account managed-compute-deployment list ' | ||
| '-n {sname} -g {rg}', | ||
| checks=[self.check('length(@)', 0)]) | ||
|
|
||
| # cleanup | ||
| self.cmd('az cognitiveservices account delete -n {sname} -g {rg}') | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.