- Notifications
You must be signed in to change notification settings - Fork1
Automatically generates configuration files for Lithops
License
lithops-cloud/lithopscloud
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Lithopscloud is a CLI tool that greatly simplifies user experience by generating Lithops and Ray configuration files.
The tool been mostly tested with Ubuntu 18.04/20.04, but should work with most Linux systemsRequirements:ssh-keygen utility installed:
sudo apt install openssh-clientInstalllithopscloud from pip repository
pip install lithopscloudUse the configuration tool as follows
lithopscloud [--iam-api-key IAM_API_KEY] [-i INPUT_FILE] [-o OUTPUT_PATH] [--verify_config CONFIG_FILE_PATH] [--version] [--backend backend] [--defaults]Get a short description of the available flags vialithopscloud --help
| Key | Default | Mandatory | Additional info |
|---|---|---|---|
| iam-api-key | yes | IBM Cloud API key. To generate a new API Key, adhere to the followingguide | |
| input-file | <compute_backend>/defaults.py | no | Existing config file to be used as a template in the configuration process |
| output-path | A randomly generated path to a randomly named yaml file | no | A custom location the config file will be written to |
| verify-config | no | Verifies the integrity of an existing config file and outputs a usable config file based on it. Currently doesn't support gen2 backends. | |
| version | no | Returns lithopscloud's package version |
Using theverify-config option enables verification of additional valid ways of configuration, that otherwiseleft unchecked. This mode scans for any possible subset of valid parameters and extract them to output a newlithops config file (e.g., verify cos configured by HMAC credentials).To utilize simply runlithopscloud --verify-config CONFIG_FILE_PATH -o OUTPUT_FILE_PATH
Please note that this feature doesn't currently support the verification of gen2 backends.
Standalone Compute Backends | Serverless Compute Backends | Storage Backends |
|---|---|---|
|
|
|
In order to let lithopscloud generate config file based on some defaults and create vpc and all its peripherial assets automatically, please run:
lithopscloud -a <API_KEY> -b <BACKEND> --defaults- currently, lithops
gen2is the only supported backend
Notice, not all fields are mandatory. Unspecified resources will be created automatically on the backend.
E.g.If existing vpc id not provided - vpc will be created automatically with all required peripherial resources like security groups, gateway.. etc following minimal default requiermentsIf ssh key details not provided - new ssh key pair will be generated and registered in ibm cloud
from lithopscloud import generate_configfrom lithopscloud import LITHOPS_GEN2, LITHOPS_CF, LITHOPS_CE, RAY_GEN2, LOCAL_HOSTapi_key = '<IAM_API_KEY>'region = 'eu-de'generate_config(LITHOPS_GEN2, api_key, region, cos_bucket_name='kpavel-bucket', image_id='r010-5a674db7-95aa-45c5-a2f1-a6aa9d7e93ad', key_id='r010-fe6cb103-60e6-46bc-9cb5-14e415990849', ssh_key_filename='/home/kpavel/.ssh/id_rsa', profile_name='bx2-2x8', vpc_id='r010-af1adda4-e4e5-4060-9aa2-7a0c981aff8e')Mandatory fields are: backend_type (LITHOPS_GEN2), api_key, region and cos_bucket.Minimal example:
from lithopscloud import generate_configfrom lithopscloud import LITHOPS_GEN2, RAY_GEN2api_key = <IAM_API_KEY>region = 'ca-tor'cos_bucket_name='kpavel-bucket'config_file = generate_config(LITHOPS_GEN2, api_key, region, cos_bucket_name=cos_bucket_name)from lithopscloud import generate_configfrom lithopscloud import RAY_GEN2api_key = '<IAM_API_KEY>'region = 'eu-de'generate_config(RAY_GEN2, api_key, region, image_id='r010-5a674db7-95aa-45c5-a2f1-a6aa9d7e93ad', key_id='r010-fe6cb103-60e6-46bc-9cb5-14e415990849', ssh_key_filename='/home/kpavel/.ssh/id_rsa', profile_name='bx2-2x8', vpc_id='r010-af1adda4-e4e5-4060-9aa2-7a0c981aff8e', min_workers=1, max_workers=1)Mandatory fields are: backend_type (LITHOPS_GEN2), api_key, region and cos_bucket.Minimal example:
from lithopscloud import generate_configfrom lithopscloud import RAY_GEN2api_key = <IAM_API_KEY>region = 'eu-de'config_file = generate_config(RAY_GEN2, api_key, region)- implementconfig_builder.py interface
- add your implementation underprovider package
- add reference to your implementation in the list of exported modules, e.g.lithops modules
- implementconfig_builder.py interface to hold common logic
- add your implementation tomodules package
- extend your common implementation under each provider package, e.g.lithops image.py andray image.py to have config file specific logic
About
Automatically generates configuration files for Lithops
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.