ratio1 3.4.108__tar.gz → 3.4.110__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.108 → ratio1-3.4.110}/PKG-INFO +1 -1
- {ratio1-3.4.108 → ratio1-3.4.110}/pyproject.toml +1 -1
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/_ver.py +1 -1
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/cli_commands.py +1 -1
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/oracles.py +27 -16
- ratio1-3.4.110/tutorials/ex26_cerviguard_war_loopback.py +374 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/dauth_check.py +10 -3
- {ratio1-3.4.108 → ratio1-3.4.110}/.devcontainer/Dockerfile +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/.devcontainer/devcontainer.json +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/.gitattributes +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/.github/workflows/python-publish.yml +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/.gitignore +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/.vscode/launch.json +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/LICENSE +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/README.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/TODOs.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/r1ctl.MD +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/distributed_custom_code_presets.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/generic_session.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/instance.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/payload/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/payload/payload.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/pipeline.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/plugin_template.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/responses.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/transaction.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base/webapp_pipeline.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/base_decentra_object.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/bc/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/bc/base.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/bc/chain.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/bc/ec.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/bc/evm.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/141.136.35.100.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/195.35.29.4.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/31.97.72.187.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/51.15.142.167.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/72.60.187.24.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/72.60.81.67.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/72.60.83.78.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/a0d9818f.ala.eu-central-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/README.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/cli.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/nodes.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/cli/package_update.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/code_cheker/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/code_cheker/base.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/code_cheker/checker.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/comm/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/comm/amqp_wrapper.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/comm/base_comm_wrapper.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/comm/mqtt_wrapper.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/README.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/apps.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/base.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/comms.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/environment.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/evm_net.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/formatter.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/heartbeat.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/misc.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/payload.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/const/plugins/deeploy_const.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/custom_webapi_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/generic_http_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/net_mon_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/telegram_basic_bot_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/telegram_conversational_bot_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/instance/view_scene_01_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/default/session/mqtt_session.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/base/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/base/base_formatter.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/default/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/default/a_dummy.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/default/aixp1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/default/default.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/io_formatter/io_formatter_manager.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ifps_keygen +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/ipfs.service +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/launch_service.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/restart.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/run.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/setup.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/show.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/ipfs_setup/write_key.sh +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/ipfs/r1fs.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/base_logger.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/class_instance_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/computer_vision_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/datetime_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/download_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/general_serialization_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/json_serialization_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/machine_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/process_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/resource_size_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/timers_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/upload_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/logger_mixins/utils_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/small_logger.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/tzlocal/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/tzlocal/unix.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/tzlocal/utils.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/tzlocal/win32.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/logging/tzlocal/windows_tz.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/plugins_manager_mixin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/utils/__init__.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/utils/comm_utils.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/utils/config.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/utils/dotenv.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/ratio1/utils/oracle_sync/oracle_tester.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/requirements.txt +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/template.env +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/.example_env +0 -0
- {ratio1-3.4.108/tutorials/25_cerviguard_war_loopback → ratio1-3.4.110/tutorials/26_cerviguard_war_loopback}/cerviguard_test_ui.html +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/9. code_sandbox_from_scratch_assets/index.html +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/_example_pk_sdk.pem +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/eth2025/deploy_home_safety.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/eth2025/deploy_maintenance_monitoring.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex01_part1_connect.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex01_part2_filter.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex01_part3_adv_filter.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex02_part1_deploy_webapi.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex02_part2_deploy_plugin.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex02_part3_deploy_r1fs_test.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex03_custom_code_on_one_remote__example_1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex04_custom_code_on_one_remote__example_2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex05_custom_code_on_one_remote__example_3.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex06_custom_code_on_multiple_remotes__example_1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex07_custom_code_on_multiple_remotes__example_2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex08_custom_webapi.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex09_code_sandbox_from_scratch.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex10_telegram_echo_bot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex11_telegram_blackjack_bot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex12_telegram_smart_bot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex13_launch_repo_based_webapp.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex14_wallets.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex15_telegram_rogue_style_game.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex16_launch_repo_based_http_server.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex17_launch_repo_based_balanced_webapp.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex18_deploy_container_webapi.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex19_deeploy_container_example.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex20_deeploy_telegram_bot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex21_telegram_community_bot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex22_deeploy_custom_code.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex23_deploy_worker_app.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex24_multi_video_stream_monitor.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/ex25_local_serving_api.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/winrun.bat +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/README.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/_show_config_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/cstore_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/keys_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/node_info_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/ora_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/ora_intervals.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/ora_sign_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/owner_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/payload_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/session_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_all_active_jobs_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_auth_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_first_closable_job_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_nodes_licenses.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_oracles_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/w3_poai_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/whitelist_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/_checks/workload_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/ai4e/delete.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/ai4e/launcher.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/dates/check_date.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/debug/close_pipeline.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/decentralized/chain_dist_example.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/deeploy/checker.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/deeploy/checker2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/deeploy/create_request.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/enc_dec/enc_dec_test.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/allocate_rewards.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/balance.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/eth_sign.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/info.md +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/send.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/send_many.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/eth/sign.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/log.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/logger/run.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/lp/lp_checker.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/multi-enc-dec/multi_test1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/multi-enc-dec/multi_test2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/netmon/check_netmon.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/netmon/netmon_data.json +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/pipelines/start.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/pipelines/stop.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/scripts/monitoring/collect_messages.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/scripts/monitoring/get_hb_distribution.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/scripts/monitoring/multithreaded_network_sniffer.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/sign/simple_payload_checker.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/sign/test_sign1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/sign/test_sign2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/test.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/tokens/get_check.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/utils/get_documentation.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/various/attach_example.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/various/ex1.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/various/hello.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/various/remote_exec.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/various/save_images.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/wl/wl_add.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/xarchive/_tutorials/3. simple_real_time_custom_code.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/xarchive/_tutorials/4. real_time_custom_code_2.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/xperimental/xarchive/_tutorials/8. chatbot.py +0 -0
- {ratio1-3.4.108 → ratio1-3.4.110}/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.110
|
|
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
|
|
@@ -149,7 +149,7 @@ CLI_COMMANDS = {
|
|
|
149
149
|
"--skip-seeds": "Skip the seed nodes in the rollout (flag)",
|
|
150
150
|
"--skip-oracles": "Skip the oracle nodes in the rollout (flag)",
|
|
151
151
|
"--skip-workers": "Skip the remaining edge worker nodes in the rollout (flag)",
|
|
152
|
-
"--
|
|
152
|
+
"--timeout": "Wait between worker nodes restarts (flag)",
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
"inspect": {
|
|
@@ -222,13 +222,13 @@ if True:
|
|
|
222
222
|
skip_seeds = args.skip_seeds
|
|
223
223
|
skip_oracles = args.skip_oracles
|
|
224
224
|
skip_workers = getattr(args, "skip_workers", False)
|
|
225
|
-
no_timeout = args.
|
|
225
|
+
no_timeout = not args.timeout
|
|
226
226
|
run_seed_nodes = not skip_seeds
|
|
227
227
|
run_oracle_nodes = not skip_oracles
|
|
228
228
|
run_edge_nodes = not skip_workers
|
|
229
229
|
|
|
230
230
|
# Adjust these values to tweak pauses and restart pacing across node groups.
|
|
231
|
-
pause_after_seed_seconds =
|
|
231
|
+
pause_after_seed_seconds = 120
|
|
232
232
|
pause_after_oracle_seconds = 60
|
|
233
233
|
worker_timeout_min_seconds = 5
|
|
234
234
|
worker_timeout_max_seconds = 25
|
|
@@ -255,11 +255,11 @@ if True:
|
|
|
255
255
|
log_with_color("======================================================", color='b')
|
|
256
256
|
log_with_color("Starting Oracle Rollout...", color='g')
|
|
257
257
|
log_with_color("======================================================", color='b')
|
|
258
|
+
|
|
258
259
|
session = Session(
|
|
259
260
|
silent=True
|
|
260
261
|
)
|
|
261
262
|
current_network = session.bc_engine.current_evm_network
|
|
262
|
-
session.close()
|
|
263
263
|
|
|
264
264
|
restart_plan_display = " -> ".join(restart_groups)
|
|
265
265
|
confirmation_keyword = "RESTART ALL" if len(restart_groups) == 3 else f"RESTART {', '.join(restart_groups)}"
|
|
@@ -282,11 +282,11 @@ if True:
|
|
|
282
282
|
log_with_color("Aborted by user...", color='y')
|
|
283
283
|
return
|
|
284
284
|
|
|
285
|
-
session =
|
|
286
|
-
|
|
287
|
-
)
|
|
285
|
+
session.log.silent = silent
|
|
286
|
+
session.silent = silent
|
|
288
287
|
|
|
289
288
|
seed_nodes_addresses = _get_seed_nodes(current_network)
|
|
289
|
+
seed_nodes_aliases = [session.get_node_alias(addr) for addr in seed_nodes_addresses]
|
|
290
290
|
|
|
291
291
|
all_online_nodes = _get_all_online_nodes()
|
|
292
292
|
remaining_nodes = [
|
|
@@ -301,25 +301,36 @@ if True:
|
|
|
301
301
|
|
|
302
302
|
if run_seed_nodes:
|
|
303
303
|
# 1. Send restart command to Seed Nodes.
|
|
304
|
-
log_with_color(
|
|
305
|
-
|
|
304
|
+
log_with_color(
|
|
305
|
+
f"Sending restart commands to {len(seed_nodes_addresses)} seed nodes: {seed_nodes_aliases}",
|
|
306
|
+
color='b'
|
|
307
|
+
)
|
|
306
308
|
_send_restart_command(session=session, nodes=seed_nodes_addresses)
|
|
309
|
+
|
|
310
|
+
# now check heartbeats for SHUTDOWN confirmation individually
|
|
311
|
+
# ... we display one by one the status with timeout `pause_after_seed_seconds`
|
|
312
|
+
# here all seeds restarted so we check recent heartbeats for each of them
|
|
313
|
+
# ... we display one by one the status with timeout `pause_after_seed_seconds`
|
|
314
|
+
# now finally we confirm all seeds are back online
|
|
307
315
|
restarted_seed_nodes_count = len(seed_nodes_addresses)
|
|
308
316
|
|
|
309
317
|
# Remove seed node addresses from all_nodes_addresses
|
|
310
318
|
if run_oracle_nodes or run_edge_nodes:
|
|
311
319
|
if pause_after_seed_seconds > 0:
|
|
312
320
|
log_with_color(
|
|
313
|
-
f"Seed nodes
|
|
314
|
-
color='g'
|
|
315
|
-
|
|
321
|
+
f"Seed nodes restarting. Waiting {pause_after_seed_seconds} seconds before sending restart commands to the next group of nodes.",
|
|
322
|
+
color='g'
|
|
323
|
+
)
|
|
324
|
+
sleep(pause_after_seed_seconds) # maybe obsolete due to per-node wait above
|
|
316
325
|
else:
|
|
317
326
|
log_with_color(
|
|
318
|
-
"Seed nodes
|
|
319
|
-
color='g'
|
|
327
|
+
"Seed nodes restarting. Continuing without wait before the next group of nodes.",
|
|
328
|
+
color='g'
|
|
329
|
+
)
|
|
320
330
|
else:
|
|
321
331
|
log_with_color("Skipping Seed Nodes restart as per user request.", color='y')
|
|
322
|
-
|
|
332
|
+
|
|
333
|
+
|
|
323
334
|
# 2. Send restart commands to all Oracle nodes, except seed nodes.
|
|
324
335
|
oracle_nodes_addresses = [
|
|
325
336
|
node['address']
|
|
@@ -330,8 +341,8 @@ if True:
|
|
|
330
341
|
if run_oracle_nodes:
|
|
331
342
|
log_with_color(
|
|
332
343
|
f"Sending restart commands to {len(oracle_nodes_addresses)} Non-Seed Oracle nodes, except seed nodes: {remaining_nodes}",
|
|
333
|
-
color='b'
|
|
334
|
-
|
|
344
|
+
color='b'
|
|
345
|
+
)
|
|
335
346
|
_send_restart_command(session=session, nodes=oracle_nodes_addresses)
|
|
336
347
|
restarted_oracle_nodes_count = len(oracle_nodes_addresses)
|
|
337
348
|
if run_edge_nodes:
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ex26_cerviguard_war_loopback.py
|
|
3
|
+
---------------------------------
|
|
4
|
+
|
|
5
|
+
CerviGuard WAR - Loopback Pipeline Testing
|
|
6
|
+
|
|
7
|
+
This tutorial demonstrates the complete CerviGuard WAR (Web Application Resource)
|
|
8
|
+
architecture using the loopback mechanism to test image processing pipelines.
|
|
9
|
+
|
|
10
|
+
Architecture:
|
|
11
|
+
1. LOCAL_SERVING_API (FastAPI backend, IS_LOOPBACK_PLUGIN=True)
|
|
12
|
+
- Receives images from UI via REST endpoints
|
|
13
|
+
- Writes requests to loopback queue
|
|
14
|
+
- Reads from loopback queue in process() loop
|
|
15
|
+
- Calls CERVIGUARD_IMAGE_ANALYZER serving plugin directly
|
|
16
|
+
- Caches results for polling
|
|
17
|
+
|
|
18
|
+
2. Loopback DCT (Data Capture Thread)
|
|
19
|
+
- Reads from shared memory queue
|
|
20
|
+
- Feeds data back into pipeline
|
|
21
|
+
|
|
22
|
+
3. CERVIGUARD_IMAGE_ANALYZER (Serving Plugin - runs in isolated process)
|
|
23
|
+
- Decodes base64 images
|
|
24
|
+
- Extracts dimensions and quality metrics
|
|
25
|
+
- Mockup for future AI model integration
|
|
26
|
+
|
|
27
|
+
4. CerviGuard UI (worker_app_runner - to be added by you)
|
|
28
|
+
- Frontend that interacts with the API
|
|
29
|
+
|
|
30
|
+
Flow:
|
|
31
|
+
UI → POST /cerviguard_submit_image → Write to loopback queue
|
|
32
|
+
→ Loopback DCT feeds back → process() reads from loopback
|
|
33
|
+
→ Calls serving plugin via dataapi_inferences()
|
|
34
|
+
→ Caches result → UI polls via GET /cerviguard_get_result
|
|
35
|
+
|
|
36
|
+
This setup allows you to verify the loopback mechanism works correctly
|
|
37
|
+
before integrating the actual AI model for cervical cancer detection.
|
|
38
|
+
"""
|
|
39
|
+
import json
|
|
40
|
+
import time
|
|
41
|
+
import requests
|
|
42
|
+
import base64
|
|
43
|
+
from ratio1 import Session
|
|
44
|
+
import numpy as np
|
|
45
|
+
from PIL import Image
|
|
46
|
+
import io
|
|
47
|
+
|
|
48
|
+
def encode_image_to_base64(image_path: str) -> str:
|
|
49
|
+
"""
|
|
50
|
+
Encode an image file to base64 string
|
|
51
|
+
|
|
52
|
+
Parameters
|
|
53
|
+
----------
|
|
54
|
+
image_path : str
|
|
55
|
+
Path to the image file
|
|
56
|
+
|
|
57
|
+
Returns
|
|
58
|
+
-------
|
|
59
|
+
str
|
|
60
|
+
Base64 encoded image string
|
|
61
|
+
"""
|
|
62
|
+
with open(image_path, 'rb') as f:
|
|
63
|
+
img_bytes = f.read()
|
|
64
|
+
b64_string = base64.b64encode(img_bytes).decode('utf-8')
|
|
65
|
+
return b64_string
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def test_cerviguard_api(base_url: str, session):
|
|
69
|
+
"""
|
|
70
|
+
Test the CerviGuard API endpoints
|
|
71
|
+
|
|
72
|
+
Parameters
|
|
73
|
+
----------
|
|
74
|
+
base_url : str
|
|
75
|
+
Base URL of the API (e.g., http://localhost:5002)
|
|
76
|
+
session : Session
|
|
77
|
+
The ratio1 session for logging
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
session.P("\n" + "="*70)
|
|
81
|
+
session.P("Testing CerviGuard WAR Loopback Pipeline")
|
|
82
|
+
session.P("="*70 + "\n")
|
|
83
|
+
|
|
84
|
+
# Test 1: Check system status
|
|
85
|
+
session.P("1. Checking CerviGuard system status...", color='b')
|
|
86
|
+
try:
|
|
87
|
+
response = requests.get(f"{base_url}/cerviguard_status")
|
|
88
|
+
session.P(f"Status: {response.status_code}", color='g' if response.status_code == 200 else 'r')
|
|
89
|
+
result = response.json()
|
|
90
|
+
session.P(f"Service: {result['result']['service']}", color='g')
|
|
91
|
+
session.P(f"Version: {result['result']['version']}", color='g')
|
|
92
|
+
session.P(f"Status: {result['result']['status']}", color='g')
|
|
93
|
+
except Exception as e:
|
|
94
|
+
session.P(f"Error: {e}", color='r')
|
|
95
|
+
session.P("Make sure the pipeline is deployed and API is running!", color='r')
|
|
96
|
+
return
|
|
97
|
+
|
|
98
|
+
print()
|
|
99
|
+
|
|
100
|
+
# Test 2: Create a test image (1x1 pixel red image)
|
|
101
|
+
session.P("2. Creating test cervical image (mockup)...", color='b')
|
|
102
|
+
|
|
103
|
+
# Create a small test image (100x100 red square)
|
|
104
|
+
test_img = np.zeros((100, 100, 3), dtype=np.uint8)
|
|
105
|
+
test_img[:, :, 0] = 255 # Red channel
|
|
106
|
+
|
|
107
|
+
# Convert to PIL Image
|
|
108
|
+
pil_img = Image.fromarray(test_img)
|
|
109
|
+
|
|
110
|
+
# Convert to base64
|
|
111
|
+
buffer = io.BytesIO()
|
|
112
|
+
pil_img.save(buffer, format='PNG')
|
|
113
|
+
img_base64 = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
|
114
|
+
|
|
115
|
+
session.P(f"Created test image: 100x100 pixels, RGB", color='g')
|
|
116
|
+
session.P(f"Base64 length: {len(img_base64)} characters", color='g')
|
|
117
|
+
|
|
118
|
+
print()
|
|
119
|
+
|
|
120
|
+
# Test 3: Submit image for processing
|
|
121
|
+
session.P("3. Submitting image to CerviGuard API...", color='b')
|
|
122
|
+
|
|
123
|
+
try:
|
|
124
|
+
response = requests.post(
|
|
125
|
+
f"{base_url}/cerviguard_submit_image",
|
|
126
|
+
json={
|
|
127
|
+
"image_data": img_base64,
|
|
128
|
+
"metadata": {
|
|
129
|
+
"patient_id": "TEST-001",
|
|
130
|
+
"capture_date": "2025-01-01",
|
|
131
|
+
"test_mode": True
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
session.P(f"Status: {response.status_code}", color='g' if response.status_code == 200 else 'r')
|
|
137
|
+
result = response.json()
|
|
138
|
+
|
|
139
|
+
if result.get('result', {}).get('status') == 'submitted':
|
|
140
|
+
request_id = result['result']['request_id']
|
|
141
|
+
session.P(f"Request ID: {request_id}", color='g')
|
|
142
|
+
session.P(f"Poll endpoint: {result['result']['poll_endpoint']}", color='g')
|
|
143
|
+
|
|
144
|
+
print()
|
|
145
|
+
|
|
146
|
+
# Test 4: Poll for results
|
|
147
|
+
session.P("4. Polling for results (loopback processing)...", color='b')
|
|
148
|
+
|
|
149
|
+
max_attempts = 10
|
|
150
|
+
attempt = 0
|
|
151
|
+
result_data = None
|
|
152
|
+
|
|
153
|
+
while attempt < max_attempts:
|
|
154
|
+
attempt += 1
|
|
155
|
+
time.sleep(1) # Wait 1 second between polls
|
|
156
|
+
|
|
157
|
+
session.P(f" Polling attempt {attempt}/{max_attempts}...", color='y')
|
|
158
|
+
|
|
159
|
+
response = requests.get(
|
|
160
|
+
f"{base_url}/cerviguard_get_result",
|
|
161
|
+
params={"request_id": request_id}
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
if response.status_code == 200:
|
|
165
|
+
poll_result = response.json()
|
|
166
|
+
status = poll_result.get('result', {}).get('status')
|
|
167
|
+
|
|
168
|
+
if status == 'completed':
|
|
169
|
+
result_data = poll_result['result']['result']
|
|
170
|
+
session.P(f" ✓ Processing completed!", color='g')
|
|
171
|
+
break
|
|
172
|
+
elif status == 'processing':
|
|
173
|
+
session.P(f" ⏳ Still processing...", color='y')
|
|
174
|
+
elif status == 'error':
|
|
175
|
+
session.P(f" ✗ Error: {poll_result.get('result', {}).get('error')}", color='r')
|
|
176
|
+
break
|
|
177
|
+
else:
|
|
178
|
+
session.P(f" Unknown status: {status}", color='y')
|
|
179
|
+
else:
|
|
180
|
+
session.P(f" HTTP error: {response.status_code}", color='r')
|
|
181
|
+
break
|
|
182
|
+
|
|
183
|
+
print()
|
|
184
|
+
|
|
185
|
+
# Test 5: Display results
|
|
186
|
+
if result_data:
|
|
187
|
+
session.P("5. Processing Results (via Loopback Pipeline):", color='b')
|
|
188
|
+
session.P("="*70, color='g')
|
|
189
|
+
|
|
190
|
+
if result_data.get('status') == 'completed':
|
|
191
|
+
img_info = result_data.get('image_info', {})
|
|
192
|
+
session.P(f" Image Dimensions:", color='g')
|
|
193
|
+
session.P(f" Width: {img_info.get('width')} pixels", color='w')
|
|
194
|
+
session.P(f" Height: {img_info.get('height')} pixels", color='w')
|
|
195
|
+
session.P(f" Channels: {img_info.get('channels')}", color='w')
|
|
196
|
+
session.P(f" Total Pixels: {img_info.get('total_pixels'):,}", color='w')
|
|
197
|
+
session.P(f" Size: {img_info.get('size_mb')} MB", color='w')
|
|
198
|
+
session.P(f" Data Type: {img_info.get('dtype')}", color='w')
|
|
199
|
+
session.P(f" Shape: {img_info.get('shape')}", color='w')
|
|
200
|
+
session.P("", color='w')
|
|
201
|
+
session.P(f" Processing Info:", color='g')
|
|
202
|
+
session.P(f" Processor Version: {result_data.get('processor_version')}", color='w')
|
|
203
|
+
session.P(f" Processed At: {result_data.get('processed_at')}", color='w')
|
|
204
|
+
|
|
205
|
+
session.P("="*70, color='g')
|
|
206
|
+
session.P("\n✓ Loopback pipeline working correctly!", color='g', boxed=True)
|
|
207
|
+
session.P(" The image went through the complete flow:", color='g')
|
|
208
|
+
session.P(" 1. Submitted to LOCAL_SERVING_API endpoint", color='w')
|
|
209
|
+
session.P(" 2. Written to loopback queue (IS_LOOPBACK_PLUGIN=True)", color='w')
|
|
210
|
+
session.P(" 3. Loopback DCT feeds data back to pipeline", color='w')
|
|
211
|
+
session.P(" 4. LOCAL_SERVING_API process() reads from loopback", color='w')
|
|
212
|
+
session.P(" 5. Calls CERVIGUARD_IMAGE_ANALYZER serving plugin", color='w')
|
|
213
|
+
session.P(" 6. Result cached in LOCAL_SERVING_API", color='w')
|
|
214
|
+
session.P(" 7. Retrieved via API polling endpoint", color='w')
|
|
215
|
+
else:
|
|
216
|
+
session.P(f" Status: {result_data.get('status')}", color='y')
|
|
217
|
+
session.P(f" Error: {result_data.get('error', 'Unknown')}", color='r')
|
|
218
|
+
else:
|
|
219
|
+
session.P("5. ✗ No results received after polling", color='r')
|
|
220
|
+
session.P(" Check edge node logs for issues", color='y')
|
|
221
|
+
|
|
222
|
+
else:
|
|
223
|
+
session.P(f"Failed to submit image: {result}", color='r')
|
|
224
|
+
|
|
225
|
+
except Exception as e:
|
|
226
|
+
session.P(f"Error during testing: {e}", color='r')
|
|
227
|
+
import traceback
|
|
228
|
+
session.P(traceback.format_exc(), color='r')
|
|
229
|
+
|
|
230
|
+
print()
|
|
231
|
+
session.P("="*70)
|
|
232
|
+
session.P("CerviGuard WAR Testing Complete")
|
|
233
|
+
session.P("="*70 + "\n")
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
if __name__ == "__main__":
|
|
237
|
+
# Create a session
|
|
238
|
+
session = Session(silent=False)
|
|
239
|
+
|
|
240
|
+
# Get target node from environment or use default
|
|
241
|
+
# node = os.environ.get("EE_TARGET_NODE", "INSERT_YOUR_NODE_ADDRESS_HERE")
|
|
242
|
+
node = "0xai_Avvuy6USRwVfbbxEG2HPiCz85mSJle3zo2MbDh5kBD-g"
|
|
243
|
+
|
|
244
|
+
session.P(f"Deploying CerviGuard WAR Loopback Pipeline to {node}...", color='b', boxed=True)
|
|
245
|
+
session.wait_for_node(node)
|
|
246
|
+
|
|
247
|
+
# Pipeline configuration with TWO components:
|
|
248
|
+
# 1. Loopback DCT (reads from queue and feeds back)
|
|
249
|
+
# 2. LOCAL_SERVING_API (writes to queue, reads from queue, calls serving plugin)
|
|
250
|
+
# Note: CERVIGUARD_IMAGE_ANALYZER serving plugin is called via AI_ENGINE config
|
|
251
|
+
|
|
252
|
+
pipeline_config = {
|
|
253
|
+
"NAME": "cerviguard_demo",
|
|
254
|
+
"TYPE": "Loopback", # CRITICAL: Use Loopback DCT
|
|
255
|
+
"LOOPBACK_QUEUE_SIZE": 32,
|
|
256
|
+
|
|
257
|
+
"PLUGINS": [
|
|
258
|
+
# Backend API (receives images, writes to loopback, reads from loopback, calls serving)
|
|
259
|
+
{
|
|
260
|
+
"SIGNATURE": "LOCAL_SERVING_API",
|
|
261
|
+
"INSTANCES": [
|
|
262
|
+
{
|
|
263
|
+
"PORT": 5002,
|
|
264
|
+
"INSTANCE_ID": "cerviguard_api",
|
|
265
|
+
"AI_ENGINE": "CERVIGUARD_IMAGE_ANALYZER", # Serving plugin to use
|
|
266
|
+
"LOG_REQUESTS": True,
|
|
267
|
+
"RESPONSE_FORMAT": "WRAPPED",
|
|
268
|
+
"RESULT_CACHE_TTL": 300, # Keep results for 5 minutes
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
# TODO: Add your CerviGuard UI plugin here
|
|
274
|
+
# {
|
|
275
|
+
# "SIGNATURE": "YOUR_CERVIGUARD_UI_WORKER_APP",
|
|
276
|
+
# "INSTANCES": [{"INSTANCE_ID": "ui_01"}]
|
|
277
|
+
# }
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
session.P("\nPipeline Configuration:", color='b')
|
|
282
|
+
session.P(json.dumps(pipeline_config, indent=2), color='w')
|
|
283
|
+
|
|
284
|
+
# Deploy the pipeline
|
|
285
|
+
session.P("\nDeploying pipeline...", color='b')
|
|
286
|
+
|
|
287
|
+
# Create the pipeline with Loopback data source
|
|
288
|
+
pipeline = session.create_pipeline(
|
|
289
|
+
node=node,
|
|
290
|
+
name=pipeline_config["NAME"],
|
|
291
|
+
data_source=pipeline_config["TYPE"], # "Loopback"
|
|
292
|
+
config={
|
|
293
|
+
"LOOPBACK_QUEUE_SIZE": pipeline_config["LOOPBACK_QUEUE_SIZE"]
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
# Add the LOCAL_SERVING_API plugin
|
|
298
|
+
# This plugin handles everything: API endpoints, loopback, and serving plugin calls
|
|
299
|
+
session.P("Adding LOCAL_SERVING_API plugin...", color='b')
|
|
300
|
+
api_instance = pipeline.create_plugin_instance(
|
|
301
|
+
signature='LOCAL_SERVING_API',
|
|
302
|
+
instance_id='cerviguard_api',
|
|
303
|
+
log_requests=True,
|
|
304
|
+
response_format='WRAPPED',
|
|
305
|
+
port=5082,
|
|
306
|
+
ai_engine='CERVIGUARD_IMAGE_ANALYZER', # This serving plugin runs in isolated process
|
|
307
|
+
result_cache_ttl=300,
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
# Deploy the pipeline
|
|
311
|
+
session.P("Deploying pipeline to node...", color='b')
|
|
312
|
+
pipeline.deploy()
|
|
313
|
+
|
|
314
|
+
# Wait for deployment
|
|
315
|
+
session.P("Waiting for pipeline to be fully deployed...", color='b')
|
|
316
|
+
time.sleep(8)
|
|
317
|
+
|
|
318
|
+
# The API should be accessible on localhost
|
|
319
|
+
# Port is configured in plugin config as 5082
|
|
320
|
+
base_url = "http://localhost:5082"
|
|
321
|
+
|
|
322
|
+
session.P(f"\n" + "="*70, color='g')
|
|
323
|
+
session.P(f"CerviGuard WAR Backend Deployed!", color='g', boxed=True)
|
|
324
|
+
session.P(f"="*70, color='g')
|
|
325
|
+
session.P(f"API URL: {base_url}", color='g')
|
|
326
|
+
session.P(f"Pipeline: {pipeline_config['NAME']}", color='g')
|
|
327
|
+
session.P(f"Loopback: ENABLED", color='g')
|
|
328
|
+
session.P(f"="*70 + "\n", color='g')
|
|
329
|
+
|
|
330
|
+
# Give the server a bit more time to start
|
|
331
|
+
session.P("Waiting for API server to be ready...", color='b')
|
|
332
|
+
time.sleep(30)
|
|
333
|
+
|
|
334
|
+
# Run tests
|
|
335
|
+
test_cerviguard_api(base_url, session)
|
|
336
|
+
|
|
337
|
+
# Show API endpoints
|
|
338
|
+
session.P("\n" + "="*70)
|
|
339
|
+
session.P("Available CerviGuard API Endpoints:")
|
|
340
|
+
session.P("="*70)
|
|
341
|
+
session.P(f" POST {base_url}/cerviguard_submit_image", color='g')
|
|
342
|
+
session.P(f" - Submit cervical image for analysis", color='w')
|
|
343
|
+
session.P(f" - Body: {{'image_data': '<base64>', 'metadata': {{...}}}}", color='w')
|
|
344
|
+
session.P("")
|
|
345
|
+
session.P(f" GET {base_url}/cerviguard_get_result?request_id=<id>", color='g')
|
|
346
|
+
session.P(f" - Poll for processing results", color='w')
|
|
347
|
+
session.P("")
|
|
348
|
+
session.P(f" GET {base_url}/cerviguard_status", color='g')
|
|
349
|
+
session.P(f" - Check system status", color='w')
|
|
350
|
+
session.P("="*70 + "\n")
|
|
351
|
+
|
|
352
|
+
# Integration instructions
|
|
353
|
+
session.P("Next Steps for CerviGuard UI Integration:", color='y', boxed=True)
|
|
354
|
+
session.P("1. Add your CerviGuard UI worker_app to the pipeline", color='w')
|
|
355
|
+
session.P("2. From UI JavaScript, call the API endpoints:", color='w')
|
|
356
|
+
session.P(" - Submit image: POST /cerviguard_submit_image", color='w')
|
|
357
|
+
session.P(" - Poll results: GET /cerviguard_get_result?request_id=<id>", color='w')
|
|
358
|
+
session.P("3. Display the image analysis results in your UI", color='w')
|
|
359
|
+
session.P("4. The serving plugin runs in isolated process for fault isolation", color='w')
|
|
360
|
+
session.P("5. Later: Enhance CERVIGUARD_IMAGE_ANALYZER with actual AI model", color='w')
|
|
361
|
+
session.P("")
|
|
362
|
+
|
|
363
|
+
# Keep running
|
|
364
|
+
session.P("Press Ctrl+C to stop and cleanup...", color='y')
|
|
365
|
+
|
|
366
|
+
try:
|
|
367
|
+
session.run(
|
|
368
|
+
wait=True,
|
|
369
|
+
close_pipelines=True
|
|
370
|
+
)
|
|
371
|
+
except KeyboardInterrupt:
|
|
372
|
+
session.P("\nStopping and cleaning up...", color='y')
|
|
373
|
+
|
|
374
|
+
session.P("\nCerviGuard WAR tutorial completed!", color='g', boxed=True)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import json
|
|
3
|
+
from time import sleep
|
|
3
4
|
from collections import defaultdict
|
|
4
5
|
|
|
5
6
|
|
|
@@ -14,15 +15,17 @@ if __name__ == '__main__' :
|
|
|
14
15
|
eng = DefaultBlockEngine(
|
|
15
16
|
log=l, name="default",
|
|
16
17
|
config={
|
|
17
|
-
"PEM_FILE": "
|
|
18
|
+
"PEM_FILE": "sms.pem",
|
|
18
19
|
}
|
|
19
20
|
)
|
|
20
21
|
|
|
21
22
|
responders = {}
|
|
22
23
|
|
|
23
|
-
eng.reset_network("
|
|
24
|
+
eng.reset_network("mainnet")
|
|
24
25
|
|
|
25
|
-
for
|
|
26
|
+
for i in range(50):
|
|
27
|
+
sleep(1)
|
|
28
|
+
l.P(f"Running dauth autocomplete check #{i+1}...", show=True)
|
|
26
29
|
d = eng.dauth_autocomplete(
|
|
27
30
|
# dauth_endp='N/Adhstrgredshtfnfnhgm',
|
|
28
31
|
add_env=False,
|
|
@@ -41,8 +44,12 @@ if __name__ == '__main__' :
|
|
|
41
44
|
'alias': server_alias, 'count': 0,
|
|
42
45
|
'eth_addr' : server_eth_addr,
|
|
43
46
|
'auth_data' : auth_len,
|
|
47
|
+
'mqtt' : [],
|
|
44
48
|
}
|
|
45
49
|
responders[server_node_addr]['count'] += 1
|
|
50
|
+
mqtt_set = set(responders[server_node_addr]['mqtt'])
|
|
51
|
+
mqtt_set.add(d['result']['auth'].get('EE_MQTT_HOST', None))
|
|
52
|
+
responders[server_node_addr]['mqtt'] = list(mqtt_set)
|
|
46
53
|
except:
|
|
47
54
|
pass
|
|
48
55
|
print(f'Got the response: {d} !')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|