Genkidama is a pure-python library that: Enables developers to write a wide variety of distributed programs, and allows mantainers to easily setup highly-heterogeneous computer clusters.
Project description
Genkidama
Genkidama is a pure-python library that:
- Enables developers to write a wide variety of distributed programs (to scale compute, to manage a large fleet of computers, to troll your friends, ...) with very few extra lines of code on top of what a locally running script would require.
- Allows system maintainers to easily setup highly-heterogeneous computer clusters (comprised of any platform that can run python) in minutes.
This README
This README gives a general description of the Genkidama library. The intent is to clarify the scope of the project and to get the end-user up and running using the library; therefore it is no in-depth tutorial or detailed API reference, for that have a look at the relevant resources (TODO write these resources).
Throughout the rest of this README some domain specific terminology is used, check out the Glossary at the end of this readme for definitions of these terms.
A Word of Caution
Genkidama allows arbitrary code execution in remote machines, as such it presents a major security pitfall if extreme caution is not exercised; in addition, at the current state Genkidama does not authenticate connections and runs all communications unencrypted, therefore this software should only ever be deployed in networks that are absolutely hermetic (such as LAN or even virtual LAN) with parties that are completely trusted.
Note that the risk is not only involved with the Donors that execute arbitrary code, but also with the Kaios that receive data produced by these Donors if they wrongly trust data and, for instance, unpickle malware infected objects or outright execute code packaged in this data.
Quick Start
Installation
At the time being (and as long as there is no significant architectural change) there is a single distribution of Genkidama, which is distributed as a PyPI source distribution (sdist) package:
pip install genkidama
This distribution is targeted for every usecase this library covers (and in particular for developers and system maintainers).
Quick Setup
The first order of business is to establish a connection between a Kaio and a Donor, this can be accomplished in several ways depending on the network that connects both, but in the most simple and general case the Donor will run a server listening for a TCP connection in a given port (default port is 9000!) and a Kaio client will connect to it therefore establishing a TCP connection.
Note that the client and server roles have no fundamental relation to the Kaio and Donor roles, the first set of roles (client/server) only determines how the connection is established (who listens vs who calls), whereas the second set of roles (Kaio/Donor) determines the protocol and the dynamics of the session (who makes requests vs who executes requests); it is therefore entirely possible to have the Kaio act as the server and the Donor as the client, which in fact will be interesting in some cases where the Donor is behind a firewall.
In any case, and for the sake of brevity, in the following we stick to the standard client-Kaio and server-Donor setup.
Donor Server Setup
With genkidama installed, simply run in a shell:
genkidama <bind_address>
where <bind_address> is the IP address* to which you want to bind the server socket, for example localhost if you want to use/test the library locally (recommended), or 192.168.X.XXX if you want to connect from a client in the same LAN. You can also supply more arguments such as -p PORT for the server to listen in a specific port (instead of the default). Check out all the available arguments running genkidama -h.
This command is simply an alias for python -m genkidama, which you can also use if you prefer, and starts a server listening on the given bind_address and PORT immediately. By default the logging level is INFO, so you will mostly only see messages when Kaios connect and disconnect; change the log level with --log-level LEVEL.
*So far only IPv4 is supported through this interface.
Kaio Client Setup
To connect to a running Donor server as a Kaio client from a python script or interactive terminal/notebook, run the following
from genkidama import connect_to_session
session = connect_to_session(donor_IP_address)
where donor_IP_address is a string with the IP address of the donor server. If the server is reachable, it will return a GenkidamaSession object which can be used to interact with the Donor and make execution requests. For instance, to run a simple echo example do
proc = session.execute("print(input())")
proc.stdin.write("Hello World\n".encode())
proc.wait()
proc_output = proc.stdout.read().decode()
print(proc_output)
which should just print Hello World on your Kaio, however observe that this data was produced in the Donor as a consequence of the input data that the Kaio forwarded to the Donor in the first place, which finally forwards the produced data back to the Kaio (which is the same as the input data in this echo example).
Glossary
- Kaio: Term to refer to the machine/system/software sending out requests to the Donors for execution and collecting the results of the executed processes.
- Donor: Term to refer to the machines receiving requests from one or more Kaios and doing the actual work.
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
File details
Details for the file genkidama-0.0.6.tar.gz.
File metadata
- Download URL: genkidama-0.0.6.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e3e4200c3ae88dede4c106e9291fb0736aec970bc6d947e64ebc8dcfa2c6bf6
|
|
| MD5 |
185f6ddf9272a89a09737b10511c2de7
|
|
| BLAKE2b-256 |
25f2765c65097b0f92b40042f5f40eaf82959a7c276185d099992ffc509cb4be
|
Provenance
The following attestation bundles were made for genkidama-0.0.6.tar.gz:
Publisher:
python-publish.yml on txetxedeletxe/Genkidama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genkidama-0.0.6.tar.gz -
Subject digest:
3e3e4200c3ae88dede4c106e9291fb0736aec970bc6d947e64ebc8dcfa2c6bf6 - Sigstore transparency entry: 1309926069
- Sigstore integration time:
-
Permalink:
txetxedeletxe/Genkidama@07da12cf3bd847dece41838608c7aa90c90b3e7a -
Branch / Tag:
refs/tags/0.0.6 - Owner: https://github.com/txetxedeletxe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@07da12cf3bd847dece41838608c7aa90c90b3e7a -
Trigger Event:
release
-
Statement type: