wolkenbrot 0.3.0__tar.gz → 0.4__tar.gz

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.
Files changed (45) hide show
  1. wolkenbrot-0.4/.gitignore +106 -0
  2. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/ChangeLog +8 -0
  3. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/Makefile +7 -6
  4. wolkenbrot-0.4/PKG-INFO +242 -0
  5. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/Pipfile +3 -4
  6. wolkenbrot-0.4/Pipfile.lock +707 -0
  7. wolkenbrot-0.4/README.md +204 -0
  8. wolkenbrot-0.4/examples/libvirt.json +24 -0
  9. wolkenbrot-0.4/pyproject.toml +65 -0
  10. wolkenbrot-0.4/requirements.txt +38 -0
  11. wolkenbrot-0.4/setup.cfg +4 -0
  12. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/cli.py +12 -2
  13. wolkenbrot-0.4/wolkenbrot/libvirt.py +543 -0
  14. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/util.py +37 -6
  15. wolkenbrot-0.4/wolkenbrot.egg-info/PKG-INFO +242 -0
  16. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot.egg-info/SOURCES.txt +4 -4
  17. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot.egg-info/entry_points.txt +0 -1
  18. wolkenbrot-0.4/wolkenbrot.egg-info/requires.txt +16 -0
  19. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot.spec +9 -0
  20. wolkenbrot-0.3.0/PKG-INFO +0 -109
  21. wolkenbrot-0.3.0/Pipfile.lock +0 -433
  22. wolkenbrot-0.3.0/README.md +0 -88
  23. wolkenbrot-0.3.0/requirements.txt +0 -44
  24. wolkenbrot-0.3.0/setup.cfg +0 -43
  25. wolkenbrot-0.3.0/setup.py +0 -8
  26. wolkenbrot-0.3.0/wolkenbrot.egg-info/PKG-INFO +0 -109
  27. wolkenbrot-0.3.0/wolkenbrot.egg-info/not-zip-safe +0 -1
  28. wolkenbrot-0.3.0/wolkenbrot.egg-info/pbr.json +0 -1
  29. wolkenbrot-0.3.0/wolkenbrot.egg-info/requires.txt +0 -45
  30. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/AUTHORS +0 -0
  31. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/LICENSE +0 -0
  32. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/docs/demo.gif +0 -0
  33. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/openstack.json +0 -0
  34. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/short.json +0 -0
  35. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/template/Makefile +0 -0
  36. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/template/template.json +0 -0
  37. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/upload/bar.txt +0 -0
  38. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/examples/upload/foo.txt +0 -0
  39. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/tests/test_aws.py +0 -0
  40. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/__init__.py +0 -0
  41. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/aws.py +0 -0
  42. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/common.py +0 -0
  43. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot/os.py +0 -0
  44. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot.egg-info/dependency_links.txt +0 -0
  45. {wolkenbrot-0.3.0 → wolkenbrot-0.4}/wolkenbrot.egg-info/top_level.txt +0 -0
@@ -0,0 +1,106 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ .pytest_cache/
7
+
8
+ # vim
9
+ *.sw[o,p]
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ env/
17
+ build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib/
24
+ lib64/
25
+ parts/
26
+ sdist/
27
+ var/
28
+ wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ .hypothesis/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ target/
74
+
75
+ # Jupyter Notebook
76
+ .ipynb_checkpoints
77
+
78
+ # pyenv
79
+ .python-version
80
+
81
+ # celery beat schedule file
82
+ celerybeat-schedule
83
+
84
+ # SageMath parsed files
85
+ *.sage.py
86
+
87
+ # dotenv
88
+ .env
89
+
90
+ # virtualenv
91
+ .venv
92
+ venv/
93
+ ENV/
94
+
95
+ # Spyder project settings
96
+ .spyderproject
97
+ .spyproject
98
+
99
+ # Rope project settings
100
+ .ropeproject
101
+
102
+ # mkdocs documentation
103
+ /site
104
+
105
+ # mypy
106
+ .mypy_cache/
@@ -1,6 +1,14 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ * feat: support uploading to a directory
5
+ * fix: multiple bug fixes for libvirtd
6
+ * chore: update dependencies
7
+ * feat: support uploading directories
8
+ * Add libvirt backend and cli
9
+ * chore: update requirements.txt
10
+ * chore: update dependencies
11
+
4
12
  v0.3
