-
Notifications
You must be signed in to change notification settings - Fork 6
[sc-107107] AKS plugin: fix SDK objects log method #57
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
Draft
amandineslx
wants to merge
4
commits into
master
Choose a base branch
from
chore/sc-107107-log-all-api-calls
base: master
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.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |||||
| from azure.core.exceptions import ResourceNotFoundError, HttpResponseError | ||||||
| from msrestazure.azure_exceptions import CloudError | ||||||
|
|
||||||
| from dku_utils.access import _is_none_or_blank, _has_not_blank_property | ||||||
| from dku_utils.access import _is_none_or_blank, _has_not_blank_property, _print_as_json | ||||||
| from dku_utils.cluster import make_overrides, get_cluster_from_connection_info | ||||||
| from dku_kube.nvidia_utils import add_gpu_driver_if_needed | ||||||
| from dku_azure.auth import get_credentials_from_connection_info, get_credentials_from_connection_infoV2 | ||||||
|
|
@@ -320,6 +320,7 @@ def start(self): | |||||
| logging.info("Start creation of cluster") | ||||||
| def do_creation(): | ||||||
| cluster_create_op = cluster_builder.build() | ||||||
| logging.info("Cluster creation results: %s", _print_as_json(cluster_create_op.__dict__)) | ||||||
| return cluster_create_op.result() | ||||||
| create_result = run_and_process_cloud_error(do_creation) | ||||||
| logging.info("Cluster creation finished") | ||||||
|
|
@@ -380,6 +381,7 @@ def do_creation(): | |||||
| def do_fetch(): | ||||||
| return clusters_client.managed_clusters.list_cluster_admin_credentials(resource_group, self.cluster_name) | ||||||
| get_credentials_result = run_and_process_cloud_error(do_fetch) | ||||||
| logging.info("Kubeconfig retrieved for cluster %s in %s: %s", self.cluster_name, resource_group, _print_as_json(get_credentials_result)) | ||||||
| kube_config_content = get_credentials_result.kubeconfigs[0].value.decode("utf8") | ||||||
| logging.info("Writing kubeconfig file...") | ||||||
| kube_config_path = os.path.join(os.getcwd(), "kube_config") | ||||||
|
|
@@ -440,6 +442,7 @@ def do_delete(): | |||||
| future = clusters_client.managed_clusters.begin_delete(resource_group, cluster_name) | ||||||
| return future.result() | ||||||
| delete_result = run_and_process_cloud_error(do_delete) | ||||||
| logging.info("Cluster deletion results") | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no results a this point
Suggested change
|
||||||
|
|
||||||
| # delete returns void, so we poll until the cluster is really gone | ||||||
| gone = False | ||||||
|
|
||||||
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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||||
| import dataiku | ||||||||
| import json, logging | ||||||||
| from dku_utils.cluster import get_cluster_from_dss_cluster | ||||||||
| from dku_utils.access import _is_none_or_blank | ||||||||
| from dku_utils.access import _is_none_or_blank, _print_as_json | ||||||||
| from dku_azure.utils import run_and_process_cloud_error | ||||||||
|
|
||||||||
| class MyRunnable(Runnable): | ||||||||
|
|
@@ -50,6 +50,7 @@ def do_update(): | |||||||
| cluster_update_op = clusters.managed_clusters.begin_create_or_update(resource_group, cluster_name, cluster) | ||||||||
| return cluster_update_op.result() | ||||||||
| update_result = run_and_process_cloud_error(do_update) | ||||||||
| logging.info("Cluster update results: %s", _print_as_json(update_result)) | ||||||||
| logging.info("Cluster updated") | ||||||||
|
Comment on lines
+53
to
54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant
Suggested change
|
||||||||
| return '<pre class="debug">%s</pre>' % json.dumps(update_result.as_dict(), indent=2) | ||||||||
|
|
||||||||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : I only get an empty dict on success, maybe no print in that case ?