Devops in Python: Infrastructure as Python

Zadka, Moshe

  • 出版商: Apress
  • 出版日期: 2022-06-30
  • 售價: $1,930
  • 貴賓價: 9.5$1,834
  • 語言: 英文
  • 頁數: 240
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1484279956
  • ISBN-13: 9781484279953
  • 相關分類: DevOpsPython程式語言
  • 立即出貨 (庫存=1)

商品描述

Chapter 1 (Installing Python)

Different ways to install Python:

- Compiling from source

- OS packages

- pyenv

Chapter 2 (Packaging) (31 pages - 11 new pages)

How pip works and how to build packages.

The following sections need to change

Section about pip (adds 4 pages)

- Add explanation about how the resolver works

- Explain pip-compile

Poetry and pipenv (changes 2 pages, adds 2 pages)

- Needs to be separated into two sections

- Poetry section updated to reflect changes in Poetry

- Pipenv section updated to reflect changes in Pipenv

4setup.py and wheel (rewritten, changes 1 page, adds 2 pages)

- python -m build and setup.cfg

- Add details about binary wheels and manylinux

- Show a complete example

Chapter 3: Interactive usage

How to use the interactive interpreter, other text-mode interactive consoles, and Jupyter.

Chapter 4: OS Automation (16 pages - 4 new pages)

Automating OS-related things like files and processes.

Section about files (2 pages added)

- Cover using struct to parse binary data

- Cover pathlib

New section: low-level networking (2 pages) Cover socket, socket options, and how it relates

to TCP networking.

5 Chapter 5: Testing (30 pages - 10 new pages)

Writing unit tests for DevOps code.

Section about testing files (4 pages added)

- Improve performance of file testing using tmpfs and preloading libraries

- Add information about temporary directory context manager

Section about testing networking (4 pages added)

- Show how to test httpx with the WSGI support

- Show how to test low-level socket networking with DI

Section about testing processes (2 pages changed)

- Mention run and Popen

- Show how to write tests with DI on run and Popen

6 Chapter 6: Text manipulation

How to work with text: searching, modifiying, formatting, etc.

Chapter 7: Requests -> httpx (rewritten - 10 new pages)

- Focus on httpx instead

- Cover async usage

Chapter 8: Cryptography

Symmetric and asymmetric encryption and digital signatures, and how to use them in DevOps

code.

Chapter 9: Paramiko

Using paramiko to automate SSH use.

Chapter 10: Salt Stack

Using salt stack and writing new modules.

Chapter 11: Ansible

Using ansible and writing new modules.

Chapter 12: Docker (5 new pages)

- Clean up examples - they are hard to read

- Show complete example of layering, not just talk in theory

- Show complete example of running, not just talk in theory

- Add section about how to build containers for Python applications

Chapter 13: AWS

Automating AWS using the boto3 library.

New: Chapter 14: Kubernetes (10 pages)

Chapter goal: Learn how to automate k8s with Python and how to run Python applications on k8s

- Packaging Python applications for kubernetes

- Using secrets

- Thinking in Pods

- Automating k8s from Python using the REST API

- Writing k8s operators with Python

New: Chapter 15: Terraform (5 pages)

- Using the Terraform Python CDK

- Generating Terraform JSON from Python

商品描述(中文翻譯)

第1章(安裝Python)
安裝Python的不同方法:
- 從源碼編譯
- 使用作業系統套件
- 使用pyenv

第2章(封裝)(31頁 - 11頁新內容)
介紹pip的運作方式以及如何建立封裝。
以下部分需要更改:
關於pip的部分(新增4頁)
- 解釋解析器的運作原理
- 解釋pip-compile

Poetry和pipenv(更改2頁,新增2頁)
- 需要分成兩個部分
- 更新Poetry部分以反映Poetry的變化
- 更新Pipenv部分以反映Pipenv的變化

setup.py和wheel(重寫,更改1頁,新增2頁)
- python -m build和setup.cfg
- 添加有關二進制輪和manylinux的詳細信息
- 展示完整的示例

第3章:互動使用
如何使用互動解譯器、其他文字模式互動控制台和Jupyter。

第4章:操作系統自動化(16頁 - 4頁新內容)
自動化與操作系統相關的事務,如文件和進程。
關於文件的部分(新增2頁)
- 使用struct解析二進制數據
- 使用pathlib

新部分:低級網絡(2頁)
涵蓋socket、socket選項以及它們與TCP網絡的關係。

第5章:測試(30頁 - 10頁新內容)
為DevOps代碼編寫單元測試。
關於測試文件的部分(新增4頁)
- 使用tmpfs和預加載庫提高文件測試性能
- 添加有關臨時目錄上下文管理器的信息
關於測試網絡的部分(新增4頁)
- 展示如何使用WSGI支持測試httpx
- 展示如何使用DI測試低級socket網絡
關於測試進程的部分(更改2頁)
- 提及run和Popen
- 展示如何在run和Popen上使用DI編寫測試

第6章:文本操作
如何處理文本:搜索、修改、格式化等。

第7章:Requests -> httpx(重寫 - 10頁新內容)
- 專注於httpx
- 涵蓋異步使用

第8章:加密
對稱和非對稱加密、數字簽名以及如何在DevOps代碼中使用它們。

第9章:Paramiko
使用paramiko自動化SSH使用。

第10章:Salt Stack
使用salt stack並編寫新模塊。

第11章:Ansible
使用ansible並編寫新模塊。

第12章:Docker(5頁新內容)
- 清理示例 - 它們很難閱讀
- 展示完整的分層示例,而不僅僅是理論上的談話
- 展示完整的運行示例,而不僅僅是理論上的談話
- 添加有關如何為Python應用程序構建容器的部分

第13章:AWS
使用boto3庫自動化AWS。

新章節:第14章:Kubernetes(10頁)
章節目標:學習如何使用Python自動化k8s以及如何在k8s上運行Python應用程序
- 為kubernetes打包Python應用程序
- 使用密鑰
- 以Pods為思維方式
- 使用REST API從Python自動化k8s
- 使用Python編寫k8s運營商

新章節:第15章:Terraform(5頁)
- 使用Terraform Python CDK
- 從Python生成Terraform JSON

作者簡介

Moshe has been involved in the Linux community since 1998, helping in Linux "installation parties". Moshe has been programming Python since 1999 and has contributed to the core Python interpreter. Moshe has been a DevOps/SRE since before those terms existed, caring deeply about software reliability, build reproducibility, and other such things. They have worked in companies as small as three people and as big as tens of thousands - usually in someplace around where software meets system administration.

作者簡介(中文翻譯)

自1998年以來,Moshe一直參與Linux社群,協助舉辦Linux的「安裝派對」。自1999年以來,Moshe一直使用Python進行編程,並對核心Python解釋器做出了貢獻。在DevOps/SRE這些術語出現之前,Moshe就一直從事這方面的工作,對軟件可靠性、構建可重現性等方面非常關注。他曾在小至三人的公司工作,也曾在數以萬計的大公司工作,通常在軟件與系統管理相結合的領域中工作。