Oasees SDK
Project description
Oasees SDK
The OASEES SDK is a Python package that consists of two modules: the Command Line Interface (CLI) module and the Python Environment module.
CLI
The CLI module's purpose is to handle the Kubernetes aspect of the OASEES framework. It provides the user with a few simple commands to quickly provision and configure a Kubernetes cluster, as well as automate and facilitate its nodes' connection to the OASEES blockchain
Installation
Like any other user Python package published on the PyPi repository, the user can install the OASEES SDK using pip.
-
Ensure that pip is present on your machine. If not, install it:
sudo apt install python3-pip
-
Install with pip:
pip install oasees_sdk
-
Set up the CLI module for use by adding its installation folder to your system's PATH (example for Ubuntu):
export PATH="/home/{USERNAME}/.local/bin:$PATH"
And make sure that its running properly by executing:
oasees-sdk
Which will also provide you with the CLI's available commands and a very short description for each one.
NOTE: An extended description for each of the CLI's commands can be provided by executing:
oasees-sdk [COMMAND] --help
Usage
Important: Before starting to use the CLI module, ensure that an instance of the OASEES stack is up and running.
The SDK is designed to work in parallel with the rest of the stack and before provisioning a cluster, the user will be prompted to enter the stack's IP address and their blockchain account information (if you're using a test account, make sure it's the same one that you've imported on MetaMask).
Should any typing mistake happen during the input prompts, you can edit the configuration file located in
/home/{username}/.oasees_sdk/config.json
, or use oasees-sdk config-full-reset
to completely reset the configuration and force the prompts to reappear.
The CLI's typical flow of usage can be described with the following steps:
-
Install the OASEES SDK on all the machines that will participate in the cluster (both the master node and the worker nodes) using the installation commands mentioned above.
-
Provision a K3S Cluster on the machine that represents the cluster's master node:
oasees-sdk init-cluster
The cluster should be visible on your Portal's home page almost immediately.
-
Retrieve your cluster's token:
oasees-sdk get-token
-
Execute the join-cluster command on each of your worker devices to join them with your cluster, providing the master's IP address and the retrieved token.
oasees-sdk join-cluster --ip {K3S_MASTER_IP_ADDRESS} --token {K3S_MASTER_TOKEN}
-
Execute the register-new-nodes command on your master node to create blockchain accounts for each of your unregistered worker devices, register them to the blockchain and associate them with your cluster.
oasees-sdk register-new-nodes
NOTE: This command detects and handles only the nodes that aren't already registered on the blockchain, so you can use it multiple times as you scale your K3S Cluster with new devices / nodes.
-
If you intend to associate your cluster with a blockchain DAO, execute the apply-dao-logic command, providing the IPFS hash of your uploaded DAO contracts.
oasees-sdk apply-dao-logic {DAO_CONTRACTS_IPFS_HASH}
After the DAO logic is applied, devices that are already registered on the blockchain, as well as devices that get registered at a later point, will automatically be able to perform DAO actions such as creating proposals and voting.
Launching a Jupyter Notebook or a Python shell (**both of which can be found) :
from oasees_sdk import oasees_sdk
The CLI module's purpose is to handle the Kubernetes aspect of the OASEES framework. It provides the user with a few simple commands to quickly provision and configure a Kubernetes cluster, as well as connect it to the OASEES blockchain
The SDK is embedded into the Jupyter Notebook image which is built upon the creation of the Oasees Stack. This means that no installation of the SDK and its requirements is needed from the user's side. It only needs to be imported either into a Jupyter Notebook or Python Console by running:
import oasees_sdk
Or in the stack's Jupyter Terminal (all three options are found in the portal's Notebook tab), where you first need to launch the python shell by running:
python3
And then import the oasees_sdk.
Usage / Instructions (outdated)
As soon as the SDK gets successfully imported into the chosen python environment, the following brief documentation about its functions and their usage is printed:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file oasees_sdk-0.4.3.tar.gz
.
File metadata
- Download URL: oasees_sdk-0.4.3.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02bb3a558b628183f5afcabda4f34da173ce6436d91d4274e622864703e142e |
|
MD5 | b52ac540fdbf736a57f5a6527660d756 |
|
BLAKE2b-256 | 54799065ab8bbc46e7461dfd5df1e90f4a2dac59b5d2b1cbecf136f2b6354714 |
File details
Details for the file oasees_sdk-0.4.3-py2.py3-none-any.whl
.
File metadata
- Download URL: oasees_sdk-0.4.3-py2.py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83172206a26f6ac1c7725556c3fe21ce957226c0f9ea8aae1143c717cd029cac |
|
MD5 | 866b1daa4b6cd47900466196e9ea7324 |
|
BLAKE2b-256 | f8acfa5db5cc3cc4a90661bb0379ed4d591d9ae7550b0491b64c8ff904c6f07e |