Tightly coupled parallel applications on a serverless computing system
Systems and methods are described for executing tightly coupled parallel applications on a serverless computing system. A serverless computing system executes user-submitted code in sandboxed environments such as virtual machines or containers. To support execution of parallel applications that require data transfer between instances of the application, the serverless computing system implements an ephemeral mesh network that allows instances of the parallel application to communicate with each other while executing in their respective sandboxes. In some embodiments, a controller or parent application may also connect to the ephemeral mesh network to coordinate execution of the parallel applications. In other embodiments, the parent application may be external to the serverless computing system. The serverless computing system may connect and disconnect sandboxed environments from the ephemeral mesh network as parallel applications start and stop executing, and may remove the network and terminate the parallel applications when the parent application stops executing.
1 . A system comprising:
a data store configured to store computer-executable instructions; and
a processor in communication with the data store, wherein the computer-executable instructions, when executed by the processor, configure the processor to perform operations including:
receiving a parent task execution request from an invoking function to execute a parent task on a serverless computing system;
in response to the parent task execution request, causing the parent task to execute in a first sandboxed environment of the serverless computing system;
receiving, from the parent task, a child task execution request to execute a first instance of a child task comprising an invoked function on the serverless computing system; and
in response to the child task execution request:
dynamically creating an ephemeral mesh network between the first sandboxed environment and a second sandboxed environment of the serverless computing system, wherein the ephemeral mesh network is an invocation-driven dynamically created temporary and distinct network created to enable bilateral communication between the invoking function and the invoked function within a cluster of associated sandboxed environments comprising the first sandboxed environment and the second sandboxed environment, created in response to the request;
causing the first instance of the child task to execute in the second sandboxed environment;
monitoring execution of the parent task; and
in response to a determination that the parent task has ceased executing, removing the ephemeral mesh network between the first sandboxed environment and the second sandboxed environment.
2 . The system of claim 1 , wherein the parent task execution request specifies an Internet Protocol (“IP”) address range for the ephemeral mesh network.
3 . The system of claim 2 , wherein creating the ephemeral mesh network includes assigning an IP address from the IP address range to at least the second sandboxed environment.
4 . The system of claim 1 , wherein the data store is configured to store further computer-executable instructions that, when executed by the processor, configure the processor to perform further operations including:
receiving, from the parent task, a second child task execution request to execute a second instance of the child task on the serverless computing system; and
in response to the second child task execution request:
updating the ephemeral mesh network to include a third sandboxed environment of the serverless computing system; and
causing the second instance of the child task to execute in the third sandboxed environment.
5 . The system of claim 4 , wherein the data store is configured to store further computer-executable instructions that, when executed by the processor, configure the processor to perform further operations including:
in response to a determination that the second instance of the child task has ceased execution, removing the third sandboxed environment from the ephemeral mesh network.
6 . A computer-implemented method comprising:
causing an invoking function of a parent task to execute in a first sandboxed environment of a serverless computing system;
receiving, from the invoking function, a request to execute a first instance of an invoked function in a child task on the serverless computing system;
in response to the request, dynamically creating an ephemeral mesh network between the first sandboxed environment and a second sandboxed environment of the serverless computing system, wherein the ephemeral mesh network is an invocation-driven dynamically created and distinct network created to enable bilateral communication between the invoking function and the invoked function within a cluster of associated sandboxed environments comprising the first sandboxed environment and the second sandboxed environment, temporary, and dynamically created in response to the request;
causing the first instance of the child task to execute in the second sandboxed environment;
monitoring execution of the parent task; and
in response to a determination that the parent task has ceased executing, removing the ephemeral mesh network.
7 . The computer-implemented method of claim 6 further comprising:
in response to the determination that the parent task has ceased executing, terminating execution of the child task.
8 . The computer-implemented method of claim 6 , wherein the first instance of the child task communicates with at least one of the parent task or a second instance of the child task via the ephemeral mesh network.
9 . The computer-implemented method of claim 6 , wherein creating the ephemeral mesh network comprises establishing a connection between a first network interface in the first sandboxed environment and a second network interface in the second sandboxed environment.
10 . The computer-implemented method of claim 9 further comprising creating the first network interface and the second network interface.
11 . The computer-implemented method of claim 6 further comprising, in response to the determination that the parent task has ceased execution, removing the first sandboxed environment.
12 . The computer-implemented method of claim 6 , wherein the parent task waits for at least one instance of the child task to complete execution before the parent task completes execution.
13 . The computer-implemented method of claim 6 , wherein the parent task is associated with a unique ephemeral mesh network identifier.
14 . The computer-implemented method of claim 6 , wherein the first sandboxed environment is on a different host computing device than the second sandboxed environment.
15 . The computer-implemented method of claim 6 , wherein the first sandboxed computing environment comprises one or more of a host computing device, a virtual machine instance, or a container.
16 . A computer-implemented method comprising:
receiving, from an invoking function of a parent task executing in a first sandboxed environment of a serverless computing system, a request to execute a first instance of an invoked function in a child task on the serverless computing system;
in response to the request, dynamically creating an ephemeral mesh network between the first sandboxed environment and a second sandboxed environment of the serverless computing system, wherein the ephemeral mesh network is an invocation-driven dynamically created and distinct network created to enable bilateral communication within a cluster of associated sandboxed environments comprising the first sandboxed environment and the second sandboxed environment, temporary, and dynamically created in response to the request; and
causing the first instance of the child task to execute in the second sandboxed environment.
17 . The computer-implemented method of claim 16 , further comprising in response to a determination that the parent task has ceased executing, removing the ephemeral mesh network.
18 . The computer-implemented method of claim 16 , wherein the child task is a first child task, and wherein the method further comprises receiving, from the parent task, a request to execute a first instance of a second child task on the serverless computing system.
19 . The computer-implemented method of claim 18 , further comprising:
in response to the request to execute the first instance of the second child task on the serverless computing system:
updating the ephemeral mesh network to include a third sandboxed environment of the serverless computing system; and
causing the first instance of the second child task to execute in the third sandboxed environment.
20 . The computer-implemented method of claim 18 , further comprising:
in response to the request to execute the first instance of the second child task on the serverless computing system:
creating a second ephemeral mesh network between the first sandboxed environment and a third sandboxed environment of the serverless computing system; and
causing the first instance of the second child task to execute in the third sandboxed environment.
21 . The system of claim 1 , wherein the cluster of associated sandboxed environments consists of the first sandboxed environment and the second sandboxed environment.
22 . The system of claim 1 , wherein the system comprises a first network, and wherein the dynamically creating the ephemeral mesh network comprises configuring the first network to enable communication within the cluster of associated sandboxed environments via the ephemeral mesh network isolated from other communication on the first network.