Skip to content
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

Change API from 'Google API Client' to 'Google Cloud Python Client' #723

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pablomh
Copy link
Contributor

@pablomh pablomh commented Oct 23, 2024

According to the 'Google API Client' GH page:

This library is considered complete and is in maintenance mode. This means
that we will address critical bugs and security issues but will not add any
new features.

This library is officially supported by Google. However, the maintainers of
this repository recommend using Cloud Client Libraries for Python, where
possible, for new code development.

So change the code accordingly to adapt it to 'Google Cloud Python Client'.

@paigerube14
Copy link
Collaborator

Not sure if this is part of what you added but at the end of the scenario i got this error

2024-10-23 17:56:45,901 [INFO] Node with instance ID: prubenda-4185-c8qj7-worker-b-mqtcq has been rebooted
2024-10-23 17:56:45,902 [INFO] node_reboot_scenario has been successfuly injected!
2024-10-23 17:56:46,556 [ERROR] 'namespace'

@pablomh
Copy link
Contributor Author

pablomh commented Oct 24, 2024

Not sure if this is part of what you added but at the end of the scenario i got this error

2024-10-23 17:56:45,901 [INFO] Node with instance ID: prubenda-4185-c8qj7-worker-b-mqtcq has been rebooted
2024-10-23 17:56:45,902 [INFO] node_reboot_scenario has been successfuly injected!
2024-10-23 17:56:46,556 [ERROR] 'namespace'

I took a look and this comes from here:

namespaces.extend(krkn_lib.utils.deep_get_attribute("namespace", scenario_config))

There's no namespace in any of the example config files (nor in the one I used and probably the one you used as well), so it complains about it.

@pablomh pablomh force-pushed the google_api branch 3 times, most recently from b8521ff to 7d84e0c Compare October 25, 2024 14:17
Copy link
Collaborator

@paigerube14 paigerube14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

if response.instances:
for instance in response.instances:
if instance.name in node:
return instance
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the power shut down scenario to properly call the stop instances we need to have this funtion return both the instance name and the zone. See the previous return line

Getting error:

2024-11-01 13:53:11,827 [INFO] Error on pool multiprocessing: stop_instances() missing 1 required positional argument: 'instance_id'
2024-11-01 13:53:11,828 [ERROR] ShutDownScenarioPlugin scenario scenarios/openshift/cluster_shut_down_scenario.yml failed with exception: wait_until_stopped() missing 1 required positional argument: 'timeout'
2024-11-01 13:53:12,441 [INFO] wating 60 before running the next scenario

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablomh can you review the ^ comment when you get time please. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still hitting this issue:

2024-12-09 11:47:43,348 [INFO] Starting cluster_shut_down scenario injection
2024-12-09 11:47:43,420 [INFO] nodes type <class 'str'>
2024-12-09 11:47:43,420 [INFO] pool type<class 'list'>
2024-12-09 11:47:43,421 [INFO] Error on pool multiprocessing: stop_instances() missing 1 required positional argument: 'instance_id'
2024-12-09 11:47:43,422 [ERROR] ShutDownScenarioPlugin scenario scenarios/openshift/cluster_shut_down_scenario.yml failed with exception: wait_until_stopped() missing 1 required positional argument: 'timeout'

According to the 'Google API Client' GH page:

```
This library is considered complete and is in maintenance mode. This means
that we will address critical bugs and security issues but will not add any
new features.

This library is officially supported by Google. However, the maintainers of
this repository recommend using Cloud Client Libraries for Python, where
possible, for new code development.
```

So change the code accordingly to adapt it to 'Google Cloud Python Client'.

Signed-off-by: Pablo Méndez Hernández <[email protected]>
@paigerube14
Copy link
Collaborator

@pablomh any updates on this PR? I am hitting an issue with the node scenarios on GCP and wonder if this PR will help fix it/get around it since its using a different library

#740

@pablomh
Copy link
Contributor Author

pablomh commented Dec 10, 2024

I'll be able to keep working on it tomorrow, so keep tuned and let me know if I can help you with your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants