genesis-devtools 0.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. genesis_devtools-0.0.4/.github/workflows/publish-to-pypi.yml +97 -0
  2. genesis_devtools-0.0.4/.github/workflows/tests.yml +58 -0
  3. genesis_devtools-0.0.4/AUTHORS +1 -0
  4. genesis_devtools-0.0.4/ChangeLog +7 -0
  5. genesis_devtools-0.0.4/LICENSE +201 -0
  6. genesis_devtools-0.0.4/PKG-INFO +263 -0
  7. genesis_devtools-0.0.4/README.md +229 -0
  8. genesis_devtools-0.0.4/genesis/genesis.yaml +29 -0
  9. genesis_devtools-0.0.4/genesis/images/install.sh +47 -0
  10. genesis_devtools-0.0.4/genesis_devtools/__init__.py +0 -0
  11. genesis_devtools-0.0.4/genesis_devtools/builder/__init__.py +17 -0
  12. genesis_devtools-0.0.4/genesis_devtools/builder/base.py +196 -0
  13. genesis_devtools-0.0.4/genesis_devtools/builder/builder.py +108 -0
  14. genesis_devtools-0.0.4/genesis_devtools/builder/dependency.py +125 -0
  15. genesis_devtools-0.0.4/genesis_devtools/builder/packer.py +201 -0
  16. genesis_devtools-0.0.4/genesis_devtools/cmd/__init__.py +0 -0
  17. genesis_devtools-0.0.4/genesis_devtools/cmd/cli.py +390 -0
  18. genesis_devtools-0.0.4/genesis_devtools/constants.py +33 -0
  19. genesis_devtools-0.0.4/genesis_devtools/libvirt.py +346 -0
  20. genesis_devtools-0.0.4/genesis_devtools/logger.py +78 -0
  21. genesis_devtools-0.0.4/genesis_devtools/packer/genesis_core/genesis-core.pkr.hcl +110 -0
  22. genesis_devtools-0.0.4/genesis_devtools/packer/genesis_core/plugins.pkr.hcl +12 -0
  23. genesis_devtools-0.0.4/genesis_devtools/packer/ubuntu_24/plugins.pkr.hcl +12 -0
  24. genesis_devtools-0.0.4/genesis_devtools/packer/ubuntu_24/ubuntu-24.pkr.hcl +118 -0
  25. genesis_devtools-0.0.4/genesis_devtools/tests/__init__.py +0 -0
  26. genesis_devtools-0.0.4/genesis_devtools/tests/unit/__init__.py +0 -0
  27. genesis_devtools-0.0.4/genesis_devtools/tests/unit/conftest.py +69 -0
  28. genesis_devtools-0.0.4/genesis_devtools/tests/unit/test_basic.py +20 -0
  29. genesis_devtools-0.0.4/genesis_devtools/tests/unit/test_builder.py +45 -0
  30. genesis_devtools-0.0.4/genesis_devtools/tests/unit/test_dependency.py +85 -0
  31. genesis_devtools-0.0.4/genesis_devtools/tests/unit/test_packer.py +34 -0
  32. genesis_devtools-0.0.4/genesis_devtools/utils.py +166 -0
  33. genesis_devtools-0.0.4/genesis_devtools.egg-info/PKG-INFO +263 -0
  34. genesis_devtools-0.0.4/genesis_devtools.egg-info/SOURCES.txt +44 -0
  35. genesis_devtools-0.0.4/genesis_devtools.egg-info/dependency_links.txt +1 -0
  36. genesis_devtools-0.0.4/genesis_devtools.egg-info/entry_points.txt +2 -0
  37. genesis_devtools-0.0.4/genesis_devtools.egg-info/not-zip-safe +1 -0
  38. genesis_devtools-0.0.4/genesis_devtools.egg-info/pbr.json +1 -0
  39. genesis_devtools-0.0.4/genesis_devtools.egg-info/requires.txt +6 -0
  40. genesis_devtools-0.0.4/genesis_devtools.egg-info/top_level.txt +1 -0
  41. genesis_devtools-0.0.4/requirements.txt +6 -0
  42. genesis_devtools-0.0.4/setup.cfg +37 -0
  43. genesis_devtools-0.0.4/setup.py +20 -0
  44. genesis_devtools-0.0.4/test-requirements.txt +6 -0
  45. genesis_devtools-0.0.4/tox.ini +54 -0
@@ -0,0 +1,97 @@
1
+ name: Publish Python 🐍 distribution 📦 to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution 📦
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ persist-credentials: false
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Install pypa/build
22
+ run: >-
23
+ python3 -m
24
+ pip install
25
+ build
26
+ --user
27
+ - name: Build a binary wheel and a source tarball
28
+ run: python3 -m build
29
+ - name: Store the distribution packages
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: python-package-distributions
33
+ path: dist/
34
+
35
+ publish-to-pypi:
36
+ name: >-
37
+ Publish Python 🐍 distribution 📦 to PyPI
38
+ needs:
39
+ - build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/genesis-devtools
44
+ permissions:
45
+ id-token: write # IMPORTANT: mandatory for trusted publishing
46
+
47
+ steps:
48
+ - name: Download all the dists
49
+ uses: actions/download-artifact@v4
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+ - name: Publish distribution 📦 to PyPI
54
+ uses: pypa/gh-action-pypi-publish@release/v1
55
+
56
+ github-release:
57
+ name: >-
58
+ Sign the Python 🐍 distribution 📦 with Sigstore
59
+ and upload them to GitHub Release
60
+ needs:
61
+ - publish-to-pypi
62
+ runs-on: ubuntu-latest
63
+
64
+ permissions:
65
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
66
+ id-token: write # IMPORTANT: mandatory for sigstore
67
+
68
+ steps:
69
+ - name: Download all the dists
70
+ uses: actions/download-artifact@v4
71
+ with:
72
+ name: python-package-distributions
73
+ path: dist/
74
+ - name: Sign the dists with Sigstore
75
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
76
+ with:
77
+ inputs: >-
78
+ ./dist/*.tar.gz
79
+ ./dist/*.whl
80
+ - name: Create GitHub Release
81
+ env:
82
+ GITHUB_TOKEN: ${{ github.token }}
83
+ run: >-
84
+ gh release create
85
+ "$GITHUB_REF_NAME"
86
+ --repo "$GITHUB_REPOSITORY"
87
+ --notes ""
88
+ - name: Upload artifact signatures to GitHub Release
89
+ env:
90
+ GITHUB_TOKEN: ${{ github.token }}
91
+ # Upload to GitHub Release using the `gh` CLI.
92
+ # `dist/` contains the built packages, and the
93
+ # sigstore-produced signatures and certificates.
94
+ run: >-
95
+ gh release upload
96
+ "$GITHUB_REF_NAME" dist/**
97
+ --repo "$GITHUB_REPOSITORY"
@@ -0,0 +1,58 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ Lint:
9
+ runs-on: ubuntu-24.04
10
+ strategy:
11
+ fail-fast: true
12
+ matrix:
13
+ python-version: ["3.12"]
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - name: Set up Python ${{ matrix.python-version }}
17
+ uses: actions/setup-python@v3
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install tox
21
+ run: sudo apt update && sudo apt install --yes tox
22
+ - name: Black
23
+ run: |
24
+ tox -e black-check
25
+ Tests:
26
+ runs-on: ubuntu-24.04
27
+ strategy:
28
+ fail-fast: true
29
+ matrix:
30
+ python-version: ["3.8", "3.10", "3.12", "3.13"]
31
+ steps:
32
+ - uses: actions/checkout@v3
33
+ - name: Set up Python ${{ matrix.python-version }}
34
+ uses: actions/setup-python@v3
35
+ with:
36
+ python-version: ${{ matrix.python-version }}
37
+ - name: Install tox
38
+ run: sudo apt update && sudo apt install --yes tox
39
+ - name: Unit tests
40
+ run: |
41
+ tox -e ${{ matrix.python-version }}
42
+ Coverage:
43
+ runs-on: ubuntu-24.04
44
+ strategy:
45
+ fail-fast: true
46
+ matrix:
47
+ python-version: ["3.12"]
48
+ steps:
49
+ - uses: actions/checkout@v3
50
+ - name: Set up Python ${{ matrix.python-version }}
51
+ uses: actions/setup-python@v3
52
+ with:
53
+ python-version: ${{ matrix.python-version }}
54
+ - name: Install tox
55
+ run: sudo apt update && sudo apt install --yes tox
56
+ - name: Coverage
57
+ run: |
58
+ tox -e begin,${{ matrix.python-version }},end
@@ -0,0 +1 @@
1
+ Anton Kremenetsky <anton.kremenetsky@gmail.com>
@@ -0,0 +1,7 @@
1
+ CHANGES
2
+ =======
3
+
4
+ 0.0.4
5
+ -----
6
+
7
+ * Added different launch nodes for element, core and custom installation (#22)
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.2
2
+ Name: genesis-devtools
3
+ Version: 0.0.4
4
+ Summary: Tools to manager life cycle of Genesis projects.
5
+ Home-page: https://github.com/infraguys/genesis_devtools
6
+ Author: Genesis Corporation
7
+ Author-email: anton.kremenetsky@gmail.com
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: pbr<5.8.1,>=1.10.0
21
+ Requires-Dist: click<9.0.0,>=8.1.7
22
+ Requires-Dist: pyyaml<7.0.0,>=6.0.0
23
+ Requires-Dist: prettytable<4.0.0,>=3.7.0
24
+ Requires-Dist: GitPython<4.0.0,>=3.1.30
25
+ Requires-Dist: bazooka<2.0.0,>=1.0.0
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: home-page
31
+ Dynamic: requires-dist
32
+ Dynamic: summary
33
+
34
+ ![Tests workflow](https://github.com/infraguys/genesis_devtools/actions/workflows/tests.yml/badge.svg)
35
+
36
+ # Genesis Dev Tools
37
+
38
+ The tools to manager life cycle of genesis projects
39
+
40
+ # Requirements
41
+
42
+ Before you can install and use genesis tools you need to install several requirements:
43
+ - [packer](https://www.packer.io/)
44
+ - [libvirt](https://libvirt.org/)
45
+ - [qemu](https://www.qemu.org/)
46
+
47
+ ## Ubuntu
48
+
49
+ Install packages
50
+ ```sh
51
+ sudo apt update
52
+ sudo apt install qemu-kvm libvirt-daemon-system libvirt-dev mkisofs
53
+ ```
54
+
55
+ Add user to group
56
+ ```sh
57
+ sudo adduser $USER libvirt
58
+ sudo adduser $USER kvm
59
+ ```
60
+
61
+ Install packer like described in [this article](https://yandex.cloud/ru/docs/tutorials/infrastructure-management/packer-quickstart#from-y-mirror)
62
+
63
+ # Install
64
+
65
+ To install the `genesis-devtools` package, follow these steps:
66
+
67
+ 1. Clone the repository:
68
+ ```sh
69
+ git clone https://github.com/infraguys/genesis_devtools.git
70
+ ```
71
+
72
+ 2. Navigate to the project directory:
73
+ ```sh
74
+ cd genesis_devtools
75
+ ```
76
+
77
+ 3. Install the required dependencies:
78
+ ```sh
79
+ pip install -r requirements.txt
80
+ ```
81
+
82
+ 4. Install the package using pip:
83
+ ```sh
84
+ pip install .
85
+ ```
86
+
87
+ # Quickstart
88
+
89
+ ## Build
90
+ Firstly you need to build the genesis project. Navigate to your project directory and run the genesis build command, specifying the path to your project root directory as an argument. This will build the project according to the configuration defined in the `genesis.yaml` file.
91
+
92
+ Here are some examples of how to use the build command:
93
+ ```sh
94
+ genesis build /path/to/my/project
95
+ ```
96
+
97
+ There are some useful options for the genesis build command.
98
+ - Build a Genesis project with a custom developer key path:
99
+ ```sh
100
+ genesis build -i /path/to/my/developer/key /path/to/my/project
101
+ ```
102
+
103
+ - Build a Genesis project with the --force option to rebuild if the output already exists:
104
+ ```sh
105
+ genesis build -f /path/to/my/project
106
+ ```
107
+
108
+ Look at the `genesis build --help` command for more options.
109
+
110
+ ## Bootstrap
111
+
112
+ To bootstrap a Genesis installation locally, use the genesis bootstrap command. This command creates and boots a virtual machine with the specified Genesis image.
113
+
114
+ One of the key options for the bootstrap command is `--launch-mode`, which allows you to specify the launch mode for the application. There are three available modes:
115
+
116
+ - `element`: This is the default mode, which launches the installation as a single element.
117
+ - `core`: This mode launches the installation as a core.
118
+ - `custom`: This mode allows you to launch the installation with a custom configuration.
119
+
120
+ Here are some examples of how to use the `--launch-mode` option:
121
+ ```sh+
122
+ genesis bootstrap -i output/genesis-element.raw
123
+ ```
124
+
125
+ Launch the installation in `core` mode:
126
+ ```sh
127
+ genesis bootstrap -i output/genesis-core.raw -m core
128
+ ```
129
+
130
+ # Usage
131
+
132
+ The package provides a command line interface for building genesis projects, managing genesis installations and cover many other useful aspects. To use the command line interface, run the `genesis` command from the command line. For full documentation about CLI commands, run `genesis --help`.
133
+
134
+ For every genesis project the directory `genesis` should exist in the project root. The project configuration file should be named `genesis.yaml` in this directory. For example my project structure looks like this:
135
+
136
+ ```sh
137
+ .
138
+ ├── my_project
139
+ │ └── main.py
140
+ ├── project_settings.json
141
+ ├── requirements.txt
142
+ ├── setup.cfg
143
+ ├── setup.py
144
+ └── README.md
145
+ ```
146
+
147
+ The project should be extended as follows:
148
+
149
+ ```sh
150
+ .
151
+ ├── my_project
152
+ │ └── main.py
153
+ ├── genesis
154
+ │ └── genesis.yaml
155
+ ├── README.md
156
+ ├── project_settings.json
157
+ ├── requirements.txt
158
+ ├── setup.cfg
159
+ ├── setup.py
160
+ └── README.md
161
+ ```
162
+
163
+ ## Genesis configuration file
164
+
165
+ The `genesis.yaml` file contains the configuration for the genesis project. It should be placed in the `genesis` directory. It consists of several sections such as build, deploy, etc.
166
+
167
+ Example of the `genesis.yaml` file:
168
+
169
+ ```yaml
170
+ # Build section. It describes the build process of the project.
171
+ build:
172
+ # Dependencies of the project
173
+ # This section is used to specify build dependencies
174
+ # for the project
175
+ deps:
176
+ # Target path in the image
177
+ - dst: /opt/genesis_core
178
+ # Local path of the build machine
179
+ path:
180
+ src: ../../genesis_core
181
+
182
+ # This section describes elements of the project.
183
+ # Images, artifacts and manifests for every element.
184
+ elements:
185
+ # List of images in the element
186
+ - images:
187
+ - name: genesis-core
188
+ format: raw
189
+
190
+ # OS profile for the image
191
+ profile: ubuntu_24
192
+
193
+ # Provisioning script
194
+ script: images/install.sh
195
+
196
+ # Override image build parameters, for instance Packer parameters
197
+ override:
198
+ disk_size: "10G"
199
+
200
+ manifest: manifests/genesis-core.yaml
201
+
202
+ # List of artifacts in the element
203
+ artifacts:
204
+ - configs/my-cofig.yaml
205
+ - templates/my-template.yaml
206
+ ```
207
+
208
+ ## Build project
209
+
210
+ The `genesis build` command builds the project. The build process is described in the `build` section of the `genesis.yaml` file. The mandatory argument is path to the project root directory.
211
+
212
+ Build a Genesis project.
213
+ ```sh
214
+ genesis build my_project
215
+ ```
216
+
217
+ This will build the Genesis project in the `my_project` directory using the default configuration file will be located in `my_project/genesis/genesis.yaml`.
218
+
219
+ After build the project output artifacts will be stored in the `output` directory.
220
+ For detailed information about the `genesis build` command run `genesis build --help`.
221
+
222
+ ## Manager Genesis installation locally
223
+
224
+ To bootstrap genesis installation locally, run the `genesis bootstrap` command. The mandatory argument is path to the genesis image. For instance,
225
+
226
+ ```sh
227
+ genesis bootstrap output/genesis-core.raw
228
+ ```
229
+
230
+ This command will create and boot a virtual machine with the specified genesis image `output/genesis-core.raw`. The default name of the installation is `genesis-core`. For detailed information about the `genesis bootstrap` command run `genesis bootstrap --help`.
231
+
232
+ To connect to the genesis installation, run the `genesis ssh` command. For instance,
233
+ ```sh
234
+ genesis ssh
235
+ ```
236
+
237
+ To list genesis installations, run the `genesis ps` command. For instance,
238
+
239
+ ```sh
240
+ genesis ps
241
+ ```
242
+
243
+ To delete genesis installation, run the `genesis delete` command. For instance,
244
+
245
+ ```sh
246
+ genesis delete genesis-core
247
+ ```
248
+
249
+ ## Versions
250
+
251
+ Semver is used for project versioning. There are three types of versions:
252
+ - stable version - format `X.Y.Z`
253
+ - release candidate version - format `X.Y.Z-rc+YYYYMMDDHHMMSS.commit_hash[:8]`
254
+ - development version - format `X.Y.Z-dev+YYYYMMDDHHMMSS.commit_hash[:8]`
255
+
256
+ Stable version looks like `1.0.0`, only three digits. Release candidate version looks like `0.0.1-rc+20250224092842.e11604e9`. Development version looks like `0.0.1-dev+20250223180245.fb195339`.
257
+
258
+ To get project version, run the `genesis get-version` with path to the project root directory as an argument to the command. For instance,
259
+
260
+ ```sh
261
+ genesis get-version /path/to/my_project
262
+ ```
263
+