Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add router management functions to SDK (#155)
* Refactor swagger/openapi specs for sdk * Add autogenerated openapi classes for routers * Rewrote OpenAPI spec for ExperimentConfig to avoid using oneOf * Remove dependency of ExperimentConfig schema on ExperimentEngineType * Add additional fields for enricher component * Add additional nullable fields to OpenAPI spec * Reference ensembler, event and router id to common id schema * Rename Ensembler in OpenAPI spec for routers to RouterEnsemblerConfig * Reorganise router related tests * Refactor route tests to utilise predefined fixtures * Add resource_request sdk classes and tests * Add RouterEnsemblerConfig sdk and classes * Move common router components to separate file * Refactor RouterEnsemblerConfig to use common schemas * Add Enricher sdk classes and tests * Add ExperimentEngine sdk class * Add fix to enforce project_id in ExperimentConfig to be read as int * Refactor regex checks for cpu and memory requests * Add create router tests * Refactor string checks and add docstrings * Rewrite router test case * Modify min/max replica comparison check to allow equality * Refactor swagger/openapi specs for sdk * Add autogenerated openapi classes for routers * Rewrote OpenAPI spec for ExperimentConfig to avoid using oneOf * Remove dependency of ExperimentConfig schema on ExperimentEngineType * Add additional fields for enricher component * Add additional nullable fields to OpenAPI spec * Reference ensembler, event and router id to common id schema * Rename Ensembler in OpenAPI spec for routers to RouterEnsemblerConfig * Refactor route tests to utilise predefined fixtures * Add resource_request sdk classes and tests * Add RouterEnsemblerConfig sdk and classes * Move common router components to separate file * Refactor RouterEnsemblerConfig to use common schemas * Add Enricher sdk classes and tests * Add ExperimentEngine sdk class * Add fix to enforce project_id in ExperimentConfig to be read as int * Refactor regex checks for cpu and memory requests * Add create router tests * Refactor string checks and add docstrings * Rewrite router test case * Modify min/max replica comparison check to allow equality * Refactor Enricher, LogConfig, Route, RouterConfig, RouterEnsemblerConfig into dataclasses * Remove regex validation from SDK and move them to OpenAPI spec * Reinsert missing semi-colon in js file * Correct regex strings in OpenApi spec * Rearrange modules in SDK * Add all router API endpoints and reformat response schema for delete router operation * Add delete router method to router sdk class * Add SDK method for getting router by router_id * Add SDK method for updating router config * Add deploy and undeploy router SDK functions * Add tests for create/delete/deploy/undeploy router SDK methods * Add tests for undeploy router SDK method * Add get/delete router version SDK methods * Add tests for get/delete router version SDK methods * Add deploy version/get events router SDK methods * Add list router versions SDK method * Reorganise router module * Add sample file to demonstrate the use of the router class in the SDK * Add docstrings to RouterVersion * Replace print with logging statements and fix comments * Regroup import statements * Add global numbers to implementation of to_dict * Add wait methods for routers to sample; move location of RouterStatus * Replace kwargs with empty dict when created OpenAPI ExperimentConfig * Refactor log_config fixture * Implement logging and tests for blocking functions * Add additional debugging statements for sample * Refactor blocking functions to take floats * Add dataclass implementation to config classes * Remove extra comma in class definition * Add additional sleep duration to ensure router dependencies are undeployed in sample * Add support for experiment plugin configs * Remove plugin_config from SDK and OpenAPI spec * Remove plugin_config from autogenerated classes * Fix update method of Router class to ensure all attributes are updated * Replace images with generic images from Docker Hub * Use generic images and names for tests * Add additional sample to demonstrate creating a new router from an existing one * Remove redundant imports * Wrap sleep statements into router blocking functions Co-authored-by: ewezy <ziyi.ewe@gojek.com>
- Loading branch information