{"id":13647438,"url":"https://github.com/chaostoolkit-incubator/chaostoolkit-google-cloud","last_synced_at":"2025-04-22T02:31:39.555Z","repository":{"id":89502191,"uuid":"129408303","full_name":"chaostoolkit-incubator/chaostoolkit-google-cloud","owner":"chaostoolkit-incubator","description":"[DEPRECATED] Chaos Extension for the Google Cloud Engine platform","archived":true,"fork":false,"pushed_at":"2019-12-11T16:40:48.000Z","size":24,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T21:36:46.072Z","etag":null,"topics":["chaos-engineering","chaostoolkit","chaostoolkit-extension","gce","google-cloud"],"latest_commit_sha":null,"homepage":"https://chaostoolkit.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaostoolkit-incubator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-13T13:46:58.000Z","updated_at":"2023-10-09T12:46:34.000Z","dependencies_parsed_at":"2024-01-14T10:10:01.414Z","dependency_job_id":"a9b297ed-b758-405b-bc79-119fe68c42a6","html_url":"https://github.com/chaostoolkit-incubator/chaostoolkit-google-cloud","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-google-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-google-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-google-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-google-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaostoolkit-incubator","download_url":"https://codeload.github.com/chaostoolkit-incubator/chaostoolkit-google-cloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250163673,"owners_count":21385286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaos-engineering","chaostoolkit","chaostoolkit-extension","gce","google-cloud"],"created_at":"2024-08-02T01:03:33.667Z","updated_at":"2025-04-22T02:31:39.065Z","avatar_url":"https://github.com/chaostoolkit-incubator.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Chaos Toolkit Extension for Google Cloud Engine\n\n**THIS PACKAGE IS NOW DEPRECATED.** Please use the [google-cloud-platform][chaostoolkit-gcp] extension instead.\n\n[![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-google-cloud.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-google-cloud)\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-google-cloud.svg)](https://www.python.org/)\n\nThis project is a collection of [actions][] and [probes][], gathered as an\nextension to the [Chaos Toolkit][chaostoolkit]. It targets the\n[Google Cloud Engine][gce] platform.\n\n[actions]: http://chaostoolkit.org/reference/api/experiment/#action\n[probes]: http://chaostoolkit.org/reference/api/experiment/#probe\n[chaostoolkit]: http://chaostoolkit.org\n[gce]: https://cloud.google.com/compute/\n[chaostoolkit-gcp]: https://github.com/chaostoolkit-incubator/chaostoolkit-google-cloud-platform\n\n## Install\n\nThis package requires Python 3.5+\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n```\n$ pip install -U chaostoolkit-google-cloud\n```\n\n## Usage\n\nTo use the probes and actions from this package, add the following to your\nexperiment file:\n\n```json\n{\n    \"type\": \"action\",\n    \"name\": \"swap-nodepool-for-a-new-one\",\n    \"provider\": {\n        \"type\": \"python\",\n        \"module\": \"chaosgce.nodepool.actions\",\n        \"func\": \"swap_nodepool\",\n        \"secrets\": [\"gce\"],\n        \"arguments\": {\n            \"body\": {\n                \"nodePool\": {\n                    \"config\": { \n                        \"oauthScopes\": [\n                            \"gke-version-default\",\n                            \"https://www.googleapis.com/auth/devstorage.read_only\",\n                            \"https://www.googleapis.com/auth/logging.write\",\n                            \"https://www.googleapis.com/auth/monitoring\",\n                            \"https://www.googleapis.com/auth/service.management.readonly\",\n                            \"https://www.googleapis.com/auth/servicecontrol\",\n                            \"https://www.googleapis.com/auth/trace.append\"\n                        ]\n                    },\n                    \"initialNodeCount\": 3,\n                    \"name\": \"new-default-pool\"\n                }\n            }\n        }\n    }\n}\n```\n\nThat's it!\n\nPlease explore the code to see existing probes and actions.\n\n\n## Configuration\n\n### Project and Cluster Information\n\nYou can pass the context via the `configuration` section of your experiment:\n\n```json\n{\n    \"configuration\": {\n        \"gce_project_id\": \"...\",\n        \"gce_cluster_name\": \"...\",\n        \"gce_region\": \"...\",\n        \"gce_zone\": \"...\"\n    }\n}\n```\n\nNote that most functions exposed in this package also take those values\ndirectly when you want specific values for them.\n\n### Credentials\n\nThis extension expects a [service account][sa] with enough permissions to\nperform its operations. Please create such a service account manually (do not\nuse the default one for your cluster if you can, so you'll be able to delete\nthat service account if need be).\n\n[sa]: https://developers.google.com/api-client-library/python/auth/service-accounts#creatinganaccount\n\nOnce you have created your service account, either keep the file on the same\nmachine where you will be running the experiment from. Or, pass its content\nas part of the `secrets` section, although this is not recommended because your\nsensitive data will be quite visible.\n\nHere is the first way:\n\n```json\n{\n    \"secrets\": {\n        \"gce\": {\n            \"service_account_file\": \"/path/to/sa.json\"\n        }\n    }\n}\n```\n\nWhile the embedded way looks like this:\n\n\n```json\n{\n    \"secrets\": {\n        \"gce\": {\n            \"service_account_info\": {\n                \"type\": \"service_account\",\n                \"project_id\": \"...\",\n                \"private_key_id\": \"...\",\n                \"private_key\": \"...\",\n                \"client_email\": \"...\",\n                \"client_id\": \"...\",\n                \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n                \"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n                \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n                \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/....\"\n            }\n        }\n    }\n}\n```\n\n\n### Putting it all together\n\nHere is a full example:\n\n```json\n{\n    \"version\": \"1.0.0\",\n    \"title\": \"...\",\n    \"description\": \"...\",\n    \"configuration\": {\n        \"gce_project_id\": \"...\",\n        \"gce_cluster_name\": \"...\",\n        \"gce_region\": \"...\",\n        \"gce_zone\": \"...\"\n    },\n    \"secrets\": {\n        \"gce\": {\n            \"service_account_file\": \"/path/to/sa.json\"\n        }\n    },\n    \"method\": [\n        {\n            \"type\": \"action\",\n            \"name\": \"swap-nodepool-for-a-new-one\",\n            \"provider\": {\n                \"type\": \"python\",\n                \"module\": \"chaosgce.nodepool.actions\",\n                \"func\": \"swap_nodepool\",\n                \"secrets\": [\"gce\"],\n                \"arguments\": {\n                    \"body\": {\n                        \"nodePool\": {\n                            \"config\": { \n                                \"oauthScopes\": [\n                                    \"gke-version-default\",\n                                    \"https://www.googleapis.com/auth/devstorage.read_only\",\n                                    \"https://www.googleapis.com/auth/logging.write\",\n                                    \"https://www.googleapis.com/auth/monitoring\",\n                                    \"https://www.googleapis.com/auth/service.management.readonly\",\n                                    \"https://www.googleapis.com/auth/servicecontrol\",\n                                    \"https://www.googleapis.com/auth/trace.append\"\n                                ]\n                            },\n                            \"initialNodeCount\": 3,\n                            \"name\": \"new-default-pool\"\n                        }\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please, fork this project, make your changes following the\nusual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\n\n### Develop\n\nIf you wish to develop on this project, make sure to install the development\ndependencies. But first, [create a virtual environment][venv] and then install\nthose dependencies.\n\n[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment\n\n```console\n$ pip install -r requirements-dev.txt -r requirements.txt \n```\n\nThen, point your environment to this directory:\n\n```console\n$ python setup.py develop\n```\n\nNow, you can edit the files and they will be automatically be seen by your\nenvironment, even when running from the `chaos` command locally.\n\n### Test\n\nTo run the tests for the project execute the following:\n\n```\n$ pytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-google-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-google-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-google-cloud/lists"}