Stateless triggering and execution of interactive computing kernels

Methods, systems and apparatus for the stateless triggering and execution of code cell of computational documents residing on a server. The system may use an API layer to receive triggers from a client device, interpret the triggers to identify code cells to be executed, identify the computational documents on the server in which code cells reside, schedule the execution of the code cells, collect the results of the execution of the code cells and send those results back to the client device.

FIELD

The present invention relates generally to systems, tools and methods to allow for the stateless triggering and execution of interactive computing kernels.

BACKGROUND

Interactive development environments and computing platforms allow users to configure and arrange workflows in data science, scientific computing, computational journalism, and machine learning. These platforms let users create and share computational documents with one another. The computational documents mix code, results of running the code in graphical form and documentation in a single document.

Deployment of code from computational documents traditionally is only performed by converting the code into a program or script file that must then be run by a server.

SUMMARY

The system and methods described herein provide for the stateless triggering and execution of one or more execution cells of one or more computational documents. In some embodiments, the system may comprise a client device, wherein the client device comprises a processing unit configured to execute a client application module.

In some embodiments the system may further comprise a server, wherein the server further comprises memory, a server processing unit, a network module, one or more computational documents and an application programming interface (API). Each of the one or more computational documents may comprise one or more execution cells and one or more execution results cells.

In some embodiments, application programming interface (API) may comprise a trigger handler module, an execution scheduling module, a resource configuration module, a cell execution module and an output channel module. The trigger handler module may be configured to receive a trigger from the client application module. The execution scheduling module may be configured to schedule execution of the one or more execution cells of the one or more computational documents. The scheduling of execution may be based at least partly on the trigger. The resource configuration module may be configured to allocate one or more server resources to the one or more execution cells. The allocating may be based at least partly on the trigger. The cell execution module may be configured to receive a reference to each of the one or more execution cells. The cell execution module may be further configured to execute each execution cell based at least partly on the trigger, the received reference, the scheduling of the execution scheduling module and the allocating of resources by the resource configuration module. The output channel module may be configured to identify one or more of the one or more execution results cells, store the identified one or more execution results cells in one or more output payloads and send, over one or more output channels, the one or more payloads to the client application module.

In some embodiments, the trigger may comprise an execution context, one or more input parameters, an output selector, one or more output variables, one or more output channels, a resource configuration, a scheduler configuration, a chaining configuration, a replay/retry configuration, a raw inputs array and/or a file map.

In some embodiments, there may be one or more execution contexts, one or more output selectors, one or more resource configurations, one or more scheduler configurations, one or more chaining configurations, one or more replay/retry configurations, one or more chaining configurations, one or more raw inputs arrays and/or one or more file maps.

In some embodiments, the trigger may be an HTTP based API call, webhook or event bridge.

In some embodiments, the identifying one or more of the one or more execution results cells may be based on the output selector of the trigger.

In some embodiments, the one or more output channels may comprise an HTTP response body, a webhook, an event bridge, a WebRTC client, a message queue or storage.

In some embodiments, each of the one or more payloads may be sent over one of the one or more output channels based on the trigger. In some embodiments, all of the one or more payloads are sent over a single output channel. In some embodiments, a plurality of output channels may be used to send a plurality of payloads.

The features and components of these embodiments will be described in further detail in the description which follows. Additional features and advantages will also be set forth in the description which follows, and in part will be implicit from the description, or may be learned by the practice of the embodiments. The detailed description and specific examples are intended for illustration only and are not intended to limit the scope of the disclosure.

DETAILED DESCRIPTION

FIG.1is a diagram illustrating an exemplary computational document development and deployment environment100in which some embodiments may operate. The computational document development and deployment environment100may comprise one or more client devices105, one or more servers110, one or more datastores115and one or more networks130.

The client devices105may be any computing device capable of communicating over network130. The client devices105may be integrated into a notebook computer, smartphone, personal digital assistant, desktop computer, tablet computer, or other computing device.

Server110may be one or more physical or virtual machines configured to communicate with the one or more client devices105and the one or more datastores115. The one or more servers110may be configured as a distributed computing infrastructure and processing of applications and other software may be carried out on the cloud. In some embodiments, the server110may be configured to receive one or more triggers from the one or more client devices105. The server110may also compose an application programming interface (API), wherein the API exposes, to client devices105and modules operating on the client devices, one or more computational documents and one or more cells of the one or more computational documents,

Datastores115may communicate with one another over network130. Datastores115may be any storage device capable of storing data for processing or as a result of processing information at the client devices105and/or servers110. The datastores115may be a separate device or the same device as server110. The datastores115may be located in the same location as that of server110, or at separate locations.

