ratio1 3.4.38__tar.gz → 3.4.39__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.
- {ratio1-3.4.38 → ratio1-3.4.39}/PKG-INFO +1 -1
- {ratio1-3.4.38 → ratio1-3.4.39}/pyproject.toml +1 -1
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/_ver.py +1 -1
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/generic_session.py +207 -75
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/webapp_pipeline.py +31 -10
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex13_launch_repo_based_webapp.py +31 -14
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex16_launch_repo_based_http_server.py +23 -11
- {ratio1-3.4.38 → ratio1-3.4.39}/.devcontainer/Dockerfile +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/.devcontainer/devcontainer.json +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/.gitattributes +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/.github/workflows/python-publish.yml +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/.gitignore +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/.vscode/launch.json +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/LICENSE +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/README.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/TODOs.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/r1ctl.MD +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/distributed_custom_code_presets.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/instance.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/payload/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/payload/payload.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/pipeline.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/plugin_template.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/responses.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base/transaction.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/base_decentra_object.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/bc/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/bc/base.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/bc/chain.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/bc/ec.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/bc/evm.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/certs/51.15.142.167.crt +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/certs/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/certs/a0d9818f.ala.eu-central-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/README.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/cli.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/cli_commands.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/nodes.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/oracles.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/cli/package_update.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/code_cheker/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/code_cheker/base.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/code_cheker/checker.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/comm/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/comm/amqp_wrapper.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/comm/base_comm_wrapper.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/comm/mqtt_wrapper.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/README.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/apps.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/base.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/comms.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/environment.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/evm_net.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/formatter.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/heartbeat.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/misc.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/payload.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/const/plugins/deeploy_const.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/custom_webapi_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/generic_http_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/net_mon_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/telegram_basic_bot_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/telegram_conversational_bot_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/instance/view_scene_01_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/default/session/mqtt_session.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/base/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/base/base_formatter.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/default/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/default/a_dummy.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/default/aixp1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/default/default.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/io_formatter/io_formatter_manager.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ifps_keygen +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/ipfs.service +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/launch_service.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/restart.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/run.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/setup.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/show.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/ipfs_setup/write_key.sh +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/ipfs/r1fs.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/base_logger.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/class_instance_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/computer_vision_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/datetime_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/download_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/general_serialization_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/json_serialization_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/machine_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/process_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/resource_size_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/timers_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/upload_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/logger_mixins/utils_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/small_logger.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/tzlocal/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/tzlocal/unix.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/tzlocal/utils.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/tzlocal/win32.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/logging/tzlocal/windows_tz.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/plugins_manager_mixin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/utils/__init__.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/utils/comm_utils.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/utils/config.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/utils/dotenv.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/ratio1/utils/oracle_sync/oracle_tester.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/requirements.txt +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/template.env +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/.example_env +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/9. code_sandbox_from_scratch_assets/index.html +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/_example_pk_sdk.pem +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/eth2025/deploy_home_safety.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/eth2025/deploy_maintenance_monitoring.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex01_part1_connect.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex01_part2_filter.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex01_part3_adv_filter.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex02_part1_deploy_webapi.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex02_part2_deploy_plugin.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex02_part3_deploy_r1fs_test.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex03_custom_code_on_one_remote__example_1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex04_custom_code_on_one_remote__example_2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex05_custom_code_on_one_remote__example_3.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex06_custom_code_on_multiple_remotes__example_1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex07_custom_code_on_multiple_remotes__example_2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex08_custom_webapi.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex09_code_sandbox_from_scratch.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex10_telegram_echo_bot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex11_telegram_blackjack_bot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex12_telegram_smart_bot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex14_wallets.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex15_telegram_rogue_style_game.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex17_launch_repo_based_balanced_webapp.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex18_deploy_container_webapi.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex19_deeploy_container_example.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex20_deeploy_telegram_bot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex21_telegram_community_bot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/ex22_deeploy_custom_code.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/winrun.bat +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/README.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/_show_config_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/cstore_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/dauth_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/keys_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/node_info_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/ora_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/ora_intervals.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/ora_sign_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/owner_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/payload_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/session_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/w3_auth_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/w3_nodes_licenses.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/w3_oracles_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/whitelist_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/_checks/workload_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/dates/check_date.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/debug/close_pipeline.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/decentralized/chain_dist_example.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/deeploy/checker.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/deeploy/checker2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/deeploy/create_request.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/enc_dec/enc_dec_test.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/balance.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/eth_sign.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/info.md +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/send.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/send_many.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/eth/sign.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/log.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/logger/run.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/lp/lp_checker.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/multi-enc-dec/multi_test1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/multi-enc-dec/multi_test2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/pipelines/start.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/pipelines/stop.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/scripts/monitoring/collect_messages.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/scripts/monitoring/get_hb_distribution.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/scripts/monitoring/multithreaded_network_sniffer.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/sign/simple_payload_checker.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/sign/test_sign1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/sign/test_sign2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/test.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/tokens/get_check.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/utils/get_documentation.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/various/attach_example.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/various/ex1.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/various/hello.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/various/remote_exec.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/various/save_images.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/wl/wl_add.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/xarchive/_tutorials/3. simple_real_time_custom_code.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/xarchive/_tutorials/4. real_time_custom_code_2.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/xarchive/_tutorials/8. chatbot.py +0 -0
- {ratio1-3.4.38 → ratio1-3.4.39}/xperimental/xarchive/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ratio1
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.39
|
|
4
4
|
Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
|
|
5
5
|
Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
|
|
@@ -2789,15 +2789,58 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2789
2789
|
|
|
2790
2790
|
return pipeline, instance
|
|
2791
2791
|
|
|
2792
|
+
def maybe_clean_kwargs(
|
|
2793
|
+
self, _kwargs: dict,
|
|
2794
|
+
caller_method_name: str,
|
|
2795
|
+
solver_method_name: str,
|
|
2796
|
+
parameters_to_remove: list[str]
|
|
2797
|
+
):
|
|
2798
|
+
"""
|
|
2799
|
+
This method is used to clean the kwargs dictionary before passing it to a solver method.
|
|
2800
|
+
It can also print warnings
|
|
2801
|
+
Parameters
|
|
2802
|
+
----------
|
|
2803
|
+
_kwargs : dict
|
|
2804
|
+
The kwargs dictionary to clean.
|
|
2805
|
+
caller_method_name : str
|
|
2806
|
+
The name of the method that is calling this method.
|
|
2807
|
+
solver_method_name : str
|
|
2808
|
+
The name of the solver method that will receive the cleaned kwargs.
|
|
2809
|
+
parameters_to_remove : list[str]
|
|
2810
|
+
A list of parameters to remove from the kwargs dictionary.
|
|
2811
|
+
|
|
2812
|
+
Returns
|
|
2813
|
+
-------
|
|
2814
|
+
res : dict
|
|
2815
|
+
The cleaned kwargs dictionary.
|
|
2816
|
+
"""
|
|
2817
|
+
|
|
2818
|
+
for _key in parameters_to_remove:
|
|
2819
|
+
if not isinstance(_key, str):
|
|
2820
|
+
continue
|
|
2821
|
+
# endif param_name not str
|
|
2822
|
+
if _key in _kwargs:
|
|
2823
|
+
_kwargs.pop(_key)
|
|
2824
|
+
warn_msg = f"WARNING! The '{caller_method_name}' passes its own `{_key}`, so the parameter is not used."
|
|
2825
|
+
warn_msg += f" Use '{solver_method_name}' instead if you want to use the `{_key}` parameter."
|
|
2826
|
+
self.log.P(warn_msg, color='y', show=True)
|
|
2827
|
+
# endif _key in _kwargs
|
|
2828
|
+
# endfor parameters to remove
|
|
2829
|
+
|
|
2830
|
+
return _kwargs
|
|
2831
|
+
|
|
2792
2832
|
def create_web_app(
|
|
2793
2833
|
self,
|
|
2794
2834
|
*,
|
|
2795
2835
|
node,
|
|
2796
2836
|
name="Ratio1 Web App",
|
|
2797
2837
|
signature=PLUGIN_SIGNATURES.GENERIC_WEB_APP,
|
|
2838
|
+
tunnel_engine="ngrok",
|
|
2839
|
+
tunnel_engine_enabled=True,
|
|
2840
|
+
cloudflare_token=None,
|
|
2798
2841
|
ngrok_edge_label=None,
|
|
2842
|
+
ngrok_use_api=True,
|
|
2799
2843
|
endpoints=None,
|
|
2800
|
-
use_ngrok=True,
|
|
2801
2844
|
extra_debug=False,
|
|
2802
2845
|
summary="Ratio1 WebApp created via SDK",
|
|
2803
2846
|
description=None,
|
|
@@ -2805,6 +2848,9 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2805
2848
|
):
|
|
2806
2849
|
"""
|
|
2807
2850
|
Create a new generic web app on a node.
|
|
2851
|
+
If this uses tunnelling, the app will be exposed using either
|
|
2852
|
+
a cloudflare token, an ngrok edge label or an automatically generated URL.
|
|
2853
|
+
The URL can be automatically generated only in case of ngrok usage(which will also be discontinued).
|
|
2808
2854
|
|
|
2809
2855
|
Parameters
|
|
2810
2856
|
----------
|
|
@@ -2817,17 +2863,48 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2817
2863
|
|
|
2818
2864
|
signature : str, optional
|
|
2819
2865
|
The signature of the plugin that will be used. Defaults to PLUGIN_SIGNATURES.CUSTOM_WEBAPI_01.
|
|
2820
|
-
|
|
2866
|
+
|
|
2867
|
+
tunnel_engine : str, optional
|
|
2868
|
+
The tunnel engine to use for exposing the web app. Defaults to "ngrok".
|
|
2869
|
+
It can also be "cloudflare" for Cloudflare Tunnel.
|
|
2870
|
+
|
|
2871
|
+
tunnel_engine_enabled : bool, optional
|
|
2872
|
+
If True, will use the specified tunnel engine to expose the web app. Defaults to True.
|
|
2873
|
+
|
|
2874
|
+
ngrok_edge_label : str, optional
|
|
2875
|
+
The label of the edge node that will be used to expose the HTTP server. Defaults to None.
|
|
2876
|
+
|
|
2877
|
+
cloudflare_token : str, optional
|
|
2878
|
+
The Cloudflare token to use for exposing the web app. Defaults to None.
|
|
2879
|
+
|
|
2821
2880
|
endpoints : list[dict], optional
|
|
2822
2881
|
A list of dictionaries defining the endpoint configuration. Defaults to None.
|
|
2823
|
-
|
|
2824
|
-
use_ngrok : bool, optional
|
|
2825
|
-
If True, will use ngrok to expose the web app. Defaults to True.
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
2882
|
"""
|
|
2829
|
-
|
|
2830
|
-
|
|
2883
|
+
ngrok_kwargs = {}
|
|
2884
|
+
cloudflare_kwargs = {}
|
|
2885
|
+
|
|
2886
|
+
if tunnel_engine_enabled:
|
|
2887
|
+
if tunnel_engine == "ngrok":
|
|
2888
|
+
if not isinstance(ngrok_edge_label, str):
|
|
2889
|
+
ngrok_edge_label = None
|
|
2890
|
+
warn_msg = f"WARNING! Without a pre-defined `ngrok_edge_label`, the URL will be generated automatically, "
|
|
2891
|
+
warn_msg += "but it will not be persistent across restarts."
|
|
2892
|
+
self.P(warn_msg, color='y', show=True)
|
|
2893
|
+
# raise ValueError(f"`ngrok_edge_label` must be a string when using ngrok tunnel engine. {type(ngrok_edge_label)} provided")
|
|
2894
|
+
# endif ngrok edge label not valid
|
|
2895
|
+
ngrok_kwargs = {
|
|
2896
|
+
"ngrok_edge_label": ngrok_edge_label,
|
|
2897
|
+
"ngrok_use_api": ngrok_use_api,
|
|
2898
|
+
}
|
|
2899
|
+
elif tunnel_engine == "cloudflare":
|
|
2900
|
+
if not isinstance(cloudflare_token, str):
|
|
2901
|
+
raise ValueError(f"`cloudflare` must be a string when using cloudflare tunnel engine. {type(cloudflare_token)} provided.")
|
|
2902
|
+
cloudflare_kwargs = {
|
|
2903
|
+
"cloudflare_token": cloudflare_token,
|
|
2904
|
+
}
|
|
2905
|
+
else:
|
|
2906
|
+
raise ValueError("Unsupported tunnel engine: {}".format(tunnel_engine))
|
|
2907
|
+
# endif tunnel engine enabled
|
|
2831
2908
|
|
|
2832
2909
|
pipeline_name = name.replace(" ", "_").lower()
|
|
2833
2910
|
|
|
@@ -2842,12 +2919,13 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2842
2919
|
instance = pipeline.create_plugin_instance(
|
|
2843
2920
|
signature=signature,
|
|
2844
2921
|
instance_id=self.log.get_unique_id(),
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
ngrok_use_api=ngrok_use_api,
|
|
2922
|
+
tunnel_engine_enabled=tunnel_engine_enabled,
|
|
2923
|
+
tunnel_engine=tunnel_engine,
|
|
2848
2924
|
api_title=name,
|
|
2849
2925
|
api_summary=summary,
|
|
2850
2926
|
api_description=description,
|
|
2927
|
+
**ngrok_kwargs,
|
|
2928
|
+
**cloudflare_kwargs,
|
|
2851
2929
|
**kwargs
|
|
2852
2930
|
)
|
|
2853
2931
|
|
|
@@ -2865,16 +2943,20 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2865
2943
|
*,
|
|
2866
2944
|
node,
|
|
2867
2945
|
name="Ratio1 Custom Web API",
|
|
2946
|
+
tunnel_engine="ngrok",
|
|
2947
|
+
tunnel_engine_enabled=True,
|
|
2868
2948
|
ngrok_edge_label=None,
|
|
2949
|
+
cloudflare_token=None,
|
|
2869
2950
|
endpoints=None,
|
|
2870
|
-
use_ngrok=True,
|
|
2871
2951
|
extra_debug=False,
|
|
2872
2952
|
summary="Ratio1 Web API created via SDK",
|
|
2873
2953
|
description=None,
|
|
2874
2954
|
**kwargs):
|
|
2875
2955
|
"""
|
|
2876
|
-
Creates a custom Web API with endpoints on a node using custom code
|
|
2877
|
-
|
|
2956
|
+
Creates a custom Web API with endpoints on a node using custom code.
|
|
2957
|
+
If this uses tunnelling, the app will be exposed using either
|
|
2958
|
+
a cloudflare token, an ngrok edge label or an automatically generated URL.
|
|
2959
|
+
The URL can be automatically generated only in case of ngrok usage(which will also be discontinued).
|
|
2878
2960
|
|
|
2879
2961
|
Parameters
|
|
2880
2962
|
----------
|
|
@@ -2885,18 +2967,21 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2885
2967
|
name : str
|
|
2886
2968
|
Name of the web app.
|
|
2887
2969
|
|
|
2970
|
+
tunnel_engine : str, optional
|
|
2971
|
+
The tunnel engine to use for exposing the web app. Defaults to "ngrok".
|
|
2972
|
+
It can also be "cloudflare" for Cloudflare Tunnel.
|
|
2973
|
+
|
|
2974
|
+
tunnel_engine_enabled : bool, optional
|
|
2975
|
+
If True, will use the specified tunnel engine to expose the web app. Defaults to True.
|
|
2976
|
+
|
|
2888
2977
|
ngrok_edge_label : str, optional
|
|
2889
2978
|
The label of the edge node that will be used to expose the HTTP server. Defaults to None.
|
|
2890
2979
|
|
|
2891
|
-
|
|
2892
|
-
The
|
|
2980
|
+
cloudflare_token : str, optional
|
|
2981
|
+
The Cloudflare token to use for exposing the web app. Defaults to None.
|
|
2893
2982
|
|
|
2894
2983
|
endpoints : list[dict], optional
|
|
2895
2984
|
A list of dictionaries defining the endpoint configuration. Defaults to None.
|
|
2896
|
-
|
|
2897
|
-
use_ngrok : bool, optional
|
|
2898
|
-
If True, will use ngrok to expose the web app. Defaults to True.
|
|
2899
|
-
|
|
2900
2985
|
|
|
2901
2986
|
Returns
|
|
2902
2987
|
-------
|
|
@@ -2911,7 +2996,8 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2911
2996
|
pipeline, instance = session.create_custom_webapi(
|
|
2912
2997
|
node="node_name",
|
|
2913
2998
|
name="My Custom Web API",
|
|
2914
|
-
|
|
2999
|
+
tunnel_engine='cloudflare',
|
|
3000
|
+
cloudflare_token="<cloudflare_token>",
|
|
2915
3001
|
endpoints=[
|
|
2916
3002
|
{
|
|
2917
3003
|
"path": "/my_endpoint",
|
|
@@ -2919,7 +3005,6 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2919
3005
|
"handler": my_handler_function,
|
|
2920
3006
|
},
|
|
2921
3007
|
],
|
|
2922
|
-
use_ngrok=True,
|
|
2923
3008
|
extra_debug=True,
|
|
2924
3009
|
summary="My Custom Web API",
|
|
2925
3010
|
description="This is a custom web API created via the SDK.",
|
|
@@ -2930,13 +3015,21 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2930
3015
|
|
|
2931
3016
|
|
|
2932
3017
|
"""
|
|
3018
|
+
kwargs = self.maybe_clean_kwargs(
|
|
3019
|
+
_kwargs=kwargs,
|
|
3020
|
+
caller_method_name="create_custom_webapi",
|
|
3021
|
+
solver_method_name="create_web_app",
|
|
3022
|
+
parameters_to_remove=["signature"]
|
|
3023
|
+
)
|
|
2933
3024
|
return self.create_web_app(
|
|
2934
3025
|
node=node,
|
|
2935
3026
|
name=name,
|
|
2936
3027
|
signature=PLUGIN_SIGNATURES.CUSTOM_WEBAPI_01,
|
|
3028
|
+
tunnel_engine=tunnel_engine,
|
|
3029
|
+
tunnel_engine_enabled=tunnel_engine_enabled,
|
|
3030
|
+
cloudflare_token=cloudflare_token,
|
|
2937
3031
|
ngrok_edge_label=ngrok_edge_label,
|
|
2938
3032
|
endpoints=endpoints,
|
|
2939
|
-
use_ngrok=use_ngrok,
|
|
2940
3033
|
extra_debug=extra_debug,
|
|
2941
3034
|
summary=summary,
|
|
2942
3035
|
description=description,
|
|
@@ -2948,8 +3041,10 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2948
3041
|
*,
|
|
2949
3042
|
node,
|
|
2950
3043
|
name="Ratio1 Container Web App",
|
|
2951
|
-
|
|
2952
|
-
|
|
3044
|
+
tunnel_engine_enabled=True,
|
|
3045
|
+
tunnel_engine="ngrok",
|
|
3046
|
+
cloudflare_token=None,
|
|
3047
|
+
ngrok_edge_label=None,
|
|
2953
3048
|
extra_debug=False,
|
|
2954
3049
|
summary="Ratio1 Container WebApp created via SDK",
|
|
2955
3050
|
description=None,
|
|
@@ -2967,39 +3062,40 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
2967
3062
|
name : str
|
|
2968
3063
|
Name of the container web app.
|
|
2969
3064
|
|
|
2970
|
-
|
|
2971
|
-
The
|
|
3065
|
+
tunnel_engine : str, optional
|
|
3066
|
+
The tunnel engine to use for exposing the web app. Defaults to "ngrok".
|
|
3067
|
+
It can also be "cloudflare" for Cloudflare Tunnel.
|
|
2972
3068
|
|
|
2973
|
-
|
|
2974
|
-
If True, will use
|
|
2975
|
-
"""
|
|
3069
|
+
tunnel_engine_enabled : bool, optional
|
|
3070
|
+
If True, will use the specified tunnel engine to expose the web app. Defaults to True.
|
|
2976
3071
|
|
|
2977
|
-
|
|
3072
|
+
ngrok_edge_label : str, optional
|
|
3073
|
+
The label of the edge node that will be used to expose the HTTP server. Defaults to None.
|
|
2978
3074
|
|
|
2979
|
-
|
|
3075
|
+
cloudflare_token : str, optional
|
|
3076
|
+
The Cloudflare token to use for exposing the web app. Defaults to None.
|
|
2980
3077
|
|
|
2981
|
-
|
|
3078
|
+
"""
|
|
3079
|
+
kwargs = self.maybe_clean_kwargs(
|
|
3080
|
+
_kwargs=kwargs,
|
|
3081
|
+
caller_method_name="create_container_web_app",
|
|
3082
|
+
solver_method_name="create_web_app",
|
|
3083
|
+
parameters_to_remove=["signature"]
|
|
3084
|
+
)
|
|
3085
|
+
return self.create_web_app(
|
|
2982
3086
|
node=node,
|
|
2983
|
-
name=
|
|
2984
|
-
|
|
3087
|
+
name=name,
|
|
3088
|
+
signature=PLUGIN_SIGNATURES.CONTAINER_APP_RUNNER,
|
|
3089
|
+
tunnel_engine=tunnel_engine,
|
|
3090
|
+
tunnel_engine_enabled=tunnel_engine_enabled,
|
|
3091
|
+
cloudflare_token=cloudflare_token,
|
|
3092
|
+
ngrok_edge_label=ngrok_edge_label,
|
|
2985
3093
|
extra_debug=extra_debug,
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
instance = pipeline.create_plugin_instance(
|
|
2990
|
-
signature=signature,
|
|
2991
|
-
instance_id=self.log.get_unique_id(),
|
|
2992
|
-
use_ngrok=use_ngrok,
|
|
2993
|
-
ngrok_use_api=ngrok_use_api,
|
|
2994
|
-
api_title=name,
|
|
2995
|
-
api_summary=summary,
|
|
2996
|
-
api_description=description,
|
|
3094
|
+
summary=summary,
|
|
3095
|
+
description=description,
|
|
2997
3096
|
**kwargs
|
|
2998
3097
|
)
|
|
2999
3098
|
|
|
3000
|
-
return pipeline, instance
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
3099
|
def deeploy_launch_container_app(
|
|
3004
3100
|
self,
|
|
3005
3101
|
docker_image: str,
|
|
@@ -3798,7 +3894,10 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3798
3894
|
*,
|
|
3799
3895
|
node,
|
|
3800
3896
|
name="Ratio1 HTTP Server",
|
|
3897
|
+
tunnel_engine="ngrok",
|
|
3898
|
+
tunnel_engine_enabled=True,
|
|
3801
3899
|
ngrok_edge_label=None,
|
|
3900
|
+
cloudflare_token=None,
|
|
3802
3901
|
endpoints=None,
|
|
3803
3902
|
extra_debug=False,
|
|
3804
3903
|
summary="Ratio1 HTTP Server created via SDK",
|
|
@@ -3814,15 +3913,26 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3814
3913
|
Parameters
|
|
3815
3914
|
----------
|
|
3816
3915
|
|
|
3916
|
+
|
|
3817
3917
|
node : str
|
|
3818
|
-
Address or Name of the ratio1 Edge Protocol edge node that will handle this
|
|
3918
|
+
Address or Name of the ratio1 Edge Protocol edge node that will handle this web app.
|
|
3819
3919
|
|
|
3820
3920
|
name : str
|
|
3821
|
-
Name of the
|
|
3921
|
+
Name of the web app.
|
|
3922
|
+
|
|
3923
|
+
tunnel_engine : str, optional
|
|
3924
|
+
The tunnel engine to use for exposing the web app. Defaults to "ngrok".
|
|
3925
|
+
It can also be "cloudflare" for Cloudflare Tunnel.
|
|
3926
|
+
|
|
3927
|
+
tunnel_engine_enabled : bool, optional
|
|
3928
|
+
If True, will use the specified tunnel engine to expose the web app. Defaults to True.
|
|
3822
3929
|
|
|
3823
3930
|
ngrok_edge_label : str, optional
|
|
3824
3931
|
The label of the edge node that will be used to expose the HTTP server. Defaults to None.
|
|
3825
3932
|
|
|
3933
|
+
cloudflare_token : str, optional
|
|
3934
|
+
The Cloudflare token to use for exposing the web app. Defaults to None.
|
|
3935
|
+
|
|
3826
3936
|
endpoints : list[dict], optional
|
|
3827
3937
|
A list of dictionaries defining the endpoint configuration. Defaults to None.
|
|
3828
3938
|
|
|
@@ -3844,10 +3954,19 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3844
3954
|
static_directory = static_directory or '.'
|
|
3845
3955
|
self.__is_static_directory_valid(static_directory, raise_exception=True)
|
|
3846
3956
|
endpoints = self.__maybe_add_root_endpoint(endpoints)
|
|
3957
|
+
kwargs = self.maybe_clean_kwargs(
|
|
3958
|
+
_kwargs=kwargs,
|
|
3959
|
+
caller_method_name="create_http_server",
|
|
3960
|
+
solver_method_name="create_web_app",
|
|
3961
|
+
parameters_to_remove=["signature"]
|
|
3962
|
+
)
|
|
3847
3963
|
return self.create_web_app(
|
|
3848
3964
|
node=node,
|
|
3849
3965
|
name=name,
|
|
3850
3966
|
signature=PLUGIN_SIGNATURES.GENERIC_HTTP_SERVER,
|
|
3967
|
+
tunnel_engine=tunnel_engine,
|
|
3968
|
+
tunnel_engine_enabled=tunnel_engine_enabled,
|
|
3969
|
+
cloudflare_token=cloudflare_token,
|
|
3851
3970
|
ngrok_edge_label=ngrok_edge_label,
|
|
3852
3971
|
endpoints=endpoints,
|
|
3853
3972
|
extra_debug=extra_debug,
|
|
@@ -3865,7 +3984,9 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3865
3984
|
*,
|
|
3866
3985
|
nodes,
|
|
3867
3986
|
name,
|
|
3868
|
-
ngrok_edge_label,
|
|
3987
|
+
ngrok_edge_label=None,
|
|
3988
|
+
cloudflare_token=None,
|
|
3989
|
+
tunnel_engine="ngrok",
|
|
3869
3990
|
signature=PLUGIN_SIGNATURES.GENERIC_WEB_APP,
|
|
3870
3991
|
endpoints=None,
|
|
3871
3992
|
extra_debug=False,
|
|
@@ -3894,6 +4015,13 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3894
4015
|
The label of the edge node that will be used to expose the web app. This is mandatory due to the fact
|
|
3895
4016
|
that the web app will be exposed using ngrok from multiple nodes that all will share the same edge label.
|
|
3896
4017
|
|
|
4018
|
+
cloudflare_token : str, optional
|
|
4019
|
+
The Cloudflare token to use for exposing the web app. Defaults to None.
|
|
4020
|
+
|
|
4021
|
+
tunnel_engine : str, optional
|
|
4022
|
+
The tunnel engine to use for exposing the web app. Defaults to "ngrok".
|
|
4023
|
+
It can also be "cloudflare" for Cloudflare Tunnel.
|
|
4024
|
+
|
|
3897
4025
|
endpoints : list[dict], optional
|
|
3898
4026
|
A list of dictionaries defining the endpoint configuration. Defaults to None.
|
|
3899
4027
|
|
|
@@ -3902,40 +4030,40 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3902
4030
|
"""
|
|
3903
4031
|
|
|
3904
4032
|
ngrok_use_api = kwargs.pop('ngrok_use_api', True)
|
|
3905
|
-
use_ngrok = True
|
|
3906
|
-
kwargs.pop('use_ngrok', None)
|
|
3907
4033
|
|
|
3908
|
-
if ngrok_edge_label is None:
|
|
3909
|
-
|
|
4034
|
+
if tunnel_engine == "ngrok" and ngrok_edge_label is None:
|
|
4035
|
+
err_msg = f"The `ngrok_edge_label` parameter is mandatory when creating a balanced web app tunneled with ngrok."
|
|
4036
|
+
err_msg += "This is needed in order for all instances to respond to the same URL."
|
|
4037
|
+
raise ValueError(err_msg)
|
|
4038
|
+
# endif ngrok used and ngrok_edge_label is None
|
|
4039
|
+
|
|
4040
|
+
kwargs = self.maybe_clean_kwargs(
|
|
4041
|
+
_kwargs=kwargs,
|
|
4042
|
+
caller_method_name="create_and_deploy_balanced_web_app",
|
|
4043
|
+
solver_method_name="create_web_app",
|
|
4044
|
+
parameters_to_remove=[
|
|
4045
|
+
"tunnel_engine_enabled"
|
|
4046
|
+
]
|
|
4047
|
+
)
|
|
3910
4048
|
|
|
3911
4049
|
pipelines, instances = [], []
|
|
3912
4050
|
|
|
3913
4051
|
for node in nodes:
|
|
3914
4052
|
self.P("Creating web app on node {}...".format(node), color='b')
|
|
3915
|
-
|
|
4053
|
+
|
|
4054
|
+
pipeline, instance = self.create_web_app(
|
|
3916
4055
|
node=node,
|
|
3917
4056
|
name=name,
|
|
3918
|
-
pipeline_type=WebappPipeline,
|
|
3919
|
-
extra_debug=extra_debug,
|
|
3920
|
-
# default TYPE is "Void"
|
|
3921
|
-
)
|
|
3922
|
-
|
|
3923
|
-
instance = pipeline.create_plugin_instance(
|
|
3924
4057
|
signature=signature,
|
|
3925
|
-
|
|
3926
|
-
|
|
4058
|
+
tunnel_engine=tunnel_engine,
|
|
4059
|
+
tunnel_engine_enabled=True,
|
|
4060
|
+
cloudflare_token=cloudflare_token,
|
|
3927
4061
|
ngrok_edge_label=ngrok_edge_label,
|
|
3928
4062
|
ngrok_use_api=ngrok_use_api,
|
|
4063
|
+
endpoints=endpoints,
|
|
4064
|
+
extra_debug=extra_debug,
|
|
3929
4065
|
**kwargs
|
|
3930
4066
|
)
|
|
3931
|
-
|
|
3932
|
-
if endpoints is not None:
|
|
3933
|
-
for endpoint in endpoints:
|
|
3934
|
-
assert isinstance(endpoint, dict), "Each endpoint must be a dictionary defining the endpoint configuration."
|
|
3935
|
-
instance.add_new_endpoint(**endpoint)
|
|
3936
|
-
# end for
|
|
3937
|
-
# end if we have endpoints defined in the call
|
|
3938
|
-
|
|
3939
4067
|
pipeline.deploy()
|
|
3940
4068
|
pipelines.append(pipeline)
|
|
3941
4069
|
instances.append(instance)
|
|
@@ -3981,6 +4109,8 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3981
4109
|
nodes,
|
|
3982
4110
|
name="Ratio1 HTTP Server",
|
|
3983
4111
|
ngrok_edge_label=None,
|
|
4112
|
+
cloudflare_token=None,
|
|
4113
|
+
tunnel_engine="ngrok",
|
|
3984
4114
|
endpoints=None,
|
|
3985
4115
|
extra_debug=False,
|
|
3986
4116
|
summary="Ratio1 HTTP Server created via SDK",
|
|
@@ -3996,7 +4126,7 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
3996
4126
|
Parameters
|
|
3997
4127
|
----------
|
|
3998
4128
|
|
|
3999
|
-
nodes :
|
|
4129
|
+
nodes : list
|
|
4000
4130
|
List of addresses or Names of the ratio1 Edge Protocol edge nodes that will handle this HTTP server.
|
|
4001
4131
|
|
|
4002
4132
|
name : str
|
|
@@ -4030,6 +4160,8 @@ class GenericSession(BaseDecentrAIObject):
|
|
|
4030
4160
|
nodes=nodes,
|
|
4031
4161
|
name=name,
|
|
4032
4162
|
signature=PLUGIN_SIGNATURES.GENERIC_HTTP_SERVER,
|
|
4163
|
+
tunnel_engine=tunnel_engine,
|
|
4164
|
+
cloudflare_token=cloudflare_token,
|
|
4033
4165
|
ngrok_edge_label=ngrok_edge_label,
|
|
4034
4166
|
endpoints=endpoints,
|
|
4035
4167
|
extra_debug=extra_debug,
|
|
@@ -25,7 +25,7 @@ class WebappPipeline(Pipeline):
|
|
|
25
25
|
This is a special type of pipeline that is used to deploy webapps.
|
|
26
26
|
It will override the deploy method to return the ngrok URL as well as the on_data method to extract the ngrok URL.
|
|
27
27
|
"""
|
|
28
|
-
self.
|
|
28
|
+
self.app_url = None
|
|
29
29
|
self.__extra_debug = extra_debug
|
|
30
30
|
_on_data = [self.__check_payloads, on_data]
|
|
31
31
|
super().__init__(
|
|
@@ -70,7 +70,7 @@ class WebappPipeline(Pipeline):
|
|
|
70
70
|
if self.__extra_debug:
|
|
71
71
|
self.P(f"Received payload from {plugin_signature} ({plugin_instance})")
|
|
72
72
|
if "NGROK_URL" in data:
|
|
73
|
-
|
|
73
|
+
self.app_url = data["NGROK_URL"]
|
|
74
74
|
return
|
|
75
75
|
|
|
76
76
|
def create_plugin_instance(
|
|
@@ -78,19 +78,40 @@ class WebappPipeline(Pipeline):
|
|
|
78
78
|
*,
|
|
79
79
|
signature,
|
|
80
80
|
instance_id,
|
|
81
|
-
config={},
|
|
81
|
+
config={},
|
|
82
|
+
tunnel_engine='ngrok',
|
|
83
|
+
tunnel_engine_enabled=True,
|
|
82
84
|
ngrok_edge_label=None,
|
|
85
|
+
cloudflare_token=None,
|
|
83
86
|
**kwargs
|
|
84
87
|
):
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
tunnel_kwargs = {
|
|
89
|
+
'tunnel_engine': tunnel_engine,
|
|
90
|
+
'tunnel_engine_enabled': tunnel_engine_enabled,
|
|
91
|
+
}
|
|
92
|
+
if not tunnel_engine_enabled:
|
|
93
|
+
self.app_url = "TUNNEL_ENGINE_DISABLED"
|
|
94
|
+
else:
|
|
95
|
+
if tunnel_engine.lower() == 'cloudflare':
|
|
96
|
+
if cloudflare_token is None:
|
|
97
|
+
raise ValueError("Cloudflare token must be provided when using Cloudflare as tunnel engine.")
|
|
98
|
+
self.P("Using Cloudflare as tunnel engine", color="green")
|
|
99
|
+
self.app_url = "URL_DEFINED_IN_CLOUDFLARE_TOKEN"
|
|
100
|
+
tunnel_kwargs['cloudflare_token'] = cloudflare_token
|
|
101
|
+
else:
|
|
102
|
+
self.P("Using ngrok as tunnel engine", color="green")
|
|
103
|
+
if ngrok_edge_label is not None:
|
|
104
|
+
self.app_url = "URL_DEFINED_IN_NGROK_EDGE_LABEL"
|
|
105
|
+
tunnel_kwargs['ngrok_edge_label'] = ngrok_edge_label
|
|
106
|
+
# endif ngrok_edge_label is not None
|
|
107
|
+
# endif tunnel_engine ngrok or cloudflare
|
|
108
|
+
# endif tunnel_engine_enabled
|
|
88
109
|
|
|
89
110
|
return super().create_plugin_instance(
|
|
90
111
|
signature=signature,
|
|
91
112
|
instance_id=instance_id,
|
|
92
|
-
config=config,
|
|
93
|
-
|
|
113
|
+
config=config,
|
|
114
|
+
**tunnel_kwargs,
|
|
94
115
|
**kwargs
|
|
95
116
|
)
|
|
96
117
|
|
|
@@ -106,11 +127,11 @@ class WebappPipeline(Pipeline):
|
|
|
106
127
|
res = super().deploy(verbose=verbose, timeout=timeout, **kwargs)
|
|
107
128
|
# now we wait for the ngrok url to be available
|
|
108
129
|
start = time.time()
|
|
109
|
-
while self.
|
|
130
|
+
while self.app_url is None:
|
|
110
131
|
elapsed = time.time() - start
|
|
111
132
|
if elapsed > timeout:
|
|
112
133
|
msg = "Timeout waiting for ngrok url"
|
|
113
134
|
self.P(msg, color="red")
|
|
114
135
|
raise Exception(msg)
|
|
115
136
|
# return the ngrok url
|
|
116
|
-
return self.
|
|
137
|
+
return self.app_url
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
ex13_launch_repo_based_webapp.py
|
|
3
3
|
-------------------------------
|
|
4
4
|
|
|
5
|
-
This script demonstrates how to create and deploy a webapp based on a public repository
|
|
6
|
-
|
|
5
|
+
This script demonstrates how to create and deploy a webapp based on a public repository with ngrok or cloudflare
|
|
6
|
+
as tunnelling engine.
|
|
7
|
+
The script will create a webapp based on a public repository and deploy it to the
|
|
7
8
|
target Ratio1 Edge Node.
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
If an ngrok edge label or a cloudflare token is provided, the webapp will be accessible via a permanent URL.
|
|
11
|
+
In case ngrok is used and no edge label is provided, a unique URL will be generated by the ngrok service.
|
|
9
12
|
The temporary URL will be retrieved and printed to the console.
|
|
10
13
|
|
|
14
|
+
Note: In the case of a temporary URL, if the node is restarted, a new URL will be generated.
|
|
15
|
+
|
|
11
16
|
"""
|
|
12
17
|
from os import environ
|
|
13
18
|
from ratio1 import Session
|
|
@@ -20,12 +25,16 @@ if __name__ == "__main__":
|
|
|
20
25
|
|
|
21
26
|
session.wait_for_node(node)
|
|
22
27
|
|
|
23
|
-
# This is optional
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# In case
|
|
28
|
+
# This is optional and if not tunnel engine is provided, the default will be ngrok.
|
|
29
|
+
tunnel_engine = environ.get("TUNNEL_ENGINE", "ngrok").lower()
|
|
30
|
+
|
|
31
|
+
# In case of using ngrok this is optional!
|
|
32
|
+
# If an ngrok edge label or a cloudflare token is provided, the webapp will be accessible via a permanent URL.
|
|
33
|
+
# In case this is not provided by the user and ngrok is used, a unique URL will be generated by the ngrok service.
|
|
27
34
|
# Warning! create_webapp method does not support multiple nodes.
|
|
35
|
+
# If you want to deploy the webapp to multiple nodes, you can use the create_and_deploy_balanced_web_app method
|
|
28
36
|
ngrok_edge_label = environ.get("NGROK_EDGE_LABEL", None)
|
|
37
|
+
cloudflare_token = environ.get("CLOUDFLARE_TOKEN", None)
|
|
29
38
|
|
|
30
39
|
# Defining the environment variables for the webapp.
|
|
31
40
|
# Here we can pass anything we want to the webapp.
|
|
@@ -59,19 +68,27 @@ if __name__ == "__main__":
|
|
|
59
68
|
env_vars=env_vars,
|
|
60
69
|
setup_commands=setup_commands,
|
|
61
70
|
run_command=run_command,
|
|
71
|
+
tunnel_engine=tunnel_engine,
|
|
62
72
|
ngrok_edge_label=ngrok_edge_label,
|
|
63
|
-
|
|
73
|
+
cloudflare_token=cloudflare_token,
|
|
74
|
+
assets=assets,
|
|
64
75
|
)
|
|
65
76
|
|
|
66
77
|
url = pipeline.deploy()
|
|
67
78
|
|
|
68
79
|
# print the url of the webapp
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
if ngrok_edge_label is None and cloudflare_token is None:
|
|
81
|
+
session.P(
|
|
82
|
+
f"Webapp available at: {url}.\nNote that this url is temporary. "
|
|
83
|
+
f"In case the node is restarted, a new url will be generated.\n"
|
|
84
|
+
f"In case you see an ngrok gateway error please try again after a few seconds.",
|
|
85
|
+
color='g', boxed=True, show=True
|
|
86
|
+
)
|
|
87
|
+
else:
|
|
88
|
+
msg = f"Webapp deployed using {tunnel_engine}. "
|
|
89
|
+
msg += "For the url check the settings of the provided ngrok edge label or cloudflare token."
|
|
90
|
+
session.P(msg, color='g', boxed=True, show=True)
|
|
91
|
+
# endif ngrok_edge_label is None and cloudflare_token is None
|
|
75
92
|
|
|
76
93
|
# Observation:
|
|
77
94
|
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|