forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: accept PathLike as code of CommandComponent (Azure#31469)
- Loading branch information
Showing
7 changed files
with
277 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
245 changes: 245 additions & 0 deletions
245
.../e2etests/test_component.pyTestComponenttest_command_component_with_pathlike_as_code.json
This file contains 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,245 @@ | ||
{ | ||
"Entries": [ | ||
{ | ||
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/000000000000000000000/versions?api-version=2023-04-01\u0026hash=3b94ac6cb29712a56cb97d9765c2dacc29a08b4fcde68a55a600b8abadbcf91e\u0026hashVersion=202208", | ||
"RequestMethod": "GET", | ||
"RequestHeaders": { | ||
"Accept": "application/json", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"User-Agent": "azure-ai-ml/1.9.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.10 (Windows-10-10.0.22621-SP0)" | ||
}, | ||
"RequestBody": null, | ||
"StatusCode": 200, | ||
"ResponseHeaders": { | ||
"Cache-Control": "no-cache", | ||
"Content-Encoding": "gzip", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Fri, 04 Aug 2023 05:25:50 GMT", | ||
"Expires": "-1", | ||
"Pragma": "no-cache", | ||
"Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains", | ||
"Transfer-Encoding": "chunked", | ||
"Vary": [ | ||
"Accept-Encoding", | ||
"Accept-Encoding" | ||
], | ||
"x-aml-cluster": "vienna-eastus-01", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-ms-correlation-request-id": "21c6b84b-fb05-4fb1-a344-93512507ac64", | ||
"x-ms-ratelimit-remaining-subscription-reads": "11995", | ||
"x-ms-response-type": "standard", | ||
"x-ms-routing-request-id": "JAPANEAST:20230804T052550Z:21c6b84b-fb05-4fb1-a344-93512507ac64", | ||
"x-request-time": "0.044" | ||
}, | ||
"ResponseBody": { | ||
"value": [ | ||
{ | ||
"id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/37cdd127-bdae-4873-9afa-0b485d43c989/versions/1", | ||
"name": "1", | ||
"type": "Microsoft.MachineLearningServices/workspaces/codes/versions", | ||
"properties": { | ||
"description": null, | ||
"tags": {}, | ||
"properties": { | ||
"hash_sha256": "3b94ac6cb29712a56cb97d9765c2dacc29a08b4fcde68a55a600b8abadbcf91e", | ||
"hash_version": "202208" | ||
}, | ||
"isArchived": false, | ||
"isAnonymous": false, | ||
"codeUri": "https://sdknotebstorage763b8b075.blob.core.windows.net:443/86530095-7-0bba99e7-0445-5a98-b6df-ba42c8a99b2b/helloworld_components_with_env", | ||
"provisioningState": "Succeeded" | ||
}, | ||
"systemData": { | ||
"createdAt": "2023-08-02T03:56:51.1145408\u002B00:00", | ||
"createdBy": "Xingzhi Zhang", | ||
"createdByType": "User", | ||
"lastModifiedAt": "2023-08-02T03:56:51.1145408\u002B00:00", | ||
"lastModifiedBy": "Xingzhi Zhang", | ||
"lastModifiedByType": "User" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/37cdd127-bdae-4873-9afa-0b485d43c989/versions/1?api-version=2023-04-01", | ||
"RequestMethod": "GET", | ||
"RequestHeaders": { | ||
"Accept": "application/json", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"User-Agent": "azure-ai-ml/1.9.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.10 (Windows-10-10.0.22621-SP0)" | ||
}, | ||
"RequestBody": null, | ||
"StatusCode": 200, | ||
"ResponseHeaders": { | ||
"Cache-Control": "no-cache", | ||
"Content-Encoding": "gzip", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Fri, 04 Aug 2023 05:25:51 GMT", | ||
"Expires": "-1", | ||
"Pragma": "no-cache", | ||
"Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains", | ||
"Transfer-Encoding": "chunked", | ||
"Vary": [ | ||
"Accept-Encoding", | ||
"Accept-Encoding" | ||
], | ||
"x-aml-cluster": "vienna-eastus-01", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-ms-correlation-request-id": "35c1e6ae-306f-4831-bb3d-941196b43d6b", | ||
"x-ms-ratelimit-remaining-subscription-reads": "11994", | ||
"x-ms-response-type": "standard", | ||
"x-ms-routing-request-id": "JAPANEAST:20230804T052551Z:35c1e6ae-306f-4831-bb3d-941196b43d6b", | ||
"x-request-time": "0.050" | ||
}, | ||
"ResponseBody": { | ||
"id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/37cdd127-bdae-4873-9afa-0b485d43c989/versions/1", | ||
"name": "1", | ||
"type": "Microsoft.MachineLearningServices/workspaces/codes/versions", | ||
"properties": { | ||
"description": null, | ||
"tags": {}, | ||
"properties": { | ||
"hash_sha256": "0000000000000", | ||
"hash_version": "0000000000000" | ||
}, | ||
"isArchived": false, | ||
"isAnonymous": false, | ||
"codeUri": "https://sdknotebstorage763b8b075.blob.core.windows.net:443/86530095-7-0bba99e7-0445-5a98-b6df-ba42c8a99b2b/helloworld_components_with_env", | ||
"provisioningState": "Succeeded" | ||
}, | ||
"systemData": { | ||
"createdAt": "2023-08-02T03:56:51.1145408\u002B00:00", | ||
"createdBy": "Xingzhi Zhang", | ||
"createdByType": "User", | ||
"lastModifiedAt": "2023-08-02T03:56:51.1145408\u002B00:00", | ||
"lastModifiedBy": "Xingzhi Zhang", | ||
"lastModifiedByType": "User" | ||
} | ||
} | ||
}, | ||
{ | ||
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/components/test_269918924253/versions/1?api-version=2022-10-01", | ||
"RequestMethod": "PUT", | ||
"RequestHeaders": { | ||
"Accept": "application/json", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"Content-Length": "981", | ||
"Content-Type": "application/json", | ||
"User-Agent": "azure-ai-ml/1.9.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.10 (Windows-10-10.0.22621-SP0)" | ||
}, | ||
"RequestBody": { | ||
"properties": { | ||
"description": "This is the basic command component", | ||
"properties": { | ||
"client_component_hash": "104acc03-ba5e-888f-08c2-c7843b3be91b" | ||
}, | ||
"tags": { | ||
"tag": "tagvalue", | ||
"owner": "sdkteam" | ||
}, | ||
"isAnonymous": false, | ||
"isArchived": false, | ||
"componentSpec": { | ||
"command": "echo Hello World", | ||
"code": "azureml:/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/37cdd127-bdae-4873-9afa-0b485d43c989/versions/1", | ||
"environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", | ||
"name": "test_269918924253", | ||
"description": "This is the basic command component", | ||
"tags": { | ||
"tag": "tagvalue", | ||
"owner": "sdkteam" | ||
}, | ||
"version": "1", | ||
"$schema": "https://azuremlschemas.azureedge.net/development/commandComponent.schema.json", | ||
"display_name": "CommandComponentBasic", | ||
"is_deterministic": true, | ||
"outputs": { | ||
"component_out_path": { | ||
"type": "uri_folder" | ||
} | ||
}, | ||
"type": "command", | ||
"_source": "YAML.COMPONENT" | ||
} | ||
} | ||
}, | ||
"StatusCode": 201, | ||
"ResponseHeaders": { | ||
"Cache-Control": "no-cache", | ||
"Content-Length": "1768", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Fri, 04 Aug 2023 05:25:53 GMT", | ||
"Expires": "-1", | ||
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/components/test_269918924253/versions/1?api-version=2022-10-01", | ||
"Pragma": "no-cache", | ||
"Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains", | ||
"x-aml-cluster": "vienna-eastus-01", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-ms-correlation-request-id": "1964ca7f-6c48-4835-8195-49dc77449fde", | ||
"x-ms-ratelimit-remaining-subscription-writes": "1197", | ||
"x-ms-response-type": "standard", | ||
"x-ms-routing-request-id": "JAPANEAST:20230804T052553Z:1964ca7f-6c48-4835-8195-49dc77449fde", | ||
"x-request-time": "0.685" | ||
}, | ||
"ResponseBody": { | ||
"id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/components/test_269918924253/versions/1", | ||
"name": "1", | ||
"type": "Microsoft.MachineLearningServices/workspaces/components/versions", | ||
"properties": { | ||
"description": null, | ||
"tags": { | ||
"tag": "tagvalue", | ||
"owner": "sdkteam" | ||
}, | ||
"properties": { | ||
"client_component_hash": "104acc03-ba5e-888f-08c2-c7843b3be91b" | ||
}, | ||
"isArchived": false, | ||
"isAnonymous": false, | ||
"componentSpec": { | ||
"$schema": "https://azuremlschemas.azureedge.net/development/commandComponent.schema.json", | ||
"name": "test_269918924253", | ||
"version": "1", | ||
"display_name": "CommandComponentBasic", | ||
"is_deterministic": "True", | ||
"type": "command", | ||
"description": "This is the basic command component", | ||
"tags": { | ||
"tag": "tagvalue", | ||
"owner": "sdkteam" | ||
}, | ||
"outputs": { | ||
"component_out_path": { | ||
"type": "uri_folder" | ||
} | ||
}, | ||
"code": "azureml:/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/codes/37cdd127-bdae-4873-9afa-0b485d43c989/versions/1", | ||
"environment": "azureml://registries/azureml/environments/AzureML-sklearn-1.0-ubuntu20.04-py38-cpu/versions/33", | ||
"resources": { | ||
"instance_count": "1" | ||
}, | ||
"command": "echo Hello World" | ||
} | ||
}, | ||
"systemData": { | ||
"createdAt": "2023-08-04T05:25:53.54076\u002B00:00", | ||
"createdBy": "Xingzhi Zhang", | ||
"createdByType": "User", | ||
"lastModifiedAt": "2023-08-04T05:25:53.6146631\u002B00:00", | ||
"lastModifiedBy": "Xingzhi Zhang", | ||
"lastModifiedByType": "User" | ||
} | ||
} | ||
} | ||
], | ||
"Variables": { | ||
"component_name": "test_269918924253" | ||
} | ||
} |