5
13
  ----
6
14
 
@@ -1,6 +1,7 @@
1
1
  .PHONY: clean clean-test clean-pyc clean-build docs help
2
2
  .DEFAULT_GOAL := help
3
3
 
4
+ PIP ?= pip3
4
5
  PY ?= python3
5
6
 
6
7
  help:
@@ -54,21 +55,21 @@ docs: ## generate Sphinx HTML documentation, including API docs
54
55
 
55
56
 
56
57
  dev: clean
57
- pip3 install --only-binary :all: -e .
58
+ $(PIP) install -e .[openstack,aws,libvirt]
58
59
 
59
60
  install: clean
60
- pip3 install --only-binary :all: .
61
+ $(PIP) install .[openstack,aws,libvirt]
61
62
 
62
63
  build-exec: ## build a single file executable of wolkenbrot
63
- pip3 install --only-binary :all: .
64
+ $(PIP) install .
64
65
  pyinstaller wolkenbrot.spec
65
66
 
66
67
  build-exec-in-docker: ## build an executable with pyinstaller
67
- #docker run --rm -w /usr/src -v $(CURDIR):/usr/src/ docker.io/oz123/pyinstaller-builder:latest bash -c "make install build-exec PY=$(PY)"
68
- docker run -it --rm -w /usr/src -v $(CURDIR):/usr/src/ docker.io/oz123/pyinstaller-builder:latest bash
68
+ docker run --rm -w /usr/src -v $(CURDIR):/usr/src/ docker.io/oz123/pyinstall-builder:latest bash -c "make install build-exec PY=$(PY)"
69
+ #docker run -it --rm -w /usr/src -v $(CURDIR):/usr/src/ docker.io/oz123/pyinstall-builder:latest bash
69
70
 
70
71
  build-sdist: clean
71
- $(PY) setup.py sdist
72
+ $(PY) -m build -s
72
73
 
73
74
  pypi-release:
74
75
  twine upload sdist/wolkenbrot.tar.gz