Network130may be an intranet, internet, mesh, LTE, GSM, peer-to-peer or other communication network that allows the one or more servers110to communicate with the one or more client devices105and datastores115.

FIG.2Ais a diagram illustrating an exemplary client device105in accordance with aspects of the present disclosure. Client device105may comprise network module201, datastore module202, display module203, UI module204and client application module205. Network module201may transmit and receive data from other computing systems via a network. In some embodiments, the network module201may enable transmitting and receiving data from the Internet. Data received by the network module201may be used by the other modules. The modules may transmit data through the network module201.

The datastore module202may be configured to store information generated by the one or more modules operating on the client device105. The one or more modules operating on the client device105may also retrieve information from the datastore module202.

Display module203may be any device configured to display graphical representations of information (LCD display, OLED display, DLP display, etc.).

UI module204may be configured to allow a user to create, modify/edit and/or initiate execution of one or more code cells in one or more computational documents. In some embodiments, the user may interact with the one or more code cells through the UI module204. In some embodiments, the user may interact with a computational document residing on the client device. Code execution requests may be generated by the UI module204based on the user interaction with the computational document. The code execution requests may be sent to server110to trigger the execution of code cells. In some embodiments, UI module204may also be configured to receive code execution responses from the server110. Result cells associated with the executed code cells may be configured to receive and display these code execution responses.

In some embodiments, the computational document may reside on server110, and the UI module204may be configured to allow the user to interact with the computational documents and code cells of the computational documents in the same manner as described above with regards to computational documents that reside on the client device.

Client application module205may be configured to generate one or more API triggers. The one or more API triggers may comprise one or more execution contexts, one or more input parameters, one or more scoped input parameters, one or more global input parameters, one or more output selectors, one or more output variables, one or more output channels, one or more resource configurations, one or more scheduler configurations, one or more chaining configurations, one or more replay/retry configurations, one or more raw inputs arrays, one or more file maps or combination thereof. In some embodiments, the one or more API triggers may be sent from the client application module205to an API layer residing on the server110.

For example, the client application module205may be configured to trigger the execution of a plurality of code cells, wherein the code cells reside in different computational documents. The client application module may generate an API trigger with a list of code cells to be executed, references to the computational document in which each code cell resides, the location of each code cell within that computational document, an order in which to execute the code cells in the list of code cells, an array of input values to be used in the execution of the code cells and other operational parameters needed for the execution. The client application module205may then send the API trigger to the API layer operating on the server110to facilitate the execution of the specified cells and the return of the results corresponding to the execution. The client application module205may then receive an API output payload sent from the API layer, wherein the API output payload corresponds to the previously sent API trigger.

FIG.2Bis a diagram illustrating an exemplary server110in accordance with aspects of the present disclosure. Server110may comprise network module221, datastore module222and trigger handler module223. Trigger handler module223may further comprise execution scheduling module224, resource configuration module225, cell execution module226and output channel module227.

Trigger handler module223may be configured to receive one or more triggers from client device105. In some embodiments, a trigger may be a signal to the server110that may comprise execution information in the form of trigger parameters. The execution information of a trigger may be in other forms, such as data structures and other digital objects. Trigger parameters may include one or more of the following: execution context, input parameters, scoped input parameters, global input parameters, output selector, output variable, output channel, resource configuration, scheduler configuration, chaining configuration (how computational documents can access each other's data), replay/retry configuration, raw inputs array and a file map. In some embodiments, the triggers may be HTTP based API calls, webhooks or event bridges.

In some embodiments, an execution context may define the cells that are to be executed by using the pair of computational document references and cell references. A computation document reference may specify the computational document that is to be executed. A cell reference may specify the cells of the computational document that are to be executed. In some embodiments, a cell reference may be a cell ID/cell number, name of a named cell, a cell range (range of cell numbers) or combination thereof.

In some embodiments, an input parameter may comprise a key-value pair. The key value pair may be a global variable in the computational document scope before executing any cell. Scoped input parameters may be key-value pairs that define a variable's scoped to a specific cell or group of cells. In some embodiments, a global input parameter may be a key-value pair that may be defined as a variable scoped to all the computational documents chained in a trigger.

In some embodiments, a raw inputs array may be configured to provide raw input values. An execution context may have multiple calls to the raw inputs array, hence, raw inputs may be provided in form of an array. In some embodiments, the form of the raw inputs array may be other data structures configured to store one or more raw inputs for inclusion in the trigger.

In some embodiments, an output selector may be configured to choose the output cells to be sent back as output payload. The output payload may comprise data that is sent over an output channel after the one or more cells have been executed. This data may be the output of cells execute upon a trigger. The output channel may comprise an HTTP response body, Webhook, Event bridge, WebRTC client, Message Queue and/or storage. In some embodiments, the output channel for each cell in the trigger may be different.

In some embodiments, output variables may be variables from global scope or scope of the cells in the execution context that are to be returned over the output response.

In some embodiments, a trigger parameter may contain a file map of identifiers and the binary data of files. In some embodiments, a named cell may be a cell that has a name/id that can be used in the trigger instead of cell number or other identifiers. The file map may also contain some metadata related to the files. For a call like ‘open(<filename>)’ etc., if the filename matches an identifier in the file map, then it may open the corresponding file instead of a file from the disk (local storage of the server).

In some embodiments, a resource configuration may specify which cells should use what resources during execution. In some embodiments, resources may comprise a number of CPUs, GPU memory, or other operational parameters/resources that are to be used by the trigger.

In some embodiments, a scheduler configuration may specify which cells should be scheduled to run asynchronously. A cell may run asynchronously as a CRON Job, async python function or any other asynchronous function.

In some embodiments, a replay configuration may be used to define parameters related to the replaying of cells upon failure. For example, the replay configuration may be set to replay a failed cell a predetermined number of times before halting the operation. This may allow a long chain of cell executions to recover from the failing of a single cell. It may be configured to allow the execution to be resumed without the need to re-run previously executed cells.

In some embodiments, a chaining configuration may be configured to chain together cells in different computational documents. For example, the output of one cell and the global variables in that cell may be exposed to the next cell and so on.

In some embodiments, the one or more triggers may comprise a subset of the possible trigger parameters. In some embodiments, trigger parameters that are missing or left blank may be replaced with a default value by the trigger handler module223. The trigger handler223may further be configured with instructions for handling missing or null trigger parameters. The trigger handler223may be configured to receive one or more default handling profiles for handling missing trigger parameter values. A user may be allowed to create, edit and/or delete the one or more default handling profiles. The user may select one or more default handling profiles to be used for one or more received triggers. In some embodiments, the selection of the one or more default handling profiles to be used by the trigger handler module223may be performed independent of receiving the one or more triggers. For example, a user may interact or interface with the trigger handle module223over a network and issue instruction or otherwise indicate a selection of one or more of the one or more default handling profiles to be used.

In some embodiments, the trigger itself may include a selection of one or more default handling profiles to be used for the current and/or subsequent triggers to use. In some embodiments, the trigger may also include a default handling profile to be added to the trigger handler module223. This default handling profile may be used in the handling of the trigger it was included in, future triggers or combination thereof.

In some embodiments, some trigger parameters may be required while others may be optional. In some embodiments, a trigger parameter that is optional may become required based on a value or content of a required parameter or a value or content of an optional parameter included in the trigger.

In some embodiments, the execution context may be optional and include no values. If the output selector has no value, the trigger handler module223may set the output to be void. The output handler may be configured to be one of a plurality of possible output handlers based on the default handling profile selected used by the trigger handler module223. If the one or more output channels are left empty or not received, the default value may be set to HTTP response.

In some embodiments, the resource configuration, scheduler configuration, chaining configuration, replay/retry configuration, raw inputs array and file map may be optional.

The execution scheduling module224, may be configured to schedule the synchronous and asynchronous execution of the one or more cells identified in the trigger. The execution scheduler may determine the timing of execution of each of the cells.

The resource configuration module225may be configured to allocate resources to one or more of the cells to be processed. In some embodiments, the resource configuration module may allocate resources on a per cell basis. In some embodiments, the resource configuration module may allocate resources to groups of cells and/or all cells identified in the trigger.

The cell execution module226may be configured to execute the commands of the cells. The cell execution module226may receive instructions to execute a cell from the execution scheduling module224as well as access to resources for execution of the cell, provided by the resource configuration module225.

The output channel module227may be configured to determine an output selector, wherein the choosing comprises determining, based on information in the trigger, which output cells are to be sent back as output payload. The chosen output cells may then be aggregated into the output payload. The output channel module227may then send the output payload over an output channel to the trigger source. In some embodiments the trigger source may be a client device105.

FIG.3Ais an exemplary flow diagram300A of the operation of an API in accordance with aspects of the present disclosure. Flow diagram300A shows an API that may be used in the development and/or interactive execution of a computational document. In some embodiments, a user may execute one or more cells of a computational document by sending one or more triggers from a trigger source301to a handler302. The trigger may include one or more lines of code to be executed, references to one or more additional cells in one or more additional computational documents, and other information/resources needed for the scheduling configuration and running of the cells. Handler302may direct the system to run cells immediately303, schedule cells to run304, or configure resources for the cells. When cells are run immediately, the results may be returned to the handle and sent back to the user through an output channel306. When the handler302schedules cells to run304, the cells may be placed into a queue or other list of cells to be run at a future time. Other cells may be run in between the scheduling of a cell to run and the subsequent running of that cell. This may allow for asynchronous execution of cells in a computational document. In some embodiments, the handler may configure resources for cells305, which may then be used by the cell when run. After configuration, the handler302may then proceed to schedule cells to run304before processing additional triggers or cells of a trigger already received.

FIG.3Bis an exemplary flow diagram300B of the operation of an API in accordance with aspects of the present disclosure. Flow diagram300B shows an API that may be used as a deployed system or application. The operation of the API is similar to that recited above with regard toFIG.3A. The deployed API may however differ in the way in which input and output are processed. In some embodiments, a user may execute one or more cells of a computational document by sending one or more triggers from a trigger source301to a handler302, as is performed inFIG.3A. However, after the handler runs the cell immediately303, the results may be stored by the handler to be used in subsequent run cells instead of outputting the results to a user. When a cell requires input, the handler may access predetermined input data to be used in the running of the cells. The predetermined input data may be stored in an array of values that can be used to replace user inputs and simulate the interactive execution of a computational document.

FIG.4Ais an exemplary system diagram showing the operation of an interactive computing environment400A in accordance with aspects of the present disclosure. The interactive computing environment400A may comprise client device105and server110. In some embodiments, client device105may comprise UI module204, wherein the user may interact with a computational document405. The computational document405may comprise code cells406A-N and results407A-N. The user may execute or run the code cells406A-N by sending code execution requests408A-N to server110. The server may perform the operations defined in the code cells406A-N and return the results407A-N by sending code execution responses409A-N to the computational document405. In some embodiments the server110and the client device105may be the same device, and the sending of code execution requests408A-N and returning of code execution responses409A-N may be performed between modules within the device. In some embodiments the server110and the client device105may be different devices, and the sending of code execution requests408A-N and returning of code execution responses409A-N may be performed over a network.

FIG.4Bis an exemplary system diagram showing the operation of an interactive computing environment400B in accordance with aspects of the present disclosure. The interactive computing environment400B ofFIG.4Bmay operate in a similar manner as that of the interactive computing environment400A ofFIG.4A. However, computational document406may be stored/created on server110and the user may access/interact with the computational document406through the UI module204on client device105. In some embodiments, the UI module204may generate code execution requests408A-N corresponding to code cells406A-N and send them to the server. The server may then run the code cells406A-N to generate results407A-N. The results407A-N may then be returned to the client device105and displayed to the user through UI module205.

FIG.4Cis an exemplary system diagram showing the stateless triggering and execution of interactive computing kernels in accordance with aspects of the present disclosure.FIG.4Cshows client device105running a client application module205in communication with server110. Server110may comprise computational document405and API layer410.

In some embodiments, the client application module205may be configured to access and run cells of computational document405by sending API trigger411to the API layer410. The API layer410, after receiving the API trigger411, may run a cell of the computational document by sending a cell trigger413. The results of running the cell may then be returned to the API layer410as cell output414. The API layer410may then be configured to return the results, by sending an API output payload412, to the client application module205.

FIGS.4D-4Eare exemplary system diagrams showing the stateless triggering and execution of interactive computing kernels in accordance with aspects of the present disclosure.FIGS.4D-4Eshow client device105running a client application module205in communication with server110. Server110may comprise computational documents405A-N and API layer410.

In some embodiments, the client application module205may be configured to access and run one or more cells of one or more computational documents405A-N by sending API trigger411to the API layer410. The API layer410, after receiving the API trigger411, may run one or more cells of the one or more computational documents405A-N by sending cell triggers413A-N. The results of running the one or more cells may then be returned to the API layer410as cell outputs414A-N.

In some embodiments, the API trigger411may comprise an ordered list of one or more cells to be run and references to the one or more cells. The references to the one or more cells may comprise a location, name and/or other identification for the computational document in which the cell resides and a position within the document where the cell is located. The ordered list of one or more cells may be stored in a queue by/in the API layer410. A cell trigger413may be generated for each of the cells listed in the queue. Each cell trigger413may be configured to cause an associated cell to run. The results of the running of the associated cell may then be returned to the API layer410through cell output414. In some examples, for every API trigger411received by the API layer410, cell triggers413A-N(corresponding to the cells listed in the trigger) may be generated and sent. For each cell trigger413A-N, a corresponding cell output414A-N may be used to retrieve results from the running of the associated cells. After all the cells listed in the queue have been run and results for each have been received by the API layer410, an API output payload412may be generated. The API output payload may comprise one or more results received as a result of the running of the one or more cells listed in the corresponding API trigger411. API output payload412may then be sent to the client application module205.

In some embodiments, the API trigger411may also comprise one or more arrays of predetermined input values to be used in the running of the referenced one or more cells of the one or more computational documents. The one or more predetermined input values may be stored locally by the API layer as global input variables. These global input variables may be used in the running of the one or more cells. In some embodiments, the global input variables may be used to store results of the running of the one or more cells. In some embodiments, the API layer may store the results of the running of the cells in one or more global result variables. The global result variables may be configured to store intermediate values produced during the running of the cell and/or a final result value determined at the end of running of the cell.

FIG.4Fis an exemplary system diagram showing the stateless triggering and execution of interactive computing kernels in accordance with aspects of the present disclosure.FIG.4Fshows client device105running a UI module205in communication with server110. Server110may comprise computational documents405A-N, user executed computational document405X and API layer410. User executed computational document405X may comprise one or more user executed code cells406X and user executed results407X. In some embodiments, a user may create, access, modify and/or run user executed computational document405X through interaction with UI module204. The UI module204may send one or more code execution request408to the user executed computational document405X. The user executed computational document405X may then run the user executed code cell406X associated with the code execution request408. One or more API triggers411may be generated as the result of running each of the one or more user executed code cells406X. A corresponding API output payload412may then be received for each API trigger411generated. The API output payload412may be received by the user executed code cells406X that generated the corresponding API trigger411or by a user executed results407X associated with the user executed code cells406X. For example, if the API trigger411is generated during an intermediate step of a user executed code cell406X, the API output payload412may be returned to the user executed code cell406X. If the API trigger411results in the final value of the user executed code cell406X, the API output payload412may be returned to the user executed result407X associated with the user executed code cell406X. After the user executed result407X received the API output payload412, a code execution response409may be returned to the UI module204.

InFIG.4F, the operation of the API layer410is the same or similar to that ofFIGS.4C-E. The only difference being the source of the API trigger411.

FIG.5is a flow chart illustrating an exemplary method500that may be performed in accordance with some embodiments.

At step501, the system is configured to receive, by a trigger handler module, a trigger sent from a client application module.

At step502, the system is configured to schedule, by an execution scheduling module, execution of one or more execution cells of one or more computational documents based at least partly on the trigger.

At step503, the system is configured to allocate, by a resource configuration module, one or more server resources to the one or more execution cells based at least partly on the trigger.

At step504, the system is configured to receive, by a cell execution module, a reference to each of the one or more execution cells.

At step505, the system is configured to execute, by the cell execution module, each execution cell based at least partly on the trigger, the received reference, the scheduling of the execution scheduling module and the allocating of resources by the resource configuration module.

At step506, the system is configured to identify, by an output channel module, one or more of the one or more execution results cells.

At step507, the system is configured to store, by the output channel module, the identified one or more execution results cells in one or more output payloads.

At step508, the system is configured to send, by the output channel module, the one or more payloads to the client application module over one or more output channels.

The computer system600may further include a network interface device608to communicate over the network620. The computer system600also may include sensor array trigger handler module630. Trigger handler module630may comprise execution scheduling module631, resource configuration module632, cell execution module633and output channel module634.

Trigger handler module630may comprise execution scheduling module631, resource configuration module632, cell execution module633and output channel module634. Trigger handler module630, execution scheduling module631, resource configuration module632, cell execution module633and output channel module634may be the same or similar to that of trigger handler module223, execution scheduling module224, resource configuration module225, cell execution module226and output channel module227as disclosed inFIG.2B.

The computer system600may further include UI module640and client application module642. UI module640and client application module642may be the same or similar to that of the UI module204and client application module205disclosed inFIG.2A.

The data storage device618may include a machine-readable storage medium624(also known as a computer-readable medium) on which is stored one or more sets of instructions or software626embodying any one or more of the methodologies or functions described herein. The instructions626may also reside, completely or at least partially, within the main memory604and/or within the processing device602during execution thereof by the computer system600, the main memory604and the processing device602also constituting machine-readable storage media. Information, including data used in the processes and methods of the system and the one or more sets of instructions or software, may also be stored in blockchain, as NFTs or other decentralized technologies.