-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[azure][trace] Check trace Cosmos status and log warnings if not ready (
#3200) # Description This PR mainly targets to add a check for trace Cosmos DB status during create Azure run. If the Cosmos is not ready, will log a warning on that to hint user enable with `pf config set`. **Warning message** Local to cloud ![image](https://github.com/microsoft/promptflow/assets/38847871/0718e4cc-1d19-4e71-ab69-05b3bfc0b59e) Submit run to Azure ![image](https://github.com/microsoft/promptflow/assets/38847871/e8159520-8fc5-4d53-8986-a064849d0332) As this change will add one new request during `pfazure run create`, so this PR also contains the changes that update the recordings. # All Promptflow Contribution checklist: - [x] **The pull request does not introduce [breaking changes].** - [x] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [x] Pull request includes test coverage for the included changes.
- Loading branch information
1 parent
95a73ac
commit b01ce40
Showing
58 changed files
with
69,774 additions
and
27,766 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# --------------------------------------------------------- | ||
|
||
from dataclasses import dataclass | ||
|
||
from promptflow.azure._constants._trace import CosmosConfiguration, CosmosStatus | ||
from promptflow.azure._restclient.flow.models import TraceCosmosMetaDto | ||
|
||
|
||
@dataclass | ||
class CosmosMetadata: | ||
configuration: str | ||
status: str | ||
|
||
@staticmethod | ||
def _from_rest_object(obj: TraceCosmosMetaDto) -> "CosmosMetadata": | ||
return CosmosMetadata( | ||
configuration=obj.trace_cosmos_configuration, | ||
status=obj.trace_cosmos_status, | ||
) | ||
|
||
def is_disabled(self) -> bool: | ||
return self.configuration == CosmosConfiguration.DISABLED | ||
|
||
def is_ready(self) -> bool: | ||
return not self.is_disabled() and self.status == CosmosStatus.INITIALIZED |
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
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
Oops, something went wrong.