@@ -0,0 +1,242 @@
1
+ Metadata-Version: 2.4
2
+ Name: wolkenbrot
3
+ Version: 0.4
4
+ Summary: Create and Manage AWS EC2 AMI cloud images
5
+ Author-email: Oz N Tiram <oz.tiram@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/oz123/wolkenbrot
8
+ Project-URL: Repository, https://github.com/oz123/wolkenbrot
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Topic :: Software Development
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: AUTHORS
24
+ Requires-Dist: boto3
25
+ Requires-Dist: colorama
26
+ Requires-Dist: paramiko
27
+ Provides-Extra: dev
28
+ Requires-Dist: coverage; extra == "dev"
29
+ Requires-Dist: pytest; extra == "dev"
30
+ Requires-Dist: moto; extra == "dev"
31
+ Requires-Dist: pytest-cov; extra == "dev"
32
+ Provides-Extra: openstack
33
+ Requires-Dist: openstacksdk; extra == "openstack"
34
+ Provides-Extra: libvirt
35
+ Requires-Dist: libvirt-python; extra == "libvirt"
36
+ Requires-Dist: pycdlib; extra == "libvirt"
37
+ Dynamic: license-file
38
+
39
+ # Wolkenbrot
40
+
41
+ ## bakes and manages your cloud images (AWS, OpenStack, libvirt/KVM)
42
+ ![demo](https://github.com/oz123/wolkenbrot/blob/master/docs/demo.gif?raw=true)
43
+
44
+ wolkenbrot is named after a German children's title called Wolkenbrot by
45
+ the Korean authors Baek Hee Na Kim Hyang Soo. The translation to English is
46
+ cloud's bread.
47
+
48
+ Wolken brot is inspired by packer[1] and kujenga[2], removing fabric as a
49
+ dependency. It also aims to be more tested and documented.
50
+
51
+ In case you wonder, yes it's similar to packer by Hashicorp.
52
+ But here are some reasons that you might like it better than packer:
53
+
54
+ 1. It's written in Python.
55
+ 2. It's not written in Go.
56
+ 3. It can use private AMI as a starting point for your build.
57
+ 4. It's smaller and easier to hack on.
58
+ 5. It has a cooler name.
59
+ 6. It has a better license, MIT sounds way better then MPL-2. Especially because it means "with" in German.
60
+
61
+ ### how is it different from Packer or kujenga?
62
+
63
+ 1. It is Python3 only.
64
+ 2. It does not depend on fabric.
65
+ 3. It replaces boto with boto3
66
+ 4. It's name is not Swahili, but rather German.
67
+ 5. It adds the ability to list your images
68
+ 6. It adds the ability to get detailed information about an image from the CLI.
69
+ 7. It adds the ability to de-register images from the CLI.
70
+
71
+ [1]: https://github.com/macd/kujenga
72
+ [2]: https://www.packer.io/
73
+
74
+ ### AWS Usage (default)
75
+
76
+ You can run the following command to build an image:
77
+
78
+ ```
79
+ $ wolkenbrot bake <image.json>
80
+ ```
81
+
82
+ See the documentation for the JSON format.
83
+
84
+ You can run the following command to list your existing images:
85
+
86
+ ```
87
+ $ wolkenbrot list
88
+ ```
89
+
90
+ You can view the information about and image:
91
+
92
+ ```
93
+ $ wolkenbrot info ami-72192e
94
+ ```
95
+
96
+ You can remove the image with:
97
+
98
+ ```
99
+ $ wolkenbrot delete ami-72192e
100
+ ```
101
+
102
+ Wolkenbrot follows boto3 configuration principles, so if you wonder how to
103
+ pass AWS configuration parameters, take a look in [Boto3's own documentation][2]
104
+
105
+ [3]: http://boto3.readthedocs.io/en/latest/guide/configuration.html
106
+
107
+ ### OpenStack Usage
108
+
109
+ Use the `--openstack` flag or set `"provider": "openstack"` in your JSON config:
110
+
111
+ ```
112
+ $ wolkenbrot --openstack bake <image.json>
113
+ $ wolkenbrot --openstack list
114
+ $ wolkenbrot --openstack info <image-id>
115
+ $ wolkenbrot --openstack delete <image-id>
116
+ ```
117
+
118
+ ### Libvirt/KVM Usage
119
+
120
+ Use the `--libvirt` flag or set `"provider": "libvirt"` in your JSON config:
121
+
122
+ ```
123
+ $ wolkenbrot --libvirt bake <image.json>
124
+ $ wolkenbrot --libvirt list
125
+ $ wolkenbrot --libvirt info <image-name.qcow2>
126
+ $ wolkenbrot --libvirt delete <image-name.qcow2>
127
+ ```
128
+
129
+ #### Libvirt-specific options
130
+
131
+ - `--uri` - Libvirt connection URI (default: `qemu:///system`)
132
+ - `--image-dir` - Directory for libvirt images (default: `/var/lib/libvirt/images`)
133
+
134
+ Examples:
135
+
136
+ ```
137
+ # List images in a custom directory
138
+ $ wolkenbrot --libvirt --image-dir /custom/path list
139
+
140
+ # Connect to a remote libvirt host
141
+ $ wolkenbrot --libvirt --uri qemu+ssh://user@host/system list
142
+ ```
143
+
144
+ #### Libvirt JSON configuration
145
+
146
+ Example `libvirt.json`:
147
+
148
+ ```json
149
+ {
150
+ "provider": "libvirt",
151
+ "name": "my-image",
152
+ "description": "My custom image",
153
+ "base_image": {
154
+ "path": "/var/lib/libvirt/images/ubuntu-cloud.img"
155
+ },
156
+ "output_path": "./my-image.qcow2",
157
+ "user": "ubuntu",
158
+ "memory": 4096,
159
+ "vcpus": 2,
160
+ "disk_size": "20G",
161
+ "network": "default",
162
+ "uploads": {
163
+ "./local-file": "/remote/path"
164
+ },
165
+ "commands": [
166
+ "sudo apt-get update",
167
+ "sudo apt-get install -y nginx"
168
+ ]
169
+ }
170
+ ```
171
+
172
+ Libvirt-specific configuration options:
173
+ - `region` - Libvirt connection URI (default: `qemu:///system`)
174
+ - `base_image.path` - Path to the base cloud image (qcow2 format)
175
+ - `output_path` - Where to save the final image
176
+ - `instance_type` - Predefined instance type (see table below)
177
+ - `memory` - VM memory in MB (default: 2048, overrides instance_type)
178
+ - `vcpus` - Number of virtual CPUs (default: 2, overrides instance_type)
179
+ - `disk_size` - Disk size (default: "20G", overrides instance_type)
180
+ - `network` - Libvirt network name (default: "default")
181
+
182
+ #### Instance Types
183
+
184
+ | Type | vCPUs | Memory | Disk |
185
+ |--------|-------|--------|------|
186
+ | small | 1 | 1 GB | 10G |
187
+ | medium | 2 | 4 GB | 20G |
188
+ | large | 4 | 8 GB | 40G |
189
+ | xlarge | 8 | 16 GB | 80G |
190
+
191
+ You can use `instance_type` instead of specifying `memory`, `vcpus`, and `disk_size` individually:
192
+
193
+ ```json
194
+ {
195
+ "provider": "libvirt",
196
+ "name": "my-image",
197
+ "base_image": {"path": "/var/lib/libvirt/images/ubuntu.img"},
198
+ "instance_type": "medium"
199
+ }
200
+ ```
201
+
202
+ Individual settings (`memory`, `vcpus`, `disk_size`) override the instance type defaults if both are specified.
203
+
204
+ #### Remote Libvirt Hosts
205
+
206
+ Use `region` in the config (or `--uri` CLI option) to connect to remote libvirt hosts:
207
+
208
+ ```json
209
+ {
210
+ "provider": "libvirt",
211
+ "name": "my-image",
212
+ "region": "qemu+ssh://user@remote-host/system",
213
+ "base_image": {"path": "/var/lib/libvirt/images/ubuntu.img"},
214
+ "instance_type": "large"
215
+ }
216
+ ```
217
+
218
+ Common URI formats:
219
+ - `qemu:///system` - Local system (default, requires root or libvirt group)
220
+ - `qemu:///session` - Local user session (unprivileged)
221
+ - `qemu+ssh://user@host/system` - Remote host via SSH
222
+
223
+ ### FAQ
224
+
225
+ * Do you support Windows or Mac OS X?
226
+
227
+ The author of this software strongly despises working on Windows or
228
+ Mac OS X. Hence, this software is not tested for these platforms.
229
+ If you can run Python on your OS, it might run.
230
+
231
+ * Do you support provisioning machines with Saltstack\Chef\Puppet\Ansible\XYZ?
232
+
233
+ Yes, just install them via shell first, then call the right binary with the correct playbook\state\formula..
234
+
235
+ ### Testing and Installing the test requirements
236
+
237
+ Simply issue:
238
+
239
+ ```
240
+ $ pip install -e ".[dev]"
241
+ $ make test
242
+ ```
@@ -10,7 +10,6 @@ name = "pypi"
10
10
  paramiko = "*"
11
11
  colorama = "*"
12
12
  openstacksdk = ">=0.59"
13
- cryptography = "==3.3.2"
14
-
15
- [requires]
16
- python_version = "3.7"
13
+ cryptography = "39.0.1"
14
+ libvirt-python = "*"
15
+ pycdlib = "*"