runbooks 0.1.2__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  """
2
- CloudOps: CloudOps Toolkit
2
+ runbooks
3
3
 
4
4
  Provides utility functions for math operations, AWS S3 interactions, and data management.
5
5
  """
6
6
 
7
- __version__ = "0.1.2"
7
+ # __version__ = "0.1.5"
8
8
 
9
- from .toolkit import add, divide, multiply, subtract
9
+ # from .toolkit import add, divide, multiply, subtract
10
10
  # from .s3 import S3Client
@@ -0,0 +1,427 @@
1
+ Metadata-Version: 2.2
2
+ Name: runbooks
3
+ Version: 0.1.5
4
+ Summary: CloudOps Automation Toolkit for DevOps and SRE teams.
5
+ Author-email: runbooks maintainers <nnthanh101@gmail.com>
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright (c) 2025, Nhat-Thanh Nguyen <nnthanh101@gmail.com>
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+
208
+ Keywords: runbooks,automation,DevOps,SRE,CloudOps
209
+ Classifier: Development Status :: 5 - Production/Stable
210
+ Classifier: Environment :: Console
211
+ Classifier: License :: OSI Approved :: Apache Software License
212
+ Classifier: Operating System :: OS Independent
213
+ Classifier: Programming Language :: Python :: 3
214
+ Classifier: Programming Language :: Python :: 3.11
215
+ Classifier: Programming Language :: Python :: 3.12
216
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
217
+ Classifier: Topic :: Utilities
218
+ Requires-Python: >=3.11
219
+ Description-Content-Type: text/markdown
220
+ Requires-Dist: requests>=2.32.3
221
+ Requires-Dist: loguru>=0.7.3
222
+ Requires-Dist: tqdm>=4.67.1
223
+ Requires-Dist: fastapi>=0.115.6
224
+ Requires-Dist: tabulate>=0.9.0
225
+ Requires-Dist: diagrams>=0.24.1
226
+ Requires-Dist: mkdocs
227
+ Requires-Dist: mkdocs-material
228
+ Requires-Dist: mkdocstrings
229
+ Requires-Dist: mkdocstrings[python]
230
+ Requires-Dist: mkdocs-drawio-exporter
231
+ Requires-Dist: mkdocs-glightbox
232
+ Requires-Dist: mkdocs-mermaid2-plugin
233
+ Requires-Dist: mkdocs-rss-plugin
234
+ Requires-Dist: pymdown-extensions
235
+ Requires-Dist: pygments
236
+ Requires-Dist: mkdocs-techdocs-core
237
+ Requires-Dist: gunicorn>=23.0.0
238
+ Requires-Dist: ipykernel>=6.29.5
239
+ Requires-Dist: ipywidgets>=8.1.5
240
+ Requires-Dist: jupyterlab>=4.3.4
241
+ Requires-Dist: jupyterlab-git>=0.50.2
242
+ Requires-Dist: boto3>=1.35.90
243
+ Requires-Dist: openai>=1.58.1
244
+ Requires-Dist: pydantic>=2.10.4
245
+ Requires-Dist: pydantic-ai>=0.0.16
246
+ Requires-Dist: openpyxl>=3.1.5
247
+ Requires-Dist: pandas>=2.2.3
248
+ Requires-Dist: plotly>=5.24.1
249
+ Requires-Dist: vizro>=0.1.30
250
+ Requires-Dist: vizro-ai>=0.3.2
251
+
252
+ # 🔥 CloudOps Automation at Scale 🦅
253
+
254
+ 🌟 You can use [CloudOps Automation Runbooks](https://cloudops.oceansoft.io), built on Jupyter Notebooks, to quickly create SRE RunBooks for Runbook Automation and Cloud Infrastructure Management! 🌐
255
+
256
+ > [!IMPORTANT]
257
+ > **🏆 Mission**: Our mission is to simplify CloudOps Automation for DevOps and SRE teams by providing an extensive, community-driven repository of actions and runbooks that streamline day-to-day operations.
258
+
259
+ > [!NOTE]
260
+ > **👁️ Vision**: Our vision is to be the 🥇 One-Stop Multi-Cloud Platform Engineering & Best Practices Solution for all CloudOps Automation needs, allowing DevOps and SRE teams to automate their workflows with ease, improve efficiency, and minimize toil.
261
+
262
+ [![🐍 Runbooks PyPI version](https://img.shields.io/pypi/v/runbooks)](https://pypi.org/project/runbooks/) ![🦾 GitHub Container Registry](https://img.shields.io/github/v/tag/nnthanh101/runbooks:latest?label=GHCR%20Version&color=blue&logo=docker)
263
+
264
+
265
+ <div align="left">
266
+ <a href="https://www.linkedin.com/in/nnthanh" target="blank"><img align="center" src="https://img.shields.io/badge/-nnthanh-blue?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/nnthanh/" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
267
+ <a href="https://github.com/nnthanh101/" target="blank"><img align="center" src="https://img.shields.io/github/followers/nnthanh101?label=Follow&style=social&link=https://github.com/nnthanh101/" alt="Thanh Nguyen" height="25" width="100" /></a>
268
+ <a href="https://www.facebook.com/groups/platformengineering" target="blank"><img align="center" src="https://img.shields.io/badge/Facebook-blue?style=flat-square&logo=facebook&logoColor=white&link=[https://www.linkedin.com/in/nnthanh/](https://www.facebook.com/groups/platformengineering)" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
269
+ </div>
270
+
271
+ ---
272
+
273
+ ## 🛠️ Features
274
+
275
+ * 🥉 ✅**Lightning-Fast Toolchain**: Powered by 📦 `uv` - Next-generation Python dependency and build management, 💅 `ruff` - Linting and formatting at blazing speed, and 🧪 pytest - Robust testing framework with coverage reports.
276
+ * 🥈 ✅**Effortless CI/CD Pipelines**: 🛠️ Taskfile Automation - Say goodbye to manual SDLC repetitive tasks, 🐳 Containerized Workflows – 🛡️ Security-first practices and Multi-stage Wolfi-based Docker builds for scalable production-ready environments, and ⚙️ Auto-publish to `PyPI` and GitHub Container Registry (`GHCR`) with GitHub Actions.
277
+ * 🥇 ☑️**CloudOps Automation and FinOps Toolkit** – Pre-configured hybrid-cloud workflows and seamlessly integrations (jupyterlab, mkdocs, boto3, moto) for managing cloud infrastructure 🌐.
278
+
279
+ | **Feature** | **Toolchain** | **Purpose** |
280
+ |--------------------------|-------------------------------------|----------------------------------------------------|
281
+ | 🛠️ Configuration | `pyproject.toml` | Centralized configuration for dependencies, testing, and linting. |
282
+ | 🧹 Task Automation | [`Taskfile`](https://taskfile.dev/) | Automates repetitive tasks like linting, testing, and publishing. |
283
+ | 📦 Python Dependencies | [`uv`](https://docs.astral.sh/uv/) | Lightning-fast dependency resolution, caching, and builds. |
284
+ | 💅 Linting & Formatting | [`ruff`](https://docs.astral.sh/ruff/) | Enforces code quality standards, auto-formatting, and import sorting. |
285
+ | 🧪 Testing Framework | [`pytest`](https://docs.pytest.org/) | Comprehensive unit tests, integration tests with coverage reporting. |
286
+ | 🐳 Docker Integration | Dockerfile + [`DevContainer`](https://containers.dev/) | Optimized wolfi-based multi-stage builds for CI/CD and local development environments. |
287
+ | 🦾 CI/CD Pipelines | [`GitHub Actions`](https://github.com/features/actions) | Automated builds, tests, and deployments to PyPI and GHCR. |
288
+ | 📝 Security Compliance | [`chainguard/wolfi-base`](https://hub.docker.com/r/chainguard/wolfi-base) + SBOM + Attestations | Ensures compliance, vulnerability scanning, and security transparency. |
289
+
290
+ ---
291
+
292
+ ### WIP
293
+
294
+ - [ ] 📚 auto doc generation
295
+ - [ ] **CLI Tools** – Typer simplifies automation for AWS resources.
296
+ - [ ] **Logging** – Loguru ensures structured logs for debugging.
297
+ - [x] 🐳 CI/CD Optimized Docker Image runs when a new *release* is created pushing to gh registry
298
+ - [x] 🦾 GitHub actions:
299
+ - [x] auto publish to [`pypi`](https://pypi.org/) on push on `main`
300
+ - [ ] auto creating a new tag on push on `main`, sync versions
301
+ - [x] run `tests` and `lint` on `dev` and `main` when a PR is open
302
+
303
+ ## 🚀 Quick Start
304
+
305
+ ### 1. Clone the Repository
306
+
307
+ ```bash
308
+ git clone https://github.com/nnthanh101/runbooks.git
309
+ cd runbooks
310
+ ```
311
+
312
+ ### 2. Install Dependencies and Run CI/CD Pipelines
313
+
314
+ ```bash
315
+ echo "Install Python dependencies using UV"
316
+ task install
317
+
318
+ echo "Run CI/CD pipeline tasks: clean, lint, format, test, and build"
319
+ task ci
320
+
321
+ echo "Publish the project package to PyPI"
322
+ task publish
323
+ ```
324
+
325
+ ### 3. Run in DevContainer 🐳
326
+
327
+ 1. Open the project in **VSCode**.
328
+ 2. Install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
329
+ 3. **Reopen in Container**:
330
+ **Command Palette `Ctrl+Shift+P` → Reopen in Container**.
331
+
332
+ ---
333
+
334
+ ## Project Structure
335
+
336
+ > 🛠 End-to-end Production-grade project structure for successful 💎 CloudOps Automation and Visual Analytics FinOps projects 🚀
337
+
338
+ ```
339
+ cloudops-automation/
340
+ ├── .devcontainer/ ## Dev Container configurations
341
+ │ └── Dockerfile ## Container image build file
342
+ ├── .github/ ## CI/CD workflows
343
+ │ ├── workflows/ ## GitHub Actions workflows
344
+ │ └── templates/ ## Workflow templates
345
+ ├── .vscode/ ## IDE-specific configurations
346
+ ├── config/ ## Configuration files (YAML, JSON)
347
+ ├── data 🔍 Where all your raw and processed data files are stored.
348
+ │ ├── external <- Data from third-party sources.
349
+ │ ├── interim <- Intermediate data that has been transformed.
350
+ │ ├── processed <- The final, canonical data sets for modeling.
351
+ │ └── raw <- The original, unprocessed, immutable data dump.
352
+
353
+ ├── docs 📓 A default mkdocs project; see mkdocs.org for details
354
+ │ ├── api/ ## API documentation
355
+ │ ├── architecture/ ## Architecture diagrams
356
+ │ ├── tutorials/ ## Tutorials and guides
357
+ │ ├── getting-started.md ## Quickstart guide
358
+ │ └── index.md ## Overview documentation
359
+
360
+ ├── logs/ ## Log files for debugging
361
+ |
362
+ ├── models 🧠 Store your trained and serialized models for easy access and versioning.
363
+
364
+ ├── notebooks 💻 Jupyter notebooks for experiments and visualization.
365
+ │ ├── data_exploration.ipynb
366
+ │ ├── data_preprocessing.ipynb
367
+ │ ├── model_training.ipynb
368
+ │ └── model_evaluation.ipynb
369
+
370
+ ├── pyproject.toml <- Project configuration file with package metadata for
371
+ │ runbooks and configuration for tools like black
372
+
373
+ ├── src/ ## 🧩 Source code for use in this project.
374
+ │ ├── runbooks/ ## Main module for CloudOps Runbooks automation
375
+ │ │ ├── __init__.py ## Package initializer
376
+ │ │ ├── calculator.py ## [Python101] Calculator
377
+ │ │ ├── config.py
378
+ │ │ ├── exceptions.py
379
+ │ │ ├── utils.py ## Utility scripts (logging, configs)
380
+ │ │ └── cleanup.py ## Cleanup automation runbook
381
+ │ ├── main.py
382
+ ├── test/ ## Unit and integration tests
383
+ │ ├── conftest.py
384
+ │ ├── __init__.py
385
+ │ ├── test_calculator.py ## [Python101] Test cases for calculator
386
+ │ ├── test_utils.py ## Test cases for utils
387
+ │ └── test_exceptions.py
388
+ ├── templates/ ## Terraform and CloudFormation templates
389
+ ├── tools/ ## Developer tools and scripts
390
+ ├── .dockerignore ## Docker ignore file
391
+ ├── .env ## Environment variables
392
+ ├── .gitignore ## Git ignore file
393
+ ├── .python-version ## Python version management
394
+ ├── .gitignore
395
+ ├── mkdocs.yml # Documentation generator configuration
396
+ ├── README.md 🤝 Explain your project and its structure for better collaboration.
397
+ ├── references <- Data dictionaries, manuals, and all other explanatory materials.
398
+
399
+ ├── reports 📊 Generated analysis (reports, charts, and plots) as HTML, PDF, LaTeX.
400
+ │ └── figures <- Generated graphics and figures to be used in reporting
401
+
402
+ ├── requirements.txt 🛠 The requirements file for reproducing the analysis environment, for easy environment setup.
403
+ └── Taskfile <- Taskfile with convenience commands like `task data` or `task train`
404
+
405
+ ```
406
+
407
+ ### [Github Container Registry to store and manage Docker and OCI images](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry)
408
+
409
+ 1. Check if the image exists in GitHub Packages:
410
+
411
+ ```
412
+ docker pull ghcr.io/nnthanh101/runbooks:latest
413
+ ```
414
+
415
+ 2. If the image doesn't exist, build and push it:
416
+
417
+ ```
418
+ docker build -t ghcr.io/nnthanh101/runbooks:latest .
419
+ docker login ghcr.io -u nnthanh -p GH_TOKEN
420
+ docker push ghcr.io/nnthanh101/runbooks:latest
421
+ ```
422
+
423
+ 3. Inspect
424
+
425
+ ```
426
+ docker inspect ghcr.io/nnthanh101/runbooks:latest
427
+ ```
@@ -0,0 +1,6 @@
1
+ runbooks/__init__.py,sha256=Jb-vD5lxcblaWaYs5u6nHRuxrPIShftR9xgDwo-xeqQ,216
2
+ runbooks-0.1.5.dist-info/METADATA,sha256=f1TLGn_GS5c6PckdyiK6Y0sSBsVlZwcTWhaYezMnyVY,24733
3
+ runbooks-0.1.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ runbooks-0.1.5.dist-info/entry_points.txt,sha256=_QeudHiRbT7oqnS32FShaOcqu03boiL5TJlFXKKYb7A,997
5
+ runbooks-0.1.5.dist-info/top_level.txt,sha256=1EwNxU12QGOLtO0Naw75hXIdSIhgV_b-z_6vhlhVkhM,9
6
+ runbooks-0.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,15 @@
1
+ [console_scripts]
2
+ create_s3_bucket = runbooks.aws.s3_create_bucket:create_bucket
3
+ delete_s3_object = runbooks.aws.s3_object_operations:delete_object
4
+ delete_unused_eips = runbooks.aws.ec2_unused_eips:delete_unused_eips
5
+ delete_unused_volumes = runbooks.aws.ec2_unused_volumes:delete_unused_volumes
6
+ dynamodb_batch_write = runbooks.aws.dynamodb_operations:batch_write_items
7
+ dynamodb_delete_item = runbooks.aws.dynamodb_operations:delete_item
8
+ dynamodb_put_item = runbooks.aws.dynamodb_operations:put_item
9
+ list_ec2_instances = runbooks.aws.ec2_describe_instances:describe_instances
10
+ list_s3_buckets = runbooks.aws.s3_list_buckets:list_s3_buckets
11
+ put_s3_object = runbooks.aws.s3_object_operations:put_object
12
+ run_ec2_instances = runbooks.aws.ec2_run_instances:run_instances
13
+ start_ec2_instances = runbooks.aws.ec2_start_stop_instances:start_instances
14
+ stop_ec2_instances = runbooks.aws.ec2_start_stop_instances:stop_instances
15
+ terminate_ec2_instances = runbooks.aws.ec2_terminate_instances:terminate_instances
@@ -0,0 +1 @@
1
+ runbooks
cloudops/toolkit.py DELETED
@@ -1,147 +0,0 @@
1
- from typing import Tuple, Union
2
-
3
- from loguru import logger
4
-
5
- ## Define a type alias for supported numeric types
6
- Number = Union[float, int]
7
-
8
-
9
- def add(a: Number, b: Number) -> float:
10
- """Compute and return the sum of two numbers.
11
-
12
- Examples:
13
- >>> add(4.0, 2.0)
14
- 6.0
15
- >>> add(4, 2)
16
- 6.0
17
-
18
- Args:
19
- a: The first number in the addition.
20
- b: The second number in the addition.
21
-
22
- Returns:
23
- float: The arithmetic sum of `a` and `b`.
24
-
25
- Raises:
26
- TypeError: If inputs are not numbers.
27
- """
28
- if not isinstance(a, (int, float)) or not isinstance(b, (int, float)):
29
- raise TypeError("Both inputs must be integers or floats.")
30
-
31
- logger.debug(f"Adding {a} + {b}")
32
- return float(a + b)
33
-
34
-
35
- def subtract(a: Number, b: Number) -> float:
36
- """Compute and return the subtraction of two numbers.
37
-
38
- Examples:
39
- >>> subtract(4.0, 2.0)
40
- 2.0
41
- >>> subtract(4, 2)
42
- 2.0
43
-
44
- Args:
45
- a: The first number in the subtraction.
46
- b: The second number in the subtraction.
47
-
48
- Returns:
49
- float: The arithmetic subtraction of `a` and `b`.
50
-
51
- Raises:
52
- TypeError: If inputs are not numbers.
53
- """
54
- if not isinstance(a, (int, float)) or not isinstance(b, (int, float)):
55
- raise TypeError("Both inputs must be integers or floats.")
56
-
57
- logger.debug(f"Subtracting {a} - {b}")
58
- return float(a - b)
59
-
60
-
61
- def multiply(a: Number, b: Number) -> float:
62
- """Compute and return the multiplication of two numbers.
63
-
64
- Examples:
65
- >>> multiply(4.0, 2.0)
66
- 8.0
67
- >>> multiply(4, 2)
68
- 8.0
69
-
70
- Args:
71
- a: The first number in the multiplication.
72
- b: The second number in the multiplication.
73
-
74
- Returns:
75
- float: The arithmetic multiplication of `a` and `b`.
76
-
77
- Raises:
78
- TypeError: If inputs are not numbers.
79
- """
80
- if not isinstance(a, (int, float)) or not isinstance(b, (int, float)):
81
- raise TypeError("Both inputs must be integers or floats.")
82
-
83
- logger.debug(f"Multiplying {a} * {b}")
84
- return float(a * b)
85
-
86
-
87
- def divide(a: Number, b: Number) -> float:
88
- """Compute and return the division of two numbers.
89
-
90
- Examples:
91
- >>> divide(4.0, 2.0)
92
- 2.0
93
- >>> divide(4, 2)
94
- 2.0
95
-
96
- Args:
97
- a: The numerator.
98
- b: The denominator.
99
-
100
- Returns:
101
- float: The result of dividing `a` by `b`.
102
-
103
- Raises:
104
- TypeError: If inputs are not numbers.
105
- ZeroDivisionError: If the denominator is zero.
106
- """
107
- if not isinstance(a, (int, float)) or not isinstance(b, (int, float)):
108
- raise TypeError("Both inputs must be integers or floats.")
109
- if b == 0:
110
- logger.error("Attempted division by zero.")
111
- raise ZeroDivisionError("division by zero")
112
-
113
- logger.debug(f"Dividing {a} / {b}")
114
- return float(a / b)
115
-
116
-
117
- def divide(a: Number, b: Number) -> float:
118
- """Compute and return the division of two numbers.
119
-
120
- Examples:
121
- >>> divide(4.0, 2.0)
122
- 2.0
123
- >>> divide(4, 2)
124
- 2.0
125
-
126
- Args:
127
- a: The numerator.
128
- b: The denominator.
129
-
130
- Returns:
131
- float: The result of dividing `a` by `b`.
132
-
133
- Raises:
134
- TypeError: If inputs are not numbers.
135
- ZeroDivisionError: If the denominator is zero.
136
- """
137
- # Input validation
138
- if not isinstance(a, (int, float)) or not isinstance(b, (int, float)):
139
- raise TypeError("Both inputs must be integers or floats.")
140
-
141
- # Handle division by zero
142
- if b == 0:
143
- raise ZeroDivisionError("division by zero")
144
-
145
- # Perform division
146
- logger.debug(f"Dividing {a} / {b}")
147
- return float(a / b)
@@ -1,181 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: runbooks
3
- Version: 0.1.2
4
- Summary: CloudOps Automation for DevOps and SRE teams.
5
- Author-email: runbooks maintainers <nnthanh101@gmail.com>
6
- Classifier: Development Status :: 4 - Beta
7
- Classifier: Environment :: Console
8
- Classifier: License :: OSI Approved :: Apache Software License
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Topic :: Documentation
14
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
- Classifier: Topic :: Utilities
16
- Requires-Python: >=3.11
17
- Description-Content-Type: text/markdown
18
- Requires-Dist: requests>=2.32.3
19
- Requires-Dist: loguru>=0.7.3
20
- Requires-Dist: typer>=0.15.1
21
- Requires-Dist: tqdm>=4.67.1
22
- Requires-Dist: boto3>=1.35.90
23
- Requires-Dist: moto>=5.0.25
24
-
25
- # 🔥 CloudOps Automation at Scale 🦅
26
-
27
- 🌟 You can use [CloudOps Automation Runbooks](https://cloudops.oceansoft.io), built on Jupyter Notebooks, to quickly create SRE RunBooks for Runbook Automation and Cloud Infrastructure Management! 🌐
28
-
29
- > [!IMPORTANT]
30
- > **🏆 Mission**: Our mission is to simplify CloudOps Automation for DevOps and SRE teams by providing an extensive, community-driven repository of actions and runbooks that streamline day-to-day operations.
31
-
32
- > [!NOTE]
33
- > **👁️ Vision**: Our vision is to be the 🥇 One-Stop Multi-Cloud Platform Engineering & Best Practices Solution for all CloudOps Automation needs, allowing DevOps and SRE teams to automate their workflows with ease, improve efficiency, and minimize toil.
34
-
35
- [![🐍 CloudOps PyPI version](https://img.shields.io/pypi/v/runbooks)](https://pypi.org/project/runbooks/)
36
-
37
- <div align="left">
38
- <a href="https://www.linkedin.com/in/nnthanh" target="blank"><img align="center" src="https://img.shields.io/badge/-nnthanh-blue?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/nnthanh/" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
39
- <a href="https://github.com/nnthanh101/" target="blank"><img align="center" src="https://img.shields.io/github/followers/nnthanh101?label=Follow&style=social&link=https://github.com/nnthanh101/" alt="Thanh Nguyen" height="25" width="100" /></a>
40
- <a href="https://www.facebook.com/groups/platformengineering" target="blank"><img align="center" src="https://img.shields.io/badge/Facebook-blue?style=flat-square&logo=facebook&logoColor=white&link=[https://www.linkedin.com/in/nnthanh/](https://www.facebook.com/groups/platformengineering)" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
41
- </div>
42
-
43
- ---
44
-
45
- ## 🛠️ Features
46
-
47
- * 🥉 ✅**Lightning-Fast Toolchain**: Powered by 📦 `uv` - Next-generation Python dependency and build management, 💅 `ruff` - Linting and formatting at blazing speed, and 🧪 pytest - Robust testing framework with coverage reports.
48
- * 🥈 ✅**Effortless CI/CD Pipelines**: 🛠️ Taskfile Automation - Say goodbye to manual SDLC repetitive tasks, 🐳 Containerized Workflows – 🛡️ Security-first practices and Multi-stage Wolfi-based Docker builds for scalable production-ready environments, and ⚙️ Auto-publish to `PyPI` and GitHub Container Registry (`GHCR`) with GitHub Actions.
49
- * 🥇 ☑️**CloudOps Automation and FinOps Toolkit** – Pre-configured hybrid-cloud workflows and seamlessly integrations (jupyterlab, mkdocs, boto3, moto) for managing cloud infrastructure 🌐.
50
-
51
- | **Feature** | **Toolchain** | **Purpose** |
52
- |--------------------------|-------------------------------------|----------------------------------------------------|
53
- | 🛠️ Configuration | `pyproject.toml` | Centralized configuration for dependencies, testing, and linting. |
54
- | 🧹 Task Automation | [`Taskfile`](https://taskfile.dev/) | Automates repetitive tasks like linting, testing, and publishing. |
55
- | 📦 Python Dependencies | [`uv`](https://docs.astral.sh/uv/) | Lightning-fast dependency resolution, caching, and builds. |
56
- | 💅 Linting & Formatting | [`ruff`](https://docs.astral.sh/ruff/) | Enforces code quality standards, auto-formatting, and import sorting. |
57
- | 🧪 Testing Framework | [`pytest`](https://docs.pytest.org/) | Comprehensive unit tests, integration tests with coverage reporting. |
58
- | 🐳 Docker Integration | Dockerfile + [`DevContainer`](https://containers.dev/) | Optimized wolfi-based multi-stage builds for CI/CD and local development environments. |
59
- | 🦾 CI/CD Pipelines | [`GitHub Actions`](https://github.com/features/actions) | Automated builds, tests, and deployments to PyPI and GHCR. |
60
- | 📝 Security Compliance | [`chainguard/wolfi-base`](https://hub.docker.com/r/chainguard/wolfi-base) + SBOM + Attestations | Ensures compliance, vulnerability scanning, and security transparency. |
61
-
62
- ---
63
-
64
- ### WIP
65
-
66
- - [ ] 📚 auto doc generation
67
- - [ ] **CLI Tools** – Typer simplifies automation for AWS resources.
68
- - [ ] **Logging** – Loguru ensures structured logs for debugging.
69
- - [x] 🐳 CI/CD Optimized Docker Image runs when a new *release* is created pushing to gh registry
70
- - [x] 🦾 GitHub actions:
71
- - [x] auto publish to [`pypi`](https://pypi.org/) on push on `main`
72
- - [ ] auto creating a new tag on push on `main`, sync versions
73
- - [x] run `tests` and `lint` on `dev` and `main` when a PR is open
74
-
75
- ## 🚀 Quick Start
76
-
77
- ### 1. Clone the Repository
78
-
79
- ```bash
80
- git clone https://github.com/nnthanh101/CloudOps.git
81
- cd CloudOps
82
- ```
83
-
84
- ### 2. Install Dependencies and Run CI/CD Pipelines
85
-
86
- ```bash
87
- echo "Install Python dependencies using UV"
88
- task install
89
-
90
- echo "Run CI/CD pipeline tasks: clean, lint, format, test, and build"
91
- task ci
92
-
93
- echo "Publish the project package to PyPI"
94
- task publish
95
- ```
96
-
97
- ### 3. Run in DevContainer 🐳
98
-
99
- 1. Open the project in **VSCode**.
100
- 2. Install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
101
- 3. **Reopen in Container**:
102
- **Command Palette `Ctrl+Shift+P` → Reopen in Container**.
103
-
104
- ---
105
-
106
- ## Project Structure
107
-
108
- > 🛠 End-to-end Production-grade project structure for successful 💎 CloudOps Automation and Visual Analytics FinOps projects 🚀
109
-
110
- ```
111
- cloudops-automation/
112
- ├── .devcontainer/ ## Dev Container configurations
113
- │ └── Dockerfile ## Container image build file
114
- ├── .github/ ## CI/CD workflows
115
- │ ├── workflows/ ## GitHub Actions workflows
116
- │ └── templates/ ## Workflow templates
117
- ├── .vscode/ ## IDE-specific configurations
118
- ├── config/ ## Configuration files (YAML, JSON)
119
- ├── data 🔍 Where all your raw and processed data files are stored.
120
- │ ├── external <- Data from third-party sources.
121
- │ ├── interim <- Intermediate data that has been transformed.
122
- │ ├── processed <- The final, canonical data sets for modeling.
123
- │ └── raw <- The original, unprocessed, immutable data dump.
124
-
125
- ├── docs 📓 A default mkdocs project; see mkdocs.org for details
126
- │ ├── api/ ## API documentation
127
- │ ├── architecture/ ## Architecture diagrams
128
- │ ├── tutorials/ ## Tutorials and guides
129
- │ ├── getting-started.md ## Quickstart guide
130
- │ └── index.md ## Overview documentation
131
-
132
- ├── logs/ ## Log files for debugging
133
- |
134
- ├── models 🧠 Store your trained and serialized models for easy access and versioning.
135
-
136
- ├── notebooks 💻 Jupyter notebooks for experiments and visualization.
137
- │ ├── data_exploration.ipynb
138
- │ ├── data_preprocessing.ipynb
139
- │ ├── model_training.ipynb
140
- │ └── model_evaluation.ipynb
141
-
142
- ├── pyproject.toml <- Project configuration file with package metadata for
143
- │ cloudops and configuration for tools like black
144
-
145
- ├── src/ ## 🧩 Source code for use in this project.
146
- │ ├── cloudops/ ## Main module for CloudOps automation
147
- │ │ ├── __init__.py ## Package initializer
148
- │ │ ├── s3.py ## S3 utility functions
149
- │ │ ├── ec2.py ## EC2 automation
150
- │ │ ├── rds.py ## RDS management
151
- │ │ ├── runbooks/ ## Automation runbooks
152
- │ │ │ ├── backup.py ## Automated backup runbook
153
- │ │ │ ├── scale-out.py ## Scale-out automation runbook
154
- │ │ │ └── cleanup.py ## Cleanup automation runbook
155
- │ ├── utils/ ## Utility scripts (logging, configs)
156
- │ ├── cli/ ## Command-line interface
157
- │ │ ├── __init__.py ## CLI module initializer
158
- │ │ ├── main.py ## CLI entry point
159
- │ │ └── commands.py ## CLI commands
160
- │ └── tests/ ## Unit and integration tests
161
- │ ├── test_s3.py ## Test cases for S3 module
162
- │ ├── test_ec2.py ## Test cases for EC2 module
163
- │ └── test_runbooks.py ## Test cases for runbooks
164
- ├── templates/ ## Terraform and CloudFormation templates
165
- ├── tools/ ## Developer tools and scripts
166
- ├── .dockerignore ## Docker ignore file
167
- ├── .env ## Environment variables
168
- ├── .gitignore ## Git ignore file
169
- ├── .python-version ## Python version management
170
- ├── .gitignore
171
- ├── mkdocs.yml # Documentation generator configuration
172
- ├── README.md 🤝 Explain your project and its structure for better collaboration.
173
- ├── references <- Data dictionaries, manuals, and all other explanatory materials.
174
-
175
- ├── reports 📊 Generated analysis (reports, charts, and plots) as HTML, PDF, LaTeX.
176
- │ └── figures <- Generated graphics and figures to be used in reporting
177
-
178
- ├── requirements.txt 🛠 The requirements file for reproducing the analysis environment, for easy environment setup.
179
- └── Taskfile <- Taskfile with convenience commands like `task data` or `task train`
180
-
181
- ```
@@ -1,6 +0,0 @@
1
- cloudops/__init__.py,sha256=ZvkZwNN6nbbXieA9fQTeCfBPNMXHasN0monrPUTWMy8,230
2
- cloudops/toolkit.py,sha256=4fICu62-eaxjaxfR8TzYpFcLSzK_m5Eoll-WayU9xrE,3650
3
- runbooks-0.1.2.dist-info/METADATA,sha256=cTuWBucHXFPXby8WxkNsgzgJJoXXJXljVS4QHJ2yQaQ,10665
4
- runbooks-0.1.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
5
- runbooks-0.1.2.dist-info/top_level.txt,sha256=DKYLN0RQdA42RbZhbFKw2kz4Id3KIqM0CeBFdof7RnQ,9
6
- runbooks-0.1.2.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- cloudops