Skip to main content

Genesis CI Tools.

Project description

Genesis CI Tools

Helpful tools for Continuous Integration (CI) of Genesis projects. The tools are based on CLI utilities that simplify interacting with the Genesis installation. The main command is genesis-ci. It allows to create nodes, configs and other entities in the Genesis installations. For example, the genesis-ci nodes list command will list all nodes in the Genesis installation. genesis-ci --help will show all available commands.

📦 Installation

Install required packages:

Ubuntu:

sudo apt-get install libev-dev

Fedora:

sudo dnf install libev-devel

Initialize virtual environment with the package:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .

🚀 Usage

After installation the genesis-ci command will be available in the terminal. For example, genesis-ci nodes list will list all nodes in the Genesis installation. Below you can find most useful commands:

Create nodes with specified parameters:

genesis-ci -e http://127.0.0.1:11010 -u test -p test nodes add \
    --project-id 00000000-0000-0000-0000-000000000000 \
    --image "http://10.20.0.1:8080/genesis-base.raw" \
    --cores 4 \
    --ram 8192 \
    --root-disk 20 \
    --name "my-node"

List nodes:

genesis-ci -e http://127.0.0.1:11010 -u test -p test nodes list

List configs:

genesis-ci -e http://127.0.0.1:11010 -u test -p test configs list

Delete node:

genesis-ci -e http://127.0.0.1:11010 -u test -p test nodes delete 00000000-0000-0000-0000-000000000001

Configs from environment variables

One of the useful feature that need more explanation is the ability to create configs for nodes from environment variables. For this purpose we have genesis-ci configs add-from-env command. There are two formats of configurations that can be used to delivered to the node:

  • As environment variables
  • As plain text

In the environment variable all values should be placed in single file by path --env-path. To detect such variables the --env-prefix prefix will be used. The default value for this variable is GCT_ENV_. For example, if we have the variable GCT_ENV_FOO=bar it will be add to the config as FOO=bar on the node.

export GCT_ENV_FOO=bar

genesis-ci -e http://127.0.0.1:11010 -u test -p test configs add-from-env \
    --project-id <project-uuid> \
    <node-uuid>

# ... On the node ...

cat /var/lib/genesis/app.env

FOO=bar

Where /var/lib/genesis/app.env is default path. There are two supported formats for the env file: env and json, use option --env-format to set the format.

In the plain text we need to specify at least two variables for path and content.

export GCT_CFG_TEXT_FOO='My content!'
export GCT_CFG_PATH_FOO=/home/my-user/config.txt

genesis-ci -e http://127.0.0.1:11010 -u test -p test configs add-from-env \
    --project-id <project-uuid> \
    <node-uuid>

# ... On the node ...

cat /home/my-user/config.txt

My content!

--cfg-prefix set the prefix for config variables. The default value is GCT_CFG_. Also the content can be decoded from base64. Use --base64 flag to enable it.

💡 Contributing

Contributing to the project is highly appreciated! However, some rules should be followed for successful inclusion of new changes in the project:

  • All changes should be done in a separate branch.
  • Changes should include not only new functionality or bug fixes, but also tests for the new code.
  • After the changes are completed and tested, a Pull Request should be created with a clear description of the new functionality. And add one of the project maintainers as a reviewer.
  • Changes can be merged only after receiving an approve from one of the project maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genesis_ci_tools-0.3.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genesis_ci_tools-0.3.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file genesis_ci_tools-0.3.0.tar.gz.

File metadata

  • Download URL: genesis_ci_tools-0.3.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genesis_ci_tools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 377480d234370ffe9a17075ec4d49421b055cc8a7b6eb25039f45b83ccf3b31d
MD5 bec02d339a6e9a63c9f275802c8cf238
BLAKE2b-256 fb424c3053828a38f79831ac68f27d07fd700ebce007298c02abbd010d1e785c

See more details on using hashes here.

Provenance

The following attestation bundles were made for genesis_ci_tools-0.3.0.tar.gz:

Publisher: publish-to-pypi.yml on infraguys/genesis_ci_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genesis_ci_tools-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for genesis_ci_tools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4958f3b65c272cbb1b0cc4a2a06ca1db0099c9f7cd6e5b4b1d4cb0b21b7d980f
MD5 80c627ff9e2d75a158ecf93a2762ef2e
BLAKE2b-256 fc315d5ed79672ea49237d3a847465ba43731e9e9a598fca9b7ac67caf9478d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for genesis_ci_tools-0.3.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on infraguys/genesis_ci_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page