Functions as a service
Some embodiments of the invention provide a method of implementing a FaaS (functions as a service) framework executing in a first cloud for multiple applications operating on multiple machines in the first cloud. The method provides to the FaaS framework (1) multiple sets of credentials for accessing of multiple cloud providers and (2) a set of selection rules for selecting cloud providers from the multiple cloud providers to execute multiple functions for the multiple programs. For each particular function in the multiple functions, the method configures the FaaS framework to use the set of selection rules to select a particular cloud provider from the multiple cloud providers to execute the particular function, and configures the FaaS framework to use a particular set of credentials associated with the selected particular cloud provider from the multiple sets of credentials to forward the particular function to the selected particular cloud provider for execution.
1 . A method of implementing a FaaS (functions as a service) framework executing on one or more machines in a cloud environment to orchestrate the execution of functions requested by a plurality of applications, the method comprising:
providing to the FaaS framework (i) a plurality of sets of credentials for accessing a plurality of cloud providers and (ii) a set of selection rules for selecting cloud providers from the plurality of cloud providers to execute the requested functions; and
configuring the FaaS framework to perform the following steps for each particular function in the requested functions:
use the set of selection rules to select a particular cloud provider from the plurality of cloud providers to execute the particular function; and
transmit to the selected particular cloud provider (i) a particular set of credentials identifying a subscription or tenant of the selected particular cloud provider and (ii) the particular function for execution within the identified subscription or tenant,
wherein for a first function in the requested functions, the FaaS framework transmits a first set of credentials and the first function to a first cloud provider in the plurality of cloud providers,
wherein for a second function in the requested functions, the FaaS framework transmits a second set of credentials and the second function to the first cloud provider, and
wherein the first and second sets of credentials identify different subscriptions or tenants of the first cloud provider.
2 . The method of claim 1 , wherein each set of credentials in the plurality of sets of credentials comprises a set of key-value pairs.
3 . The method of claim 2 , wherein each key-value pair in each set of key-value pairs comprises at least (i) an identifier of a particular cloud provider that the set of key-value pairs provides access to, and (ii) an account identifier associated with the particular cloud provider that the set of key-value pairs provides access to.
4 . The method of claim 1 , wherein the plurality of sets of credentials comprises at least the first and second sets of credentials associated with the first cloud provider, the first set of credentials being associated with a first account of the first cloud provider, and the second set of credentials being associated with a second account of the first cloud provider.
5 . The method of claim 4 , wherein the set of selection rules comprises a particular selection rule that specifies for the first cloud provider to execute functions associated with a first particular attribute using the first account, and for the first cloud provider to execute functions associated with a second particular attribute using the second account.
6 . The method of claim 5 , wherein the first particular attribute comprises a first programming language for executing the functions associated with the first particular attribute, and the second particular attribute comprises a second programming language for executing the functions associated with the second particular attribute.
7 . The method of claim 3 , wherein each key-value pair in each set of key-value pairs further comprises one or more attributes corresponding to the particular cloud provider that the set of key-value pairs provides access to.
8 . The method of claim 1 , wherein the set of selection rules comprises a compatibility rule specifying that if one or more of the requested functions are written in a particular programming language, to select a particular cloud provider that supports the particular programming language.
9 . The method of claim 8 , wherein the set of selection rules further comprises a particular selection rule that specifies logic for selecting between a set of cloud providers that each support the particular programming language.
10 . The method of claim 9 , wherein the particular selection rule specifies to select a cloud provider having a lowest associated cost among the set of cloud providers.
11 . The method of claim 9 , wherein the particular selection rule specifies to select a cloud provider associated with a performance metric that is within a particular range specified by the particular selection rule.
12 . The method of claim 9 , wherein the particular selection rule specifies to select a cloud provider that is most geographically proximate to the cloud environment among the set of cloud providers.
13 . The method of claim 9 , wherein the particular selection rule specifies to randomly select a cloud provider from the set of cloud providers.
14 . A non-transitory machine readable medium storing a program executable by one or more processing units, wherein the program when executed causes the one or more processing units to perform the following steps for implementing a FaaS (functions as a service) framework executing on one or more machines in a cloud environment to orchestrate the execution of functions requested by a plurality of applications:
providing to the FaaS framework (i) a plurality of sets of credentials for accessing a plurality of cloud providers and (ii) a set of selection rules for selecting cloud providers from the plurality of cloud providers to execute the requested functions; and
configuring the FaaS framework to perform the following steps for each particular function in the requested functions:
use the set of selection rules to select a particular cloud provider from the plurality of cloud providers to execute the particular function; and
transmit to the selected particular cloud provider (i) a particular set of credentials identifying a subscription or tenant of the selected particular cloud provider and (ii) the particular function for execution within the identified subscription or tenant,
wherein for a first function in the requested functions, the FaaS framework transmits a first set of credentials and the first function to a first cloud provider in the plurality of cloud providers,
wherein for a second function in the requested functions, the FaaS framework transmits a second set of credentials and the second function to the first cloud provider, and
wherein the first and second sets of credentials identify different subscriptions or tenants of the first cloud provider.
15 . The non-transitory machine readable medium of claim 14 , wherein each set of credentials in the plurality of sets of credentials comprises a set of key-value pairs.
16 . The non-transitory machine readable medium of claim 15 , wherein each key-value pair in each set of key-value pairs comprises at least (i) an identifier of a particular cloud provider that the set of key-value pairs provides access to, and (ii) an account identifier associated with the particular cloud provider that the set of key-value pairs provides access to.
17 . The non-transitory machine readable medium of claim 14 , wherein the plurality of sets of credentials comprises at least the first and second sets of credentials associated with the first cloud provider, the first set of credentials being associated with a first account of the first cloud provider, and the second set of credentials being associated with a second account of the first cloud provider.
18 . The non-transitory machine readable medium of claim 17 , wherein the set of selection rules comprises a particular selection rule that specifies for the first cloud provider to execute functions associated with a first particular attribute using the first account, and for the first cloud provider to execute functions associated with a second particular attribute using the second account.
19 . The non-transitory machine readable medium of claim 18 , wherein the first particular attribute comprises a first programming language for executing the functions associated with the first particular attribute, and the second particular attribute comprises a second programming language for executing the functions associated with the second particular attribute.
20 . The non-transitory machine readable medium of claim 16 , wherein each key-value pair in each set of key-value pairs further comprises one or more attributes corresponding to the particular cloud provider that the set of key-value pairs provides access to.