Cost-Optimizing Infrastructure Platform with Dynamic Code Execution
Abstract
A comprehensive system has been established comprising a manager and executor running on a default small instance. The system supports various types of invocations, such as REST API and database updates, each delegating responsibility to the executor. The manager's interface allows the definition of API attributes, including endpoint, HTTP method type, authentication methods (basic, OAuth, username, password), script editor, and the name of dynamic scripts. The code execution environment prioritizes efficiency by default, running 10 threads concurrently on a single small instance. Upon invocation, system logs are meticulously generated, capturing essential information for error identification and analysis. Additionally, script logs containing relevant data from the code are extracted, saved, and made accessible to users. The system maintains these script logs for a duration of 10 days, facilitating historical analysis. To optimize resource allocation, the system dynamically manages the instantiation of new instances based on thread utilization. Specifically, if the number of concurrent thread calls surpasses a predefined threshold and there are a significant number of pending requests, a new machine is spawned to handle the additional workload. Furthermore, version control is integrated seamlessly using GitHub, offering inherent versioning advantages. The code files bear the .gvy extension, while metadata files utilize the .md extension. The manager is equipped to validate scripts, providing compilation errors in a user-friendly displayable format. In terms of data persistence, the system database stores essential information about APIs and scripts, including global variables identified by {!}. The manager defaults to applying linting and executing csfixer to address any potential code smells. Additionally, the UI allows users to configure various attributes, fostering a user-friendly environment for script definition and customization. Overall, this abstract encapsulates a versatile and efficient code execution system with robust logging, version control, and resource management capabilities.
Keywords
Dynamic code execution, literals, infrastructure optimization, Runtime code execution, Parsing code