Multi-tenant mode for server-less code execution

By using sub-tenant specific execution environments and IAM policies in the serverless code execution system, the issues of security and efficiency in multi-tenant mode are solved, data isolation and resource management are achieved, and the security and infrastructure utilization of the system are improved. .

CN118696299APending Publication Date: 2024-09-24AMAZON TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280080472.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2021-12-10
Filing Date
2022-12-08
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In a serverless code execution system, how to simultaneously improve operational efficiency and data security in multi-tenant mode and avoid security risks and low infrastructure utilization caused by shared infrastructure.

Method used

Prevent unauthorized access by using subtenant-specific execution environments and Identity Access Management (IAM) policies in a serverless code execution system to ensure that each subtenant has its own dedicated execution environment and manage access to serverless functions based on IAM policies. data exposure and attack surface expansion.

Benefits of technology

It achieves a balance of improving data security and operational efficiency in multi-tenant mode, ensuring the data and resource isolation of each sub-tenant, reducing the attack surface, and improving the overall security of the system and infrastructure utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

Systems and methods for a multi-tenant mode for a server-less code execution system are described. For example, a method may include maintaining a set of execution environments, where each execution environment is associated with a server-free function, where the server-free function is associated with a software as a service (SaaS) provider of a tenant that is a cloud service provider, where the SaaS provider provides services to sub-tenants, where the sub-tenants provide services to the sub-tenants. Wherein one group of execution environments is partitioned based on sub-tenants of the SaaS provider; receiving a call to perform a server-less function, wherein the call includes a server-less function identifier and a sub-tenant identifier; identifying a sub-tenant specific execution environment of the set of execution environments associated with the sub-tenant; and in response to identifying the tenant-specific execution environment, activating a server-less function on the sub-tenant-specific execution environment.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Computing devices may utilize communication networks to exchange data. Companies and organizations operate computer networks that interconnect multiple computing devices to support operations or provide services to third parties. Computing systems may be located in a single geographic location or in multiple different geographic locations (e.g., interconnected via private or public communication networks). Specifically, a data center or data processing center (generally referred to herein as a "data center") may include multiple interconnected computing systems to provide computing resources to users of the data center. A data center may be a private data center operated on behalf of an organization, or may be a public data center operated on behalf of the public or for the public interest.

[0002] To facilitate increased utilization of data center resources, virtualization technology allows a single physical computing device to host one or more virtual machine instances that appear and operate as independent computing devices to users of the data center. Using virtualization, a single physical computing device can dynamically create, maintain, delete, or otherwise manage virtual machines. In turn, users can request computer resources from the data center, including configurations of a single computing device or networked computing devices, and be provided with varying numbers of virtual machine resources.

[0003] In some scenarios, a virtual machine instance may be configured according to multiple virtual machine instance types to provide specific functionality. For example, various computing devices may be associated with different combinations of operating systems or operating system configurations, virtualized hardware resources, and software applications to enable the computing devices to provide different desired functionality or to provide similar functionality more efficiently. These virtual machine instance type configurations are typically contained within a device image, which includes static data (e.g., OS and applications along with their configuration and data files, etc.) containing the software that the virtual machine runs once it is started. The device image is typically stored on a disk used to create or initialize an instance. Therefore, the computing device may process the device image in order to achieve the desired software configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0004] Figure 1 is a block diagram depicting an illustrative environment in which a serverless code execution system can provide a multi-tenant mode of serverless code execution;

[0005] Figure 2 Describing Provide Figure 1 The overall architecture of the computing device of the tenant manager can provide a multi-tenant mode of serverless code execution;

[0006] Figure 3A is a flow chart depicting illustrative interactions for instantiating a subtenant-specific execution environment;

[0007] Figure 3Bis a flow chart depicting illustrative interactions for invoking a subtenant specific execution environment;

[0008] Figure 4 is a flow diagram depicting an illustrative routine for managing invocations of serverless functions using a subtenant-specific execution environment. DETAILED DESCRIPTION

[0009] In general, aspects of the present disclosure relate to serverless code execution, and in specific examples to a Software as a Service (SaaS) model that is (at least partially) hosted in a serverless code execution system. For efficiency purposes, the serverless code execution system may group activations that occur under the same account (or under the same account and for each function or variant thereof) together. Typically, there are no security issues because it can be assumed that all activations to a particular account trust each other. In a SaaS use case, all calls may be under the same account (the SaaS provider, referred to as the "SaaS provider" or "tenant of the serverless code execution system"), but it may be desirable to separate the calls. For example, the caller may not be the SaaS provider, but an end user of the SaaS provider (referred to as a "sub-tenant"). Alternatively, the SaaS provider may call the service on behalf of the end user. The present application allows activations to be grouped according to SaaS end users, thereby providing increased security when using serverless functions to provide SaaS resources.

[0010] SaaS providers can define and activate code without owning or managing servers by using, for example, a serverless code execution system (which itself may be operated by another SaaS provider). In this context, the SaaS provider can act as a "second-tier" SaaS provider, thereby providing software as a service by leveraging SaaS services provided by another SaaS provider (such as a cloud service provider). Generally speaking, as a first approach to providing a SaaS platform, a SaaS provider can define a single serverless function hosted by a serverless code execution system to serve each subtenant using the same serverless function in an execution environment (e.g., which can be a VM instance or container (with an appropriate software package)), but there may be a possibility of data persistence between separate calls to the same execution environment, thereby potentially exposing persistent data to unauthorized entities. For example, if a SaaS provider uses undifferentiated functions on its account with a serverless code execution system, the serverless code execution system can use an idle environment (referred to as "hot") for each call, so the SaaS provider does not incur the higher cost (e.g., higher efficiency) of running the SaaS platform on a serverless execution environment, and the serverless execution environment does not incur the high overhead of creating a new environment, which makes execution faster and more efficient. In this case, the SaaS provider also enjoys the faster and more efficient execution of the serverless function. Therefore, this method can provide higher operational efficiency and better infrastructure utilization, but may bring security issues. For example, the serverless code execution system can generally be configured to provide isolation between functions, and the functions themselves can be associated with corresponding user accounts. Therefore, by providing isolation between functions, the serverless code execution system can provide isolation between data of different accounts. In this scenario, a SaaS provider using a single undifferentiated function can serve calls for multiple end users with the same function, and therefore there is no isolation between those calls. Therefore, if there are security risks within the function, the inherent security provided by the serverless code execution system may be bypassed, and malicious requests may be able to access the service code or state for processing requests from other sub-tenants of the SaaS provider (thereby possibly exposing other sub-tenant data), and increase the attack surface, because the service may have access to the data of all sub-tenants of the SaaS provider. However, data confidentiality between various sub-tenants may be highly valued. As an alternative to the second method, the SaaS provider can define a dedicated infrastructure for each sub-tenant on the serverless code execution system to serve each sub-tenant using its corresponding dedicated infrastructure. This would help minimize security issues, but would result in increased operational complexity and inefficient infrastructure utilization. Therefore, neither approach is satisfactory.

[0011] On the other hand, the systems and methods of the present disclosure can enable a serverless code execution system to support a multi-tenant mode for serverless functions on a multi-tenant platform (for SaaS providers) on the serverless code execution system. Generally speaking, the multi-tenant mode for serverless functions can utilize a shared model to build multi-tenant applications (thus avoiding dedicated infrastructure for each sub-tenant), while minimizing security issues by using a sub-tenant-specific execution environment to configure a fresh execution environment to handle requests from each sub-tenant (thus avoiding exposure of persistent data to unauthorized entities). In addition, the multi-tenant mode of the serverless code execution system can manage credentials corresponding to the requesting sub-tenant, so that the activated serverless function can access other tenant-level services that support a multi-tenant architecture (such as Amazon TM In a multi-tenant model, an attacker cannot persist outside of a subtenant-specific execution environment and will not have access to other subtenants' data (either persistent data or other tenant-level services).

[0012] In general, a SaaS provider may provide software services to end users. For example, a SaaS provider may provide software services on a subscription basis, or as part of a customer of a SaaS provider. In particular, certain services provided by a SaaS provider may be hosted in a serverless execution environment as serverless functions. In this case, the SaaS provider may be a direct user (e.g., a customer) of the serverless execution environment (referred to as a "tenant"), and the end user of the SaaS provider may be a subtenant of the SaaS provider relative to the serverless execution environment. In this way, the serverless execution environment may provide services of serverless functions to the subtenants, as defined by the SaaS provider and uploaded to the serverless execution environment. In some cases, a subtenant of a SaaS provider may be an enterprise end user (e.g., for an entity) with its own subtenant (e.g., a user associated with an entity, referred to as a sub-subtenant). In general, a serverless execution environment may handle calls from a sub-subtenant of a SaaS provider on a sub-subtenant basis, or as if the sub-subtenant is requesting calls on behalf of an enterprise end user (subtenant).

[0013] In general, the serverless code execution system can manage the execution of code on an on-demand basis. In addition, the serverless code execution system can provide a network accessible service, so that users (e.g., developers of SaaS providers) can submit or specify computer executable code to be executed by the execution environment on the serverless code execution system. Each set of code on the serverless code execution system can define a "function" and implement specific functionality corresponding to the function when executed on the execution environment of the serverless code execution system. The separate execution of the code of the function on the serverless code execution system can be referred to as the "execution" of the function. The serverless code execution system can further enable users to trigger the execution of functions based on various potential events, such as application programming interface ("API") calls or the transmission of specific formatted hypertext transfer protocol ("HTTP") packets. Therefore, users (in general) or (particularly SaaS providers) sub-tenants can use the serverless code execution system to execute any specified executable code "on demand" without configuring or maintaining the underlying hardware or infrastructure on which the code is executed. In addition, the serverless code execution system can be configured to execute functions in a rapid manner (e.g., within 100 milliseconds [ms]), thereby enabling the functions to be executed in "real time" (e.g., with little or no perceptible delay to the end user). To achieve such rapid execution, the serverless code execution system may include one or more execution environments that are "pre-warmed" or pre-initialized (e.g., booted into an operating system and executing a complete or substantially complete runtime environment) and configured to enable execution of user-defined code so that the code can be quickly executed in response to a request to execute the code without the delay caused by initializing the execution environment. Therefore, when execution of a function is triggered, the code corresponding to the function can be executed in a pre-initialized execution environment in a very short amount of time.

[0014] In general, an "execution environment" can be a virtual machine instance or a container. The container can be a software container, sometimes referred to as "OS-level virtualization" and hosted on a worker (sometimes referred to as a "host" or "host computing device"). Each execution environment can be divided by a virtualization boundary to ensure data security between the corresponding execution environments. For example, each execution environment can exist in a partitioned user space on the worker that logically partitions the worker's resources among the execution environments on the worker. For example, each user space can represent a "chroot" jail.

[0015] According to an embodiment of the present disclosure, access to network services (such as serverless functions or network resources used by those functions) can be managed by using identity and access management (IAM) roles and IAM policies. For example, IAM roles and policies can define access (or no access) to a computer system or resource based on the identity of the device requesting access to the computer system or resource. IAM policies can be defined by a SaaS provider to indicate which sub-tenants (based on the sub-tenant identity or the sub-tenant's IAM role) can access (or not access) a computer system or resource associated with a SaaS provider hosted by a serverless code execution system. In particular, an IAM policy can indicate which sub-tenants can activate serverless functions associated with a SaaS provider. In addition, the activated serverless function can assume the role of a sub-tenant when interacting with network resources, thereby enabling access to sub-tenant-specific network resources.

[0016] In various aspects of the present disclosure, a serverless code execution system may include one or more data stores, the data stores including information defining a set of IAM policies for access to a plurality of serverless functions hosted by the serverless code execution system. A set of serverless functions in the plurality of serverless functions may be associated with a SaaS provider. The serverless code execution system may also include a plurality of worker devices that host a plurality of execution environments. Each execution environment may be associated with a serverless function. A set of execution environments may be associated with a set of serverless functions. A set of execution environments may be partitioned based on subtenants of a SaaS provider. In general, the serverless code execution system may only allow a specific subtenant to activate the serverless function (in accordance with the associated IAM policy), and the serverless code execution system may call the serverless function on the execution environment associated with the specific subtenant. In this way, the SaaS provider may only need to manage one serverless function while ensuring data security (thereby avoiding maintenance costs and additional infrastructure costs), because the subtenant's call can be partitioned in a subtenant-specific environment (such as using a subtenant-specific execution environment of a specific subtenant). Therefore, the serverless code execution system may not activate the same serverless function on a subtenant-specific execution environment assigned to the subtenant for a third party (e.g., another subtenant), or the serverless code execution system may not activate the serverless function on a different subtenant-specific execution environment for the subtenant (thereby improving data security).

[0017] For example, a serverless code execution system may: receive a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier; determine a subtenant from any number of subtenants based on the subtenant identifier; in response to determining the subtenant, identify a subtenant-specific execution environment associated with the subtenant in a set of execution environments, wherein other calls to execute serverless functions from any of the other subtenants are blocked from being activated on the subtenant-specific execution environment; and in response to identifying the subtenant-specific execution environment, activate the serverless function on the subtenant-specific execution environment. In this manner, one or more computing devices of the serverless code execution system may confirm whether the subtenant is authorized to access the serverless function, and if so, execute the serverless function on the subtenant-specific execution environment in a secure manner. In addition, as the serverless code execution system may be scaled down (or scaled up), SaaS providers may gain benefits in operational efficiency while maintaining data security.

[0018] In at least some embodiments, the serverless function may attempt to retrieve data and use services from network resources specific to the subtenant. However, by default, the execution environment may execute under the authentication of the SaaS provider. Providing access to subtenant-specific resources to the SaaS provider may reduce the security of those resources and may be undesirable. The present application provides a solution whereby subtenant-specific execution environments may be authenticated as subtenants (e.g., assuming the subtenant's IAM role). This allows those execution environments (and only those execution environments, not other execution environments of other SaaS subtenants) to access subtenant-specific resources in a secure manner. For example, based on an authentication token indicating the subtenant, the subtenant-specific execution environment may interact with one or more tenant services to access subtenant data. For example, a subtenant-specific execution environment may use an authentication token to obtain authentication from a tenant-level service (such as Amazon TMDynamoDB) to request data and / or services to assume the role of a subtenant. In this way, a subtenant-specific execution environment can be exposed only to subtenant-specific information or functionality because the subtenant-specific execution environment can be viewed as a subtenant by a third-party system. The subtenant-specific execution environment can receive a verification token from a worker that hosts the subtenant-specific execution environment, or the worker can modify outgoing (e.g., requests from a subtenant-specific execution environment to other services) to include a verification token for the subtenant-specific execution environment. The verification token can be based on a subtenant identifier, and the session tag of the subtenant-specific execution environment can be modified. In addition, in some embodiments, the serverless code execution system can be a multi-tenant cloud service provider that maintains a set of execution environments. Each execution environment can be associated with a serverless function. The serverless function can be associated with a Software as a Service (SaaS) provider that is a tenant of a cloud service provider. A SaaS provider can provide services to multiple subtenants. A set of execution environments can be partitioned based on the subtenants of the SaaS provider. In response to receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier; the system may identify a subtenant-specific execution environment of a set of execution environments associated with the subtenant identifier; and activate the serverless function on the subtenant-specific execution environment.

[0019] To identify a subtenant-specific execution environment associated with a subtenant, the serverless code execution system may determine whether any execution environment in a set of execution environments is associated with a subtenant identifier. In this way, the serverless code execution system may restrict access based on the subtenant identifier. In addition, the serverless code execution system may determine whether any execution environment in a set of execution environments is associated with a subtenant identifier and a serverless function identifier. In this way, the serverless code execution system may still restrict access based on the subtenant identifier, but also ensure that the execution environment is defined to execute a serverless function (e.g., it can be updated to execute the corresponding code, or it already has the corresponding code). In addition, the serverless code execution system may determine whether any execution environment in a set of execution environments is associated with a subtenant identifier, a serverless function identifier, and a version identifier. In this way, the serverless code execution system may still restrict access based on the subtenant identifier, but also ensure that the execution environment is defined to execute the correct version of the serverless function (e.g., it can be updated to execute the corresponding correct version of the code, or it already has the corresponding correct version of the code). For example, because serverless code execution systems can execute functions in a rapid manner, determining a specific execution environment for a version and function for a subtenant can help provide function processing and results quickly.

[0020] In response to determining that none of a set of execution environments are associated with a subtenant identifier (and / or a serverless function identifier or version identifier), the serverless code execution system may instantiate a subtenant-specific execution environment. In this manner, the serverless code execution system may determine that none of the set is currently assigned for use by the subtenant, and therefore a new subtenant-specific execution environment for the particular subtenant needs to be provisioned and used for the subtenant. As part of instantiating the new subtenant-specific execution environment, a verification token (discussed above) may be transmitted to the subtenant-specific execution environment (or a worker that hosts the subtenant-specific execution environment) such that the subtenant-specific execution environment assumes the role of the subtenant. As discussed above, the verification token may protect subtenant data in third-party systems, thereby increasing the security of subtenant data within the serverless code execution system.

[0021] In particular, in order to instantiate a sub-tenant specific execution environment, the serverless code execution system may select a non-tenant specific execution environment in a hot state to be modified into a sub-tenant specific execution environment, or create a sub-tenant specific execution environment. For example, a non-tenant specific execution environment may be an execution environment that is not part of any set of execution environments associated with any SaaS provider. To reiterate, a non-tenant specific execution environment may be an execution environment that is not associated with a multi-tenant mode of a serverless code execution system. In this way, a multi-tenant mode may quickly modify an already hot execution environment to activate serverless functions and server responses. For example, a hot non-tenant specific execution environment may be selected because it has a basic configuration to be modified for a sub-tenant specific execution environment, or a non-tenant specific execution environment may have various commonalities with a configuration required to modify one or more parameters, etc. to become a sub-tenant specific execution environment. In this way, processing time may be reduced, and the serverless code execution system may respond more quickly than if a new sub-tenant specific execution environment must be created. In situations where a new subtenant-specific execution environment must be created, the serverless code execution system can create a new execution environment discussed below on a worker and assign the new execution environment to the subtenant so that the new execution environment is a subtenant-specific execution environment.

[0022] In response to determining that at least one execution environment in a set of execution environments is associated with a subtenant identifier (and optionally, a serverless function identifier and / or a version identifier), the serverless code execution system may select an execution environment in the at least one execution environment as a subtenant-specific execution environment. In this way, the serverless code execution system can restrict access based at least on the subtenant identifier and process calls faster than creating a new subtenant-specific execution environment. In addition, among all execution environments associated with the subtenant identifier, the serverless code execution system may prioritize execution environments with the same serverless function identifier and the same version identifier, then select execution environments with the same serverless function identifier and a different version identifier (to be updated to the correct version of the function), and then select execution environments with different serverless function identifiers and different version identifiers (to be updated to the serverless function and the version thereof). In this way, the serverless code execution system can activate the serverless function as quickly as possible while making as few modifications as possible to the existing environment associated with the subtenant.

[0023] In another embodiment, before selecting an execution environment in the at least one execution environment as the subtenant-specific execution environment, the serverless code execution system may determine whether any of the at least one execution environment is available to handle the request. That is, even if there is at least one execution environment associated with the subtenant, only available (e.g., hot and unused) execution environments can be selected for activation.

[0024] As will be understood by those skilled in the art in view of the present disclosure, the embodiments disclosed herein improve the capabilities of computing systems such as serverless computing systems to support SaaS providers with sub-tenants (e.g., tenants of serverless computing systems) in a manner that supports generalized functions with limited access to sub-tenant specific data or services, thereby providing increased functionality and security. In addition, embodiments of the present disclosure solve technical problems inherent in computing systems; specifically, the difficulty of providing SaaS providers via serverless computing systems. For example, there may be a trade-off between efficiency and security. As discussed above, on the one hand, if execution environments are grouped together to serve multiple sub-tenants, the SaaS provider may have less to manage, and the serverless code execution system may process calls faster and more efficiently, while at the same time, sub-tenant data may be exposed to malicious requests. On the other hand, the use of isolated execution environments can provide stronger data security while requiring higher infrastructure utilization and maintenance. These technical problems are solved by various technical solutions described herein, including cloud computing services configured to provide sub-tenant specific execution environments. Therefore, the present disclosure generally represents improvements to serverless code execution systems and computing systems.

[0025] The foregoing aspects and many of the attendant advantages of the present disclosure will become more readily appreciated and become better understood by reference to the following detailed description taken in conjunction with the accompanying drawings.

[0026] Figure 1 1 is a block diagram of an illustrative operating environment 100 in which a client device 102 can interact with a serverless code execution system 110 via a network 104. By way of illustration, various exemplary client devices 102 are shown in communication with the serverless code execution system 110, including a desktop computer, a laptop computer, and a mobile phone. In general, the client device 102 can be any computing device, such as a desktop, laptop or tablet computer, a personal computer, a wearable computer, a server, a personal digital assistant (PDA), a hybrid PDA / mobile phone, a mobile phone, an e-book reader, a set-top box, a voice command device, a camera, a digital media player, and the like. The serverless code execution system 110 may provide one or more user interfaces, command line interfaces (CLIs), application programming interfaces (APIs), and / or other programming interfaces to the user computing device 102 for: generating and uploading user executable source code (e.g., as part of a disk image); activating user-provided source code (e.g., submitting a request to execute the source code on the serverless code execution system 110); scheduling event-based or timed code execution; tracking user-provided source code; and / or viewing other logging or monitoring information related to their requests and / or source code. Although one or more embodiments may be described herein as using a user interface, it should be understood that such embodiments may use any CLI, API, or other programming interface in addition or alternatively.

[0027] The illustrative environment 100 further includes one or more auxiliary services 106 that can interact with the serverless code execution system 110 to implement desired functionality on behalf of the user. The auxiliary services 106 can correspond to network-connected computing devices, such as servers, that generate data accessible to the serverless code execution system 110 or otherwise communicate with the serverless code execution system 110. For example, the auxiliary services 106 can include a web service (e.g., associated with the user computing device 102, associated with the serverless code execution system 110, or associated with a third party), a database, a Really Simple Syndication ("RSS") reader, a social networking website, or any other source of network-accessible services or data sources. In some instances, the auxiliary services 106 can be activated by code execution on the serverless code execution system 110, such as by making an API call to the auxiliary services 106. In some instances, the auxiliary services 106 can be associated with the serverless code execution system 110 to, for example, provide billing or logging services to the serverless code execution system 110. In some instances, the auxiliary service 106 actively transmits information, such as an API call or other task triggering information, to the serverless code execution system 110. In other instances, the auxiliary service 106 may be passive, such that data is provided for access by the serverless code execution system 110. For example, components of the serverless code execution system 110 may periodically poll such passive data sources and trigger the execution of code within the serverless code execution system 110 based on the data provided. Figure 1 Although depicted as distinct from the user computing device 102 and the serverless code execution system 110 , in some embodiments, the various auxiliary services 106 may be implemented by the user computing device 102 or the serverless code execution system 110 .

[0028] The client device 102, the auxiliary service 106 and the serverless code execution system 110 may communicate via a network 104, which may include any wired network, wireless network or combination thereof. For example, the network 104 may be a personal area network, a local area network, a wide area network, an air broadcast network (e.g., for radio or television), a cable network, a satellite network, a cellular telephone network or a combination thereof. As another example, the network 104 may be a publicly accessible network of a link network that may be operated by various different parties, such as the Internet. In some embodiments, the network 104 may be a private or semi-private network, such as a company or university intranet. The network 104 may include one or more wireless networks, such as a global system for mobile communications (GSM) network, a code division multiple access (CDMA) network, a long-term evolution (LTE) network or any other type of wireless network. The network 104 may use protocols and components for communicating via any of the Internet or other aforementioned types of networks. For example, the protocols used by the network 104 may include hypertext transfer protocol (HTTP), HTTP security (HTTPS), message queue telemetry transmission (MQTT), constrained application protocol (CoAP), etc. The protocols and components used to communicate via the Internet or any of the other aforementioned types of communication networks are well known to those skilled in the art and, therefore, are not described in further detail herein.

[0029] The serverless code execution system 110 Figure 1 is depicted as operating in a distributed computing environment that includes the use of one or more computer networks ( Figure 1 The serverless code execution system 110 may also be configured to be configured to be connected to a plurality of computer systems (not shown) interconnected. Figure 1 The devices shown in FIG. 1 and FIG. 2 may be operated in a computing environment that may have fewer or more devices. Therefore, Figure 1 The depiction of the serverless code execution system 110 in the example is considered illustrative and not limiting of the present disclosure. For example, the serverless code execution system 110 or its various components may implement various web service components, hosted or "cloud" computing environments, and / or peer-to-peer network configurations to implement at least a portion of the processes described herein.

[0030] In addition, the serverless code execution system 110 may be implemented directly in hardware or in software executed by a hardware device, and may, for example, include one or more physical or virtual servers implemented on physical computer hardware configured to execute computer executable instructions for performing the various features described herein. The one or more servers may be geographically dispersed or geographically co-located, for example, in one or more data centers. In some instances, the one or more servers may operate as part of a system of rapidly provisioned and released computing resources (commonly referred to as a "cloud computing environment").

[0031] exist Figure 1 In the example of FIG. 1 , the serverless code execution system 110 is shown as being connected to the network 104. In some embodiments, any of the components within the serverless code execution system 110 can communicate with other components of the serverless code execution system 110 via the network 104. In other embodiments, not all components of the serverless code execution system 110 are capable of communicating with other components of the environment 100. In one example, only the front end 120 can be connected to the network 104, and other components of the serverless code execution system 110 can communicate with other components of the environment 100 via the front end 120.

[0032] exist Figure 1 In the present disclosure, a user (e.g., a developer) of a SaaS provider may interact with a serverless code execution system 110 by means of a user computing device 102 to provide source code, and establish rules or logic that define when and how such code should be executed on the serverless code execution system 110, thereby establishing a "task". In the present disclosure, "task" and "serverless function" may be used interchangeably. For example, a user may want to run a piece of code in conjunction with a web or mobile application that the user has developed. One way to run the code would be to obtain a virtual machine instance from a service provider that provides infrastructure as a service; configure the virtual machine instance to suit the needs of the user; and use the configured virtual machine instance to run the code. To avoid the complexity of this process, the user may alternatively provide the code to the serverless code execution system 110 and request the serverless code execution system 110 to execute the code using one or more execution environments managed by the system 110. The serverless code execution system 110 may handle the acquisition and configuration of computing capabilities (e.g., containers, instances, etc. described in more detail below) based on the code execution request, and use the computing capabilities to execute the code. The serverless code execution system 110 can automatically scale up and down based on the amount of code being requested to execute, thereby alleviating the burden on users from having to worry about overutilization (e.g., obtaining too few computing resources and suffering performance issues) or underutilization (e.g., obtaining more computing resources than necessary to run the code and thereby spending too much).

[0033] To enable interaction with the serverless code execution system 110, the system 110 includes a plurality of front ends 120 that enable interaction with the serverless code execution system 110. In an illustrative embodiment, the front end 120 serves as a "front door" to other services provided by the serverless code execution system 110, thereby enabling a user to provide computer executable source code (via a user computing device 102), request execution of the computer executable source code, and view the results of the computer executable source code. The front end 120 includes various components to enable interaction between the serverless code execution system 110 and other computing devices. For example, each front end 120 may include a request interface that provides the user computing device 102 with the ability to upload or otherwise transfer user-specified code and associated data sets to the serverless code execution system 110 (e.g., in the form of executable code or disk images); and thereafter request execution of the code. In one embodiment, the request interface communicates with an external computing device (e.g., a user computing device 102, an auxiliary service 106, etc.) via a graphical user interface (GUI), a CLI, or an API. The front end 120 processes the request and ensures that the request is properly authorized. For example, front end 120 may determine whether a user associated with the request is authorized to access the source code specified in the request.

[0034] As used herein, references to source code may refer to any program code (e.g., programs, routines, subroutines, threads, etc.) written in a specific programming language. In the present disclosure, the terms "source code", "user code", and "program code" are used interchangeably. Source code that has been compiled to be executed on a specific device is generally referred to as "machine code" herein. Both "source code" and "machine code" are representations of the same instructions and may be collectively referred to as "code". For example, such code may be executed in conjunction with a specific web application or mobile application developed by a user to implement a specific function. As described above, each set of code (e.g., to implement a specific function) is referred to herein as a "task" or "function", and the specific execution of the code is referred to as "task execution", "function execution", "code execution", or simply "execution". As a non-limiting example, the source code of a task may be written in JavaScript (e.g., node.js), Java, Python, and / or Ruby (and / or another programming language). Tasks may be "triggered" in a variety of ways for execution on the serverless code execution system 110. In one embodiment, a user or other computing device may transmit a request to perform a task, which may generally be referred to as a "call" to perform the task (e.g., a "task call," "function call," etc.). Such a call may include an identifier of the task to be performed and one or more arguments to be used to perform the task. The request interface of the front end 120 may receive a call to perform a task from a user as a Hypertext Transfer Protocol Secure (HTTPS) request. Moreover, any information (e.g., headers and parameters) included in the HTTPS request may also be processed and utilized when performing the task. As discussed above, any other protocol (including, for example, HTTP, MQTT, and CoAP) may be used to transmit a message containing a task call to the request interface.

[0035] Prior to calling for execution of a task, an end user may submit (e.g., to the front end 120) the task and associated data to be used to execute the task. In one embodiment, the code is provided in the form of an executable code file or a disk image containing the code and other data that the code can use during execution. Illustratively, creating a task may cause the front end 120 to create metadata for the task, the metadata defining, for example, the user who created the task, the executable code file / disk image used to facilitate the execution of the task, the triggering conditions of the task, and the like. In one embodiment, the task may be versioned, wherein the task metadata identifies the available versions, and at least some other metadata of the task may vary across versions. For example, different versions may be associated with different executable code files or disk images. The metadata is illustratively stored in the task metadata storage area 130.

[0036] When an executable code file or disk image is submitted, the executable code file or image is illustratively stored in the configuration data store 174 (e.g., by the front end 120). In one embodiment, each executable code file is stored as a text file. In another embodiment, each image is stored as a set of layers and a manifest identifying the layers that make up the disk image. For example, the separate storage of layers and manifests can achieve deduplication of layers. For example, in the case where two images share a layer, the configuration data store 174 can store only a single copy of the layer. For example, deduplication can be performed based on a digital fingerprint of the layer. Illustratively, each layer can be identified in the storage area 174 based on a digital fingerprint (such as a hash value, a message authentication code (MAC), etc.), which can be calculated based on the content of the layer. Therefore, when two layers share a fingerprint, the system 110 can conclude that the two layers are the same, and therefore only a single copy of the layer is stored. As described above, layers can be associated with versioned software, such that a first layer corresponds to a first version of the software, and a second layer corresponds to a second version of the software. For ease of reference, this disclosure refers to such layers as being versioned themselves. However, while in some cases the system 110 may directly maintain versioning information for the layers, the system may additionally or alternatively maintain versioning information for software, as well as information that maps such software versions to specific layers (e.g., the first layer corresponds to version 1 of a particular software, the second layer corresponds to version 2, and so on). In some cases, additionally or alternatively, each disk image is stored as a non-layered image, such as one or more files that provide a block-level representation of a file system. For example, the system 110 may "flatten" a layered disk image by creating a file system using the layers; and then saving a non-layered representation of the file system to the configuration data store 174. In some cases, the non-layered representation may be divided into a plurality of different chunks, which may be deduplicated within the data store 174. The generation and handling of file system chunks is discussed in more detail in U.S. patent application Ser. No. 17 / 105,250, filed on November 25, 2020, entitled “LOW LATENCY ACCESS TO DATA SETS USING SHARED DATA SET PORTIONS,” (hereinafter referred to as the “'250 application”), the entire contents of which are hereby incorporated by reference.

[0037] Both the task metadata storage area 130 and the configuration data storage area 174 may correspond to any persistent data storage area. In one embodiment, the task metadata storage area 130 and the configuration data storage area 174 are implemented as logical storage devices on a cloud storage service such as an object storage system. An example of such an object storage system is AMAZON TMSIMPLESTORAGE SERVICE TM (or "S3 TM ”).

[0038] After the user has created a task on the serverless code execution system 110, the system 110 may accept a call to execute the task. For calls to execute tasks, the front end 120 may include an execution queue that maintains a record of the requested task execution. Illustratively, the number of tasks executed simultaneously by the serverless code execution system 110 is limited, and therefore, new task executions initiated at the serverless code execution system 110 (e.g., via an API call, via a call from a task being executed or being executed, etc.) may be placed on the execution queue and processed, for example, in a first-in, first-out order. In some embodiments, the serverless code execution system 110 may include multiple execution queues, such as individual execution queues for each user account. For example, a user of the serverless code execution system 110 may desire to limit the rate of task execution on the serverless code execution system 110 (e.g., for cost reasons). Therefore, the serverless code execution system 110 may utilize account-specific execution queues to throttle the rate of simultaneous task execution by a specific user account. In some examples, the serverless code execution system 110 may prioritize task execution so that task execution for a particular account or a specified priority is bypassed or prioritized within the execution queue. In other examples, the serverless code execution system 110 may execute the task immediately or substantially immediately after receiving a call for the task, and therefore, the execution queue may be omitted.

[0039] As described above, tasks may be triggered to execute at the serverless code execution system 110 based on explicit calls from the user computing device 102 (e.g., as received at the request interface). In some embodiments, when the SaaS provider is a tenant and the end user of the SaaS provider is a subtenant, it may not be possible to send a call from the entity that owns a particular task. For example, the task may be owned by the SaaS provider, and the subtenant may transmit a call to the serverless execution system 110 to activate the task. Alternatively or in addition, tasks may be triggered to execute at the serverless code execution system 110 based on data retrieved from one or more auxiliary services 106. To facilitate interaction with the auxiliary services 106, the front end 120 may include a polling interface that operates to poll the auxiliary services 106 for data. Illustratively, the polling interface may periodically transmit requests to one or more user-specified auxiliary services 106 to retrieve any new available data (e.g., social network "posts", news articles, files, records, etc.), and determine whether the data corresponds to the criteria established by the user that triggers the execution of the task on the serverless code execution system 110. Illustratively, the execution criteria of the task may include, but are not limited to, whether new data is available at the auxiliary service 106, the type or content of the data, or timing information corresponding to the data. In some instances, the auxiliary service 106 may function to notify the front end 120 of the availability of new data, and thus, a polling service may be unnecessary with respect to such a service.

[0040] In addition to tasks that are executed based on explicit user calls and data from auxiliary services 106, the serverless code execution system 110 may, in some instances, be operable to independently trigger the execution of tasks. For example, the serverless code execution system 110 may be operable (based on instructions from a user) to trigger the execution of a task at each of a plurality of specified time intervals (e.g., every 10 minutes).

[0041] The front end 120 may further include an output interface configured to output information about the execution of a task on the serverless code execution system 110. Illustratively, the output interface may transmit data about the execution of the task (e.g., the result of the task, errors associated with the execution of the task, or details of the execution of the task, such as the total time required to complete the execution, the total data processed via the execution, etc.) to the user computing device 102 or the auxiliary service 106, which may include, for example, a billing or logging service. The output interface may further enable the transmission of data such as service calls to the auxiliary service 106. For example, the output interface may be used to transmit API requests to the external service 106 during the execution of the task (e.g., to store data generated during the execution of the task).

[0042] exist Figure 1The code execution triggered on the serverless code execution system 110 is executed by an execution environment hosted by a group of workers 181 in the worker cluster 180. Each worker 181 is illustratively a host device configured to host multiple execution environments. Figure 1 , the plurality of execution environments are virtual machine instances 183A to 183N. The execution environments may alternatively include software containers, sometimes referred to as "OS-level virtualization," another virtualization technology known in the art. Thus, where reference is made herein to VM instances 183, it should be understood (unless otherwise indicated) that containers may replace such instances 183.

[0043] like Figure 1 As shown, each worker 181 can host multiple instances 183. Each instance 183 can be isolated from other instances 183, thereby ensuring the security of code execution on the serverless code execution system 110. For example, given that instance 183 is a virtual machine hosted by worker 181, each instance 183 can be divided by a virtualization boundary. In addition, each instance 183 can exist in a partitioned user space on worker 181, and the partitioned user space logically partitions the resources of worker 181 in instance 183. For example, each user space can represent a "chroot" jail - a known LINUX TM Operating system isolation technology.

[0044] To facilitate rapid execution of code, each worker 181 may be configured to maintain a set of instances 183 in a "warm" state, configured at least in part to begin executing code. For example, instances may be created on a worker and configured to have access to computing resources (CPU, RAM, drive storage, etc.). In some cases, it may be impractical or impossible to maintain instances 183 in a fully hot state for all possible code executions, because executions may be associated with a variety of at least partially different data sets (e.g., executable code files, disk images, and / or snapshots). Therefore, for a given set of tasks, instances 183 may be maintained with "maximum commonality", such as being configured with a set of computing resources common to those tasks, configured to accept the type of operating system used by those tasks, and so on.

[0045] Upon receiving an instruction to configure instance 183 to support the execution of a task, worker 181 may adjust the configuration of instance 183 to support the execution. Specifically, worker 181 may configure instance 183 with permissions to access an executable code file, disk image, or snapshot corresponding to the task. In some instances, worker 181 may retrieve the disk image from configuration data store 174 and store the complete image locally. In other instances, worker 181 may provide instance 183 with seemingly full local access to the disk image or snapshot while "lazily" retrieving portions of the image or snapshot in response to requests to read such portions. Techniques for providing lazy retrieval of image portions are discussed in the '250 application, which is incorporated by reference above.

[0046] In addition, the system 110 includes a plurality of components for facilitating the dispatching of calls to perform tasks from the front end 120 to specific VM instances 183. For example, the serverless code execution system 110 includes one or more worker managers 140 configured to manage execution environments (e.g., virtual machine instances) hosted by workers 181 in a worker cluster 180. The worker managers 140 (each of which is illustratively implemented as a physical device or a virtual device on a physical) illustratively "rent" a specific VM instance 183 within the cluster 180, thereby obtaining operational control to, for example, instruct the virtual machine instance 183 to perform code for a task. Thus, upon receiving a call to perform a task, the front end 120 may dispatch the call to the worker manager 140, which may identify the currently rented VM instance 183 in which to implement the task, and cause the instance 183 to implement the task. Exemplary interactions for distributing calls from the front end 120 to the worker manager 140 are described, for example, in U.S. Pat. No. 10,942,795 to Yanacek et al., entitled “SERVERLESS CALL DISTRIBUTION TO UTILIZE RESERVED CAPACITY WITHOUT INHIBITINGSCALING” (“the '795 patent”), the entire contents of which are hereby incorporated by reference.

[0047] In instances where a worker manager 140 does not currently lease a VM instance 183 corresponding to an invoked task, the worker manager 140 may contact a placement service 160 to request a lease of an additional instance 183, which is illustratively configured to grant the worker manager 140 a lease on each VM instance 183. Illustratively, the placement service 160 may maintain state information for VM instances 183 across a cluster 180 and information indicating which manager 140 has leased a given instance 183. When a worker manager 140 requests a lease on an additional instance 183, the placement service 160 may identify an appropriate instance 183 (e.g., warmed up with software and / or data required to support the invocation of the task) and grant the manager 140 a lease on that instance 183. In the event that such an instance 183 does not exist, the placement service 160 may instruct the worker 181 to create such an instance 183 (e.g., by creating an instance 183 or identifying an existing unused instance 183, storing an appropriate data inventory of required executable code files, disk images, snapshots, etc. in the user space of that instance 183, and configuring file system processes to provide access to the required data sets), and thereafter grant a lease to the worker manager 140 to thereby facilitate execution.

[0048] According to an embodiment of the present disclosure, the serverless code execution system 110 further includes a tenant service 190 configured to manage a multi-tenant mode of the serverless code execution system 110. Specifically, the tenant service 190 includes an identity and access management (IAM) data store 192, a log data store 194, and a tenant manager 196. The serverless code execution system 110 may also interact with tenant resources 150 according to the multi-tenant mode. The tenant resources 150 may include a tenant data store 152 and an API service 154. In some embodiments, the tenant service 190 may be part of the front end 120, or may be hosted near the front end 120 to minimize latency to support the functions of the front end 120.

[0049] Tenant manager 196 illustratively represents a computing device configured to manage multi-tenant mode serverless functions on system 110. As described in more detail below, tenant manager 196 can (1) manage access to serverless functions, and (2) manage metrics associated with the use of system 110. For example, tenant manager 196 can manage access to serverless functions based on IAM data store 192 and / or metrics associated with the use of system 110. In addition, tenant manager 196 can manage metrics associated with the use of system 110 by tracking sub-tenant specific VM instances (see, e.g., diary below) and tracking log data indicating system performance and use of system 110 (see, e.g., log data below). In addition, as discussed in more detail below, tenant manager 196 can provide session tags to instantiated sub-tenant specific VM instances. The session tags can include a sub-tenant specific session tag corresponding to the specific sub-tenant requesting the serverless function. The sub-tenant specific session tag can include a sub-tenant identifier. The sub-tenant specific tag can be a verification token. The subtenant-specific session tag may be used to modify the execution role permissions of the subtenant-specific VM instance so that an outgoing request from the serverless function may be processed as if the subtenant transmitted the request. Metrics may be used to determine whether one or more conditions for limiting the call rate are met based on various criteria. Depending on whether one of the conditions is met, the system 110 may determine to limit the call rate of the serverless function. In addition, the system 110 may use metrics for auditing and reporting. For example, the system 110 may generate general or specific reports for SaaS providers (e.g., per subtenant, per SaaS provider, etc.).

[0050] The IAM data store 192 illustratively includes information of a set of IAM policies. A set of IAM policies may be managed by a SaaS provider owner and hosted by the serverless code execution system 110, such that access to (or not to) specific computing resources (e.g., storage, functions, serverless functions, etc.) is restricted based on the identity of a requesting device associated with a user (e.g., a developer of a SaaS provider) or a subtenant. Those skilled in the art will recognize that the IAM data store 192 and the associated functions executed according to a set of IAM policies may be hosted in a separate system other than the serverless code execution system 110. For each SaaS provider or other entity using the serverless code execution system 110, a set of IAM policies may include a subset of policies for restricting access to (or not to) serverless functions associated with the SaaS provider or other entity. In general, a subset of policies may include at least one policy for defining who can modify, delete, or add new serverless functions associated with a SaaS provider or other entity. Other policies in a subset of policies may restrict access to (or not to) the use of various serverless functions based on the identity of the requesting device. Additionally, IAM policies can restrict access (or no access) based on the IAM role of a user or subtenant.

[0051] The log data storage area 194 illustratively includes information of the diary and log data. As discussed in more detail below, the diary may track at least the sub-tenant specific VM instance, because the sub-tenant specific VM instance is instantiated, in use, in a hot state (e.g., ready for use), or retired. In this way, the diary may indicate whether the sub-tenant specific VM instance is available for handling the activation of the serverless function for the specific sub-tenant requesting the activation of the serverless function. As discussed in more detail below, the log data may store concurrency data for the VM instances of the SaaS provider or other entity, and telemetry data for each request / response handled by the system 110. The concurrency data may indicate the sub-tenant specific VM instance that is currently hot or in use for each of the SaaS provider or other entity and the non-tenant specific VM instance that is currently hot or in use (e.g., a non-multi-mode VM instance that can handle a non-multi-tenant serverless function). The telemetry data may indicate the response time, load, pending state, sub-tenant / user requester, etc. for each request / response of the system 110. In this manner, and as discussed below, system 110 can limit request rates based on one or more conditions, such as concurrency conditions, load conditions, etc. In some embodiments, the journal can be stored and managed by worker manager 140 as part of managing the lease. In some embodiments, the log data can be stored and managed by front end 120.

[0052] Tenant data stores 152 may be data repositories for storing data specific to a SaaS provider or other entity. Tenant data stores 152 may be any type of data store and may be hosted within system 110 or elsewhere (e.g., hosted within a private network associated with system 110 or outside of the private network). In some embodiments, at least some of tenant data stores 152 may store data in a multi-tenant architecture, such as Amazon Web Services. TM DynamoDB. In this case, those tenant data stores 152 may restrict access to specific portions of the data stored therein based on the identity of the requesting device. For example, a tenant data store 152 may store data associated with a particular subtenant in a larger data structure that stores data associated with other subtenants, but only allow access to data associated with the particular subtenant if the device requesting the data provides a satisfactory identity indicator corresponding to the particular subtenant.

[0053] Similarly, API services 154 may be any service to be activated by a subtenant, other user, serverless function, SaaS provider, or other entity. API services 154 may be hosted within system 110 or elsewhere (e.g., hosted within a private network associated with system 110 or outside of a private network). In some embodiments, at least some of API services 154 may provide services in a multi-tenant architecture. In this case, those API services 154 may restrict access to their respective services based on the identity of the requesting device. For example, if the device requesting the service provides a satisfactory identity indicator corresponding to a particular subtenant, then API services 154 may only allow access to its services.

[0054] To simplify Figure 1 , tenant service 150 is depicted as communicating directly with system 110. Those skilled in the art will recognize that tenant service 150 may be included (in whole or in part) within system 110, included in a separate portion of a private network associated with system 110, or connected to system 110 via network 104.

[0055] Figure 2 Describing the implementation Figure 1 The overall architecture of the computing system of the tenant manager 196. Figure 2 The overall architecture of the system depicted in the embodiment includes an arrangement of computer hardware and software that can be used to implement various aspects of the present disclosure. The hardware can be implemented on a physical electronic device, as discussed in more detail below. The system may include Figure 2 There may be more (or fewer) elements than those shown in the drawings. However, it is not necessary to show all of these generally conventional elements in order to provide an enabling disclosure. In addition, Figure 2The overall architecture shown in can be used to implement Figure 2 One or more of the other components shown in (e.g., worker 181, front end 120, etc.).

[0056] As shown, the system includes a processing unit 290, a network interface 292, a computer readable medium drive 294, and an input / output device interface 296, all of which can communicate with each other via a communication bus. The network interface 292 can provide connectivity to one or more networks or computing systems. The processing unit 290 can therefore receive information and instructions from other computing systems or services via the network 104. The processing unit 290 can also communicate with the memory 280 and further provide output information to an optional display (not shown) via the input / output device interface 296. The input / output device interface 296 can also receive input from an optional input device (not shown).

[0057] Memory 280 may contain computer program instructions (grouped into units in some embodiments) that are executed by processing unit 290 to implement one or more aspects of the present disclosure, along with data for facilitating or supporting such execution. Figure 2 2 is shown as a single set of memory 280, but in practice the memory 280 may be divided into hierarchies, such as primary memory and secondary memory, which may include (but are not limited to) random access memory (RAM), 3D XPOINT memory, flash memory, magnetic storage, etc. For example, for the purpose of description, it may be assumed that the primary memory represents the main working memory of the system, which has a higher speed but a lower total capacity than the secondary memory, tertiary memory, etc.

[0058] Memory 280 may store an operating system 284 that provides computer program instructions for use by processing unit 290 in general management and operation of device 196. Memory 280 may further include computer program instructions and other information for implementing various aspects of the present disclosure. For example, in one embodiment, memory 280 includes an IAM manager 286 that represents code that is executable to manage access to serverless functions and provide session tags to instantiated sub-tenant specific VM instances. In addition, memory 280 includes a log manager 288 that represents code that is executable to manage metrics associated with the use of system 110. In combination, when executed on device 200, the elements of memory 280 enable implementation of embodiments of the present disclosure.

[0059] Figure 2The system is one illustrative configuration of such devices, with other configurations being possible. For example, although shown as a single device, in some embodiments, the system may be implemented as a logical device hosted by multiple physical host devices. In other embodiments, the system may be implemented as one or more virtual devices executing on a physical computing device. Figure 2 196, but in some embodiments, similar components may be used to implement Figure 2 Other devices shown in environment 100.

[0060] refer to Figure 3A , an illustrative interaction depicted as being for instantiation of a sub-tenant-specific virtual machine will be described. Figure 3A The interaction assumes that the SaaS provider has previously interacted with the serverless code execution system 110 to create a function whose execution is supported by an executable code file or a disk image. For example, a user can provide a disk image in the form of a manifest and a set of layers.

[0061] Figure 3A The interaction begins at (1), where the user device 102 transmits a call request to the front end 120, and the front end 120 may receive the call request from the user device 102. For example, the user device 102 may be operated by an end user associated with a subtenant account of the SaaS provider. The user device 102 may be separate and distinct from the SaaS provider when using the services of the SaaS provider (including the serverless function). Illustratively, the call request may include a serverless function identifier and a subtenant identifier (alternatively referred to as "attributes" of the call request). The call request may also include other data, such as a payload to be used by the serverless function and a return address to which a response is to be sent. The serverless function identifier may indicate a specific serverless function to be activated. If multiple versions of the serverless function are supported, the serverless function identifier may include a version identifier indicating a specific version of the serverless function to be activated. The serverless function identifier may be a key-value pair, where the value may indicate the serverless function identifier and the key may indicate that this is a request for the serverless function. The subtenant identifier may be assigned by the SaaS provider to the subtenant account associated with the end user. For example, the subtenant identifier may be a customer identifier or some other unique identifier associated with a subtenant account (e.g., associated with an end user). The subtenant identifier may include a tenant identifier indicating a SaaS provider associated with the serverless function. In some embodiments, the subtenant identifier may include an enterprise identifier indicating a tenant of the SaaS provider and a sub-subtenant identifier of an end user of the enterprise using the SaaS provider. The subtenant identifier may be a key-value pair, where the value is the subtenant identifier and the key indicates that this is a multi-tenant mode serverless function request.

[0062] At (2), the front end 120 may retrieve the configuration from the configuration data store 174. For example, the front end 120 may retrieve an executable code file, a disk image or a snapshot, an identifier thereof, or metadata associated therewith corresponding to the serverless function identifier (possibly including a version identifier) ​​from the configuration data store 174. For example, the front end 120 may retrieve the metadata to confirm that the serverless function supports multi-tenant mode. If so, the front end 120 may continue to handle the call request according to the multi-tenant mode; otherwise, the front end 120 may determine that the call request is malformed and handle it accordingly (e.g., transmit an error reply and exit the activation process), or handle the call request as in a non-multi-tenant mode (thereby ignoring the subtenant identifier). The front end 120 may retrieve the disk image or snapshot to transmit the disk image or snapshot to the worker 181 (via various components) to configure the VM instance to be instantiated. Alternatively, the front end 120 may transmit the identifier of the disk image or snapshot to the worker 181 (via various components) so that the worker 181 can retrieve the executable code file, disk image or snapshot and configure the VM instance to be instantiated.

[0063] At (3), (4), (5), and (6), the front end 120, the tenant manager 196, and the IAM data store 192 can collaborate to determine whether the call request is authorized to proceed. At (3), the front end 120 can request authorization from the tenant manager 196. For example, the front end 120 can transmit the serverless function identifier and the subtenant identifier to the tenant manager 196. Note that the front end 120 can also include a request to authorize the caller separate from the call request.

[0064] At (4), the tenant manager 196 may retrieve an IAM policy from the IAM data store 192. For example, the tenant manager 196 may determine a specific IAM policy associated with a serverless function identifier from a set of policies and retrieve the specific IAM policy. For example, the specific IAM policy may be associated with all serverless functions associated with a SaaS provider, as indicated by a tenant identifier of a serverless function identifier or a subtenant identifier. Those skilled in the art will recognize that the specific IAM policy may be for a subset of all serverless functions associated with a SaaS provider, or the specific IAM policy may be associated with a subtenant identifier. In the case where the specific IAM policy is associated with a serverless function, the specific IAM policy may indicate which subtenants can (or cannot) access the serverless function. In the case where the specific IAM policy is associated with a subtenant identifier, the specific IAM policy may indicate which serverless functions the subtenant account associated with the subtenant identifier can (or cannot) access.

[0065] At (5), tenant manager 196 may determine whether the call request is authorized to proceed. For example, in a first scenario, tenant manager 196 may determine whether the call request is authorized to proceed based on the retrieved IAM policy, the serverless function identifier, and the subtenant identifier. For example, tenant manager 196 may determine that the subtenant identifier is authorized (not authorized) to access (or not) the serverless function based on the retrieved IAM policy.

[0066] In some embodiments, the tenant manager 196 may determine the context of the call request and determine whether the call request is authorized to proceed based on the context, even if a specific IAM policy indicates that it can proceed. For example, the tenant manager 196 may retrieve concurrency data and telemetry data (collectively referred to as "context") from the log data store 194 and determine whether one or more conditions are met to limit the request rate. In general, the one or more conditions may include a concurrency condition, a load condition, a pending condition, a requester condition, a response time condition, or a combination thereof. As an example, if the number of concurrent VM instances (both subtenant-specific VM instances and non-tenant-specific VM instances) associated with a SaaS provider (as indicated by a tenant identifier of a serverless function identifier or a subtenant identifier) ​​exceeds a threshold, the tenant manager 196 may determine whether the concurrency condition is met. If a condition in the one or more conditions is met, the tenant manager 196 may determine that the call request is not authorized to proceed; if any of the one or more conditions is not met, the tenant manager 196 may determine that the call request is authorized to proceed. In some embodiments, if the tenant manager 196 determines that the call request is not authorized to proceed, the tenant manager 196 may queue the call request and authorize the call request if no conditions are met, or the tenant manager 196 may deny the call request and indicate a general denial of proceeding or a specific problem indicating the denial. In the case where the requested call is queued, the call request may time out after a period of time. The tenant manager 196 may queue the request in various ways, such as in a first-in-first-out process, on a per-subtenant basis, on a per-tenant basis, or for the entire system 110, depending on the type of one or more conditions that are met.

[0067] At (6), the tenant manager 196 may transmit authorization for the call request to proceed. For example, when the tenant manager 196 determines that the call request is authorized to proceed based on a specific IAM policy and optionally the context, the tenant manager 196 may transmit authorization for the call request to proceed.

[0068] In some embodiments, (2) may depend on determining that the call request is authorized to proceed, that is, if the call request is not authorized to proceed, then (2) may not be executed. In some embodiments, (3), (4), (5) and (6) may depend on (2) indicating that the requested serverless function is indicated as a multi-tenant mode serverless function, that is, if the requested serverless function is indicated as not a multi-tenant mode serverless function, then (3), (4), (5) and (6) may not be executed. In some embodiments, (3), (4), (5) and (6) and (2) may be executed in parallel, and if it is determined that the call request is authorized to proceed and the requested serverless function is indicated as a multi-tenant mode serverless function, then the front end 120 may only proceed.

[0069] At (7), the front end 120 may transmit the reservation request to the worker manager 140. For example, the front end 120 may distribute the reservation request from the front end 120 to the worker manager 140 in a manner similar to the call request discussed above. The reservation request may include a serverless function identifier and a subtenant identifier. The reservation request may include other data, such as instructions based on the context of the call request. The worker manager 140 may receive the reservation request.

[0070] At (8), the worker manager 140 may update the journal. For example, the worker manager 140 may write a new entry to the journal in the log data store 194 to indicate a new instantiation of a VM instance associated with the serverless function identifier and the subtenant identifier. The new entry may include other data, such as a timestamp or other contextual data.

[0071] At (9), worker manager 140 may transmit a new sub-tenant VM request to placement service 160. For example, worker manager 140 may transmit a new sub-tenant VM request to placement service 160 to contact placement service 160 to request a lease for an additional instance 183, as discussed above. The new sub-tenant VM request may include a serverless function identifier and a sub-tenant identifier. Placement service 160 may receive the new sub-tenant VM request.

[0072] At (10), the placement service 160 may retrieve the tag from the tenant manager 196. For example, the placement service 160 may retrieve the session tag from the tenant manager 196 by providing the tenant manager 196 with a subtenant identifier; the tenant manager 196 may determine the session tag and return the session tag to the placement service 160. In this manner, the tenant manager 196 ensures data non-leakage by managing the session tags because the tenant manager 196 may ensure that the session tags are not duplicated at the same time and / or correspond to authorized entities (e.g., subtenant accounts, based on a similar process as discussed above with respect to authorization). The tenant manager 196 may generate the session tag when the tenant manager 196 receives an authorization request (e.g., in anticipation of subsequent contact from the placement service 160), or the tenant manager 196 may generate the session tag when the tenant manager 196 receives the subtenant identifier from the placement service 160. The tenant manager 196 or the placement service 160 may update the new entry in the journal with the session tag by updating the journal in the log data store 194. Alternatively, the placement service 160 may generate a session tag based on the subtenant identifier and notify the tenant manager 196 so that the tenant manager 196 can, for example, track and manage the session tag without slowing down the instantiation process. Alternatively, the front end 120 may transmit the session tag (from the tenant manager 196) to the placement service 160 via transmitting a reservation request to the worker manager 140, which may transmit the session tag via transmitting a new subtenant VM request. For example, the tenant manager 196 may provide the session tag when indicating authorization to proceed with the serverless function. In some embodiments, an IAM policy may be dynamically executed by the tenant manager 196 to provide the session tag. For example, in response to an IAM request to retrieve a session tag (e.g., to assume the role of a subtenant), the tenant manager 196 may execute a dynamic policy based on a parameter of the IAM request (e.g., the subtenant identifier). In this way, the scale of subtenants supported by the SaaS provider is not limited by the generation of IAM policies or their subsequent updates.

[0073] At (11), the placement service 160 may instantiate a sub-tenant-specific VM instance. For example, the placement service 160 may identify an appropriate instance 183 (e.g., heated with software and / or data required to support calls to implement the task) and grant the manager 140 a lease on the instance 183. The placement service 160 may not select a hot instance 183 that has been assigned as a sub-tenant-specific VM instance 183, but may select a hot instance that has not been assigned as a sub-tenant-specific instance 183 and that has appropriate software and / or data that can be updated to perform a specific configuration of the serverless function. In the event that such an instance 183 does not exist, the placement service 160 may instruct the worker 181 to create such an instance 183 (as discussed above) and grant the worker manager 140 a lease on the instance 183. In either case, placement service 160 can assign the identified instance 183 or the created instance 183 as a subtenant-specific VM instance 183 associated with the subtenant identifier, and transmit the session ticket to the subtenant-specific VM instance 183 to modify the temporary credentials of the subtenant-specific VM instance using the session ticket. In this manner, when the subtenant-specific VM instance 183 is activated, the subtenant-specific VM instance 183 can assume the role of the subtenant when transmitting outgoing requests to other services (such as tenant resources 150).

[0074] At (12), the placement service 160 (or worker 181) may update the journal to indicate the identity of the sub-tenant specific VM instance 183. Thus, the journal may be updated to identify which sub-tenant specific VM instance 183 is currently assigned to a particular sub-tenant, whether that sub-tenant specific VM instance 183 is instantiated, in use, or idle. Additionally or alternatively, the placement service 160 (or worker 181) may notify the front end 120 when the sub-tenant specific VM instance 183 is ready.

[0075] refer to Figure 3B , an illustrative interaction depicted as being used to activate a sub-tenant specific virtual machine will be described. Figure 3B The interaction assumes that a previous call request has been transmitted by the user device 102, and Figure 3A In some embodiments, Figure 3B The interaction is immediately followed by Figure 3A After the interaction, that is, the sub-tenant specific VM instance 183 instantiated to serve the specific call request is activated.

[0076] In other embodiments, Figure 3BThe interaction may occur after the specific call request is handled by at least one subtenant-specific VM instance 183 assigned to the subtenant identifier and a subsequent call request from the same subtenant is received. In that case, the front end 120 may determine whether at least one subtenant-specific VM instance 183 is assigned to the subtenant identifier and / or the serverless function identifier, and whether any of the at least one subtenant-specific VM instances 18 is available (e.g., hot and not in use) to handle the subsequent call request before transmitting the reservation request (as in (7)) or retrieving the configuration (as in (2)) to handle the subsequent call request. For example, in order to determine whether at least one subtenant-specific VM instance 183 is assigned to the subtenant identifier and / or the serverless function identifier, the front end 120 may search the log to determine whether any subtenant-specific VM instance 183 is associated with the subtenant identifier and the serverless function identifier. In order to determine whether the subtenant-specific VM instance 183 (if any) is available, the front end 120 may determine whether the subtenant-specific VM instance 183 is hot (e.g., ready), not in use, and not retired. If the subtenant-specific VM instance 183 is available, the front end 120 (or the worker manager 140, or other components of the system 110) can select one of the available subtenant-specific VM instances 183 to handle the subsequent call request. If the subtenant-specific VM instance 183 is not available (e.g., all are in use, or have been retired) or there is no subtenant-specific VM instance 183 assigned to the subtenant identifier and the serverless function identifier, the front end 120 can proceed (as in Figure 3A ), to instantiate the sub-tenant specific VM instance 183.

[0077] Figure 3B The interaction begins at (13), where the front end 120 activates the serverless function on the sub-tenant specific VM instance 183. For example, the front end 120 may transmit a call to the sub-tenant specific VM instance 183 based on the call request. The call may include a request based on the framework of the serverless function as defined by the tenant. For example, the call may include a data payload, a request to retrieve specific data, a request to update data based on the data payload, etc. The sub-tenant specific VM instance 183 may receive the call from the front end 120. The front end 120 may update the journal to indicate that the sub-tenant specific VM instance 183 is in use.

[0078] At (14), the subtenant-specific VM instance 183 may execute the code of the activated serverless function according to the executable code file, disk image, and / or snapshot associated with the serverless function and provided by the SaaS provider. Illustratively, at (15), the subtenant-specific VM instance 183 may retrieve the subtenant data under subtenant-level access from the tenant data store 152 as part of executing the code of the activated serverless function. For example, the subtenant-specific VM instance 183 may transmit a request to the tenant data store 152, wherein the session tag enables the subtenant-specific VM instance 183 to assume the role of the subtenant, so that the tenant data store 152 provides access to the subtenant's restricted data. For example, the tenant data store 152 may check with the tenant manager 196 whether the IAM policy associated with the tenant data store 152 authorizes the specific session tag to access the subtenant data; if so, the tenant data store 152 may provide access to the subtenant data; if not, the tenant data store 152 may deny access to the subtenant data. For example, the code may not include the session tag (or verification token) in the call to the tenant data store 152. Instead, the worker 181 hosting the VM instance 183 can supplement the call with a session ticket (or authentication token) so that the code does not have to worry about authentication. Alternatively, the code can refer generically to the authentication information (e.g., as an environment variable), and the worker 181 can populate the environment variable with the session ticket (or authentication token) as linked to the generic identifier. In this way, the code can work regardless of the session ticket (or authentication token).

[0079] At (16), the sub-tenant specific VM instance 183 may transmit the response to the front end 120. For example, the sub-tenant specific VM instance 183 may generate a response according to the code of the activated serverless function and transmit the response to the front end 120. The front end 120 may receive the response.

[0080] At (17), front end 120 may relay the response to user device 102. For example, front end 120 may repackage the response so that the response is transmitted to a return address of user device 102. Alternatively, (16) and (17) may be omitted, and the sub-tenant specific VM instance may transmit the response directly to user device 102. In this case, the sub-tenant specific VM instance may notify front end 120 or tenant manager 196 to notify that the response has been sent to user 102.

[0081] At (18), the front end 120 may notify the tenant manager 196 that a response has been sent. For example, the front end 120 may indicate that a response has been sent, along with optional data such as response time, load, pending status, subtenant / user requester. The tenant manager 196 may receive notification that a response has been sent.

[0082] At (19), the tenant manager 196 may generate logs and update the log data in the log data store 194. For example, the tenant manager 196 may update the telemetry data. The tenant manager 196 may also update the appropriate journal entry for the sub-tenant specific VM instance 183 to reflect that it is no longer in use.

[0083] In some embodiments, the tenant manager 196 may (via the workload manager 140 or other components of the system 110) keep the sub-tenant specific VM instance 183 in a hot state in case the sub-tenant has additional calls to be processed. Generally speaking, the sub-tenant specific VM instance 183 may remain in a hot state until a scale-down policy retires the sub-tenant specific VM instance 183. This may be based on various criteria, such as the time period since the last call request for the serverless function identifier and the sub-tenant identifier, the load of the system 110, the concurrency of the tenant, or a combination thereof.

[0084] refer to Figure 4 , an illustrative routine 400 for managing invocation of a serverless function using a sub-tenant specific virtual machine will be described. The routine 400 can be implemented, for example, by the serverless code execution system 110, which includes Figure 1 One or more components, such as front end 120, worker manager 140, placement service 160, worker 181, and tenant service 190.

[0085] Routine 400 begins at block 402, where system 110 may determine whether a call request for a serverless function has been received from a user device. For example, front end 120 may wait for a call request from a user device, but in general, the call request may be automated from other system components or other systems. Therefore, in general, front end 120 may wait for a call request. In general, each call may be associated with a caller (e.g., a subtenant, service, user device, service, etc. that transmits the call). In response to determining that a call request for a serverless function has not been received (block 402: No), system 110 may return to wait for a call request at block 402.

[0086] At block 404, in response to determining that a call request for a serverless function has been received (block 402: yes), the system 110 can determine whether the serverless function is a multi-tenant serverless function. For example, the system 110 can retrieve metadata and determine that the serverless function is a multi-tenant serverless function, as discussed above, but in general, the system can determine whether the call request indicates a multi-tenant call request.

[0087] At box 406, in response to determining that the serverless function is a multi-tenant serverless function (box 404: yes), the system 110 may determine whether there is at least one hot sub-tenant-specific VM associated with the sub-tenant identifier. For example, the system 110 may determine the sub-tenant associated with the call by determining the sub-tenant based on the sub-tenant identifier, and determine whether there is at least one hot sub-tenant-specific VM associated with the sub-tenant identifier and the serverless function identifier, as discussed above. Alternatively, the system 110 may automatically instantiate a sub-tenant-specific VM instance 183 for the sub-tenant identifier (e.g., proceeding directly to box 414 discussed below) without regard to whether there is at least one hot sub-tenant-specific VM associated with the sub-tenant identifier. For example, in some embodiments, the system 110 may be able to instantiate a VM for each call and quickly recycle the VM to handle the next call (without exposing sub-tenant data in between).

[0088] At block 408, in response to determining that there is at least one hot sub-tenant-specific VM associated with the sub-tenant identifier (block 406: yes), the system 110 can select a hot sub-tenant VM associated with the sub-tenant identifier. For example, the system 110 can select the hot sub-tenant-specific VM instance 183 from the available hot sub-tenant-specific VM instances based on various criteria (such as age, load, etc.).

[0089] At block 410, the system 110 may activate the serverless function on the hot sub-tenant specific VM. For example, the system 110 may transmit the call to the selected sub-tenant specific VM instance 183 according to the call request, as discussed above. After receiving the call, the sub-tenant specific VM may execute the associated code (or image). In general, the sub-tenant specific VM may already have a session tag (e.g., a currently active session tag transmitted to the sub-tenant specific VM during instantiation), or the sub-tenant specific VM may have transmitted a session tag (e.g., a new session tag). Thus, the sub-tenant specific VM may assume the role of the sub-tenant when executing the associated code (such as when interacting with the tenant service 150).

[0090] At block 412, the system 110 may respond to the user device based on the output of the serverless function. For example, the system 110 may execute the code of the serverless function on the selected sub-tenant specific VM instance, generate a response, and transmit the response to the user device 102, as discussed above. Note that the response may be directed to any entity that transmitted the call request, not just the user device. The routine 400 may return to block 402, where the system 110 may determine whether a call request for the serverless function has been received from the user device.

[0091] At block 414, in response to determining that there is no hot subtenant-specific VM associated with the subtenant identifier (block 406: No), the system 110 can instantiate the subtenant-specific VM instance 183 for the subtenant identifier. For example, the system 110 can instantiate the subtenant-specific VM instance with a session tag to assume the role of the subtenant when executing code associated with the serverless function, as discussed above.

[0092] At block 416, the system 110 may activate the serverless function on the instantiated sub-tenant specific VM instance 183. For example, the system 110 may transmit a call to the instantiated sub-tenant specific VM instance 183 according to the call request, as discussed above. After receiving the call, the instantiated sub-tenant specific VM may execute the associated code (or image). In general, the instantiated sub-tenant specific VM may assume the role of the sub-tenant when executing the associated code (such as when interacting with the tenant service 150).

[0093] The routine 400 may then proceed to block 412 where the system 110 may respond to the user device based on the output of the serverless function, and return to block 402 where the system 110 may determine whether a call request for the serverless function has been received from the user device.

[0094] At block 418, in response to determining that the serverless function is not a multi-tenant serverless function (block 404: No), the system 110 may determine whether there is at least one hot VM. For example, the system 110 may determine whether there is at least one hot non-tenant specific VM instance 183, as discussed above.

[0095] At block 420, in response to determining that there is at least one hot VM (block 418: YES), system 110 may select a hot VM. For example, system 110 may select hot VM instance 183 from available hot VM instances that are not hot tenant-specific VM instances, as described above.

[0096] At block 422, the system 110 may activate the serverless function on the hot VM. For example, the system 110 may transmit the call to the selected hot VM instance 183 according to the call request, as discussed above. The routine 400 may then proceed to block 412, where the system 110 may respond to the user device based on the output of the serverless function, and return to block 402, where the system 110 may determine whether a call request for the serverless function has been received from the user device.

[0097] At block 424, in response to determining that there is no hot VM (block 418: NO), system 110 may instantiate VM instance 183. For example, system 110 may instantiate VM instance 183 without a session tag.

[0098] At block 426, the system 110 may activate the serverless function on the instantiated VM instance 183. For example, the system 110 may transmit the call to the instantiated VM instance 183 according to the call request, as discussed above. The routine 400 may then proceed to block 412, where the system 110 may respond to the user device based on the output of the serverless function, and return to block 402, where the system 110 may determine whether a call request for the serverless function has been received from the user device.

[0099] Generally speaking, the system 110 can confirm authorization to proceed with the call request before proceeding with any of blocks 404 to 426. In this way, the IAM policy can ensure appropriate access to subtenant data.

[0100] Therefore, the systems and methods of the present disclosure can build multi-tenant applications using a shared model (thus avoiding dedicated infrastructure for each sub-tenant), while minimizing security issues by using sub-tenant-specific VM instances or containers to provision a fresh execution environment to handle requests from each sub-tenant (thus avoiding exposure of persistent data to unauthorized entities). In addition, the multi-tenant mode of the serverless code execution system can manage credentials corresponding to the requesting sub-tenant, so that the activated serverless function can access other tenant-level services that support the multi-tenant architecture.

[0101] Various additional exemplary embodiments of the present disclosure may be described by the following additional clauses:

[0102] Clause.2 A serverless code execution system comprising:

[0103] one or more data stores including information of a set of identity and access management (IAM) policies that define access to a serverless function hosted by the serverless code execution system, wherein the serverless function is associated with a software as a service (SaaS) provider;

[0104] one or more worker devices that host a set of execution environments, wherein each execution environment is associated with the serverless function, and wherein the set of execution environments are partitioned based on a sub-tenant of the SaaS provider; and

[0105] The one or more computing devices of the serverless code execution system, the one or more computing devices being configured to:

[0106] receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier;

[0107] determining, based on the serverless function identifier, whether the serverless function is configured for a multi-tenant mode of the serverless code execution system;

[0108] In response to determining that the serverless function is configured for the multi-tenant mode of the serverless code execution system, determining whether the call is authorized to proceed based on at least one IAM policy in the set of IAM policies;

[0109] In response to determining that the call is authorized to proceed, determining a subtenant among the subtenants based on the subtenant identifier;

[0110] In response to determining the subtenant, identifying a subtenant-specific execution environment associated with the subtenant in the set of execution environments, wherein other calls from other subtenants in the subtenants to execute the serverless function are blocked from being activated on the subtenant-specific execution environment; and

[0111] In response to identifying the sub-tenant specific execution environment, activating the serverless function on the sub-tenant specific execution environment.

[0112] Clause.3 A serverless code execution system according to Clause 1, wherein the one or more computing devices are further configured to use the sub-tenant-specific execution environment to interact with one or more tenant services to access sub-tenant data based on a verification token indicating the sub-tenant.

[0113] Clause .4 The serverless code execution system of clause 1, wherein to identify the subtenant-specific execution environment associated with the subtenant, the one or more computing devices are further configured to:

[0114] determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and

[0115] In response to determining that any execution environment in the set of execution environments is not associated with the sub-tenant identifier and the serverless function identifier, wherein in order to instantiate the sub-tenant specific execution environment, the one or more computing devices utilize a verification token to generate the sub-tenant specific execution environment so that the sub-tenant specific execution environment assumes the role of the sub-tenant.

[0116] Clause .5 A serverless code execution system according to Clause 3, wherein in order to instantiate the sub-tenant specific execution environment, the one or more computing devices are further configured to select a non-tenant specific execution environment in a hot state to be modified into the sub-tenant specific execution environment, or to create the sub-tenant specific execution environment, wherein the one or more computing devices of the serverless code execution system transmit the verification token to the sub-tenant specific execution environment.

[0117] Clause 6. A computer-implemented method comprising:

[0118] A set of execution environments is maintained by a multi-tenant cloud service provider, wherein each execution environment is associated with a serverless function, wherein the serverless function is associated with a software as a service (SaaS) provider that is a tenant of the cloud service provider, wherein the SaaS provider provides services to a plurality of sub-tenants, wherein the set of execution environments is partitioned based on the sub-tenants of the SaaS provider;

[0119] receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier;

[0120] identifying a subtenant-specific execution environment in the set of execution environments that is associated with the subtenant identifier; and

[0121] The serverless function is activated on the sub-tenant specific execution environment.

[0122] Clause .7 The computer-implemented method of Clause 5 further comprises using the sub-tenant-specific execution environment to interact with one or more tenant services to access tenant data based on a verification token indicating the sub-tenant.

[0123] Clause .8 The computer-implemented method of Clause 5, wherein identifying the subtenant-specific execution environment associated with the subtenant comprises:

[0124] determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and

[0125] In response to determining that any execution environment in the set of execution environments is not associated with the sub-tenant identifier and the serverless function identifier, the sub-tenant specific execution environment is instantiated, wherein the instantiation of the sub-tenant specific execution environment includes generating the tenant specific execution environment using a verification token so that the sub-tenant specific execution environment assumes the role of the sub-tenant.

[0126] Clause .9 A computer-implemented method according to Clause 7, wherein instantiating the sub-tenant specific execution environment comprises: selecting a non-tenant specific execution environment in a hot state to be modified into the sub-tenant specific execution environment, or creating the sub-tenant specific execution environment, wherein the sub-tenant specific execution environment obtains the verification token based on the sub-tenant identifier.

[0127] Clause .10. The computer-implemented method of Clause 5, wherein identifying the subtenant-specific execution environment associated with the subtenant comprises:

[0128] determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and

[0129] In response to determining that at least one execution environment of the set of execution environments is associated with the subtenant identifier and the serverless function identifier, an execution environment of the at least one execution environment is selected as the subtenant-specific execution environment.

[0130] Clause .11 The computer-implemented method according to Clause 9 further comprises: before selecting the execution environment in the at least one execution environment as the sub-tenant-specific execution environment, determining whether any execution environment in the at least one execution environment is available to handle the call.

[0131] Clause.12 A computer-implemented method according to Clause 5, further comprising: activating the serverless function on the sub-tenant specific execution environment, and determining whether the call is authorized to proceed based on at least one IAM policy in a set of IAM policies and / or the context of the call.

[0132] Clause.13 A computer-implemented method according to clause 11, wherein determining whether the call is authorized to proceed based on the context comprises: retrieving context data; determining whether one or more conditions are met to limit the call rate; and in response to any of the one or more conditions being not met, determining that the call is authorized to proceed.

[0133] Clause .14 One or more non-transitory computer-readable media comprising computer-executable instructions that, when executed on a serverless computing system, cause the serverless computing system to:

[0134] A set of execution environments is maintained by a multi-tenant cloud service provider, wherein each execution environment is associated with a serverless function, wherein the serverless function is associated with a software as a service (SaaS) provider that is a tenant of the cloud service provider, wherein the SaaS provider provides services to a plurality of sub-tenants, wherein the set of execution environments is partitioned based on the sub-tenants of the SaaS provider;

[0135] receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier;

[0136] identifying a sub-tenant-specific execution environment associated with the sub-tenant in the set of execution environments; and

[0137] The serverless function is activated on the sub-tenant specific execution environment.

[0138] Clause. 15 One or more non-transitory computer-readable media as described in Clause 13, wherein the sub-tenant-specific execution environment assumes the role of the sub-tenant.

[0139] Clause .16 One or more non-transitory computer-readable media as described in Clause 13, wherein the computer-executable instructions further cause the serverless computing system to use the sub-tenant-specific execution environment to interact with one or more tenant services to access tenant data based on a verification token indicating the sub-tenant.

[0140] Clause .17. The one or more non-transitory computer-readable media of Clause 13, wherein, to identify the subtenant-specific execution environment associated with the subtenant, the computer-executable instructions further cause the serverless computing system to:

[0141] determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and

[0142] In response to determining that any execution environment in the set of execution environments is not associated with the subtenant identifier and the serverless function identifier, the subtenant-specific execution environment is instantiated, wherein the instantiation of the subtenant-specific execution environment includes generating the subtenant-specific execution environment using a verification token so that the subtenant-specific execution environment assumes the role of the subtenant.

[0143] Clause .18 One or more non-transitory computer-readable media as described in Clause 16, wherein, in order to instantiate the sub-tenant specific execution environment, the computer executable instructions further cause the serverless computing system to: select a non-tenant specific execution environment in a hot state to be modified into the sub-tenant specific execution environment, or create the sub-tenant specific execution environment, wherein the sub-tenant specific execution environment obtains the verification token based on the sub-tenant identifier.

[0144] Clause .19. The one or more non-transitory computer-readable media of Clause 13, wherein, to identify the subtenant-specific execution environment associated with the subtenant, the computer-executable instructions further cause the serverless computing system to:

[0145] determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and

[0146] In response to determining that at least one execution environment of the set of execution environments is associated with the subtenant identifier and the serverless function identifier, an execution environment of the at least one execution environment is selected as the subtenant-specific execution environment.

[0147] Clause .20 One or more non-transitory computer-readable media as described in Clause 18, wherein, before activating the serverless function on the sub-tenant-specific execution environment, the computer-executable instructions further cause the serverless computing system to: determine whether the call is authorized to proceed based on at least one IAM policy in a set of IAM policies and / or the context of the call.

[0148] Clause .21 One or more non-transitory computer-readable media as described in Clause 19, wherein, in order to determine whether the call request is authorized to proceed based on the context, the computer-executable instructions further cause the serverless computing system to: retrieve context data; determine whether one or more conditions are met to limit the call rate; and in response to any of the one or more conditions being not met, determine that the call is authorized to proceed.

[0149] All methods and processes described above may be embodied in software code modules executed by one or more computers or processors and fully automated via the software code modules. The code modules may be stored in any type of non-transitory computer-readable medium or other computer storage device. Alternatively, some or all of the methods are embodied in dedicated computer hardware.

[0150] Unless otherwise specifically stated, conditional language such as "may," "could," "might," or "might," etc., should generally be understood within the context as being used to present that certain embodiments include certain features, elements, and / or steps while other embodiments do not. Thus, such conditional language is generally not intended to imply that the features, elements, and / or steps are required by one or more embodiments in any way, or that one or more embodiments necessarily include logic for determining, with or without user input or prompting, whether such features, elements, and / or steps are included in any particular embodiment or whether such features, elements, and / or steps will be performed in any particular embodiment.

[0151] Unless specifically stated otherwise, disjunctive language such as the phrase "at least one of X, Y, or Z" should be understood by context as being generally used to present an item, term, etc. that can be X, Y, or Z, or any combination thereof (e.g., X, Y, and / or Z). Thus, such disjunctive language is generally not intended to, and should not, imply that certain embodiments require that at least one of X, at least one of Y, or at least one of Z each be present.

[0152] Unless expressly stated otherwise, articles such as "a" or "an" should generally be interpreted as including one or more of the described items. Thus, phrases such as "a device configured to..." are intended to include one or more of the recited devices. Such one or more recited devices may also be collectively configured to perform the stated statements. For example, "a processor configured to perform statements A, B, and C" may include a first processor configured to perform statement A working in conjunction with a second processor configured to perform statements B and C.

[0153] Any routine description, element or block in the flowcharts described herein and / or depicted in the accompanying drawings should be understood to potentially represent a module, segment or portion of code, which includes one or more executable instructions for implementing a specific logical function or element in the routine. Alternative implementations are included within the scope of the embodiments described herein, where, as will be understood by those skilled in the art, depending on the functionality involved, elements or functions may be deleted or executed out of the order shown or discussed, including substantially simultaneous execution or reverse order execution.

[0154] It should be emphasized that many changes and modifications can be made to the above described embodiments, and the elements of the changes and modifications should be understood as being in other acceptable examples. In this article, all such modifications and changes are intended to be included within the scope of this disclosure and protected by the appended claims.

Claims

1. A computer-implemented method comprising: A set of execution environments is maintained by a multi-tenant cloud service provider, wherein each execution environment is associated with a serverless function, wherein the serverless function is associated with a software as a service (SaaS) provider that is a tenant of the cloud service provider, wherein the SaaS provider provides services to a plurality of sub-tenants, wherein the set of execution environments is partitioned based on the sub-tenants of the SaaS provider; receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier; identifying a subtenant-specific execution environment in the set of execution environments that is associated with the subtenant identifier; and The serverless function is activated on the sub-tenant specific execution environment.

2. The computer-implemented method of claim 1 , further comprising using the sub-tenant specific execution environment to interact with one or more tenant services to access tenant data based on an authentication token indicative of the sub-tenant.

3. The computer-implemented method of claim 1 or 2, wherein identifying the subtenant-specific execution environment associated with the subtenant comprises: determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; as well as In response to determining that any execution environment in the set of execution environments is not associated with the subtenant identifier and the serverless function identifier, the subtenant-specific execution environment is instantiated, wherein the instantiation of the subtenant-specific execution environment includes generating the tenant-specific execution environment using a verification token so that the subtenant-specific execution environment assumes the role of the subtenant.

4. The computer-implemented method of claim 3, wherein instantiating the sub-tenant specific execution environment comprises: A non-tenant specific execution environment in a hot state is selected to be modified into the sub-tenant specific execution environment, or the sub-tenant specific execution environment is created, wherein the sub-tenant specific execution environment obtains the verification token based on the sub-tenant identifier.

5. The computer-implemented method of any preceding claim, wherein identifying the sub-tenant-specific execution environment associated with the sub-tenant comprises: determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; as well as In response to determining that at least one execution environment of the set of execution environments is associated with the subtenant identifier and the serverless function identifier, an execution environment of the at least one execution environment is selected as the subtenant-specific execution environment.

6. The computer-implemented method of claim 5, further comprising: Prior to selecting the execution environment of the at least one execution environment as the sub-tenant specific execution environment, determining whether any execution environment of the at least one execution environment is available to handle the call.

7. The computer-implemented method of any preceding claim, further comprising: Prior to activating the serverless function on the subtenant-specific execution environment, determining whether the call is authorized to proceed based on at least one of an identity and access management (IAM) policy or a context of the call.

8. The computer-implemented method of claim 7, wherein determining whether the call is authorized to proceed based on the context comprises: Retrieve context data; determining whether one or more conditions are satisfied to limit the call rate; And in response to any of the one or more conditions not being satisfied, determining that the call is authorized to proceed.

9. A system comprising: a data storage area storing computer executable instructions; and a processor configured to execute the computer-executable instructions, wherein executing the computer-executable instructions causes the system to: maintaining a set of execution environments, wherein each execution environment is associated with a serverless function, wherein the serverless function is associated with a software as a service (SaaS) provider that is a tenant of a multi-tenant cloud service provider, wherein the SaaS provider provides services to a plurality of sub-tenants, wherein the set of execution environments is partitioned based on the sub-tenants of the SaaS provider; receiving a call to execute a serverless function, wherein the call includes a serverless function identifier and a subtenant identifier; identifying a sub-tenant-specific execution environment associated with the sub-tenant in the set of execution environments; and The serverless function is activated on the sub-tenant specific execution environment.

10. The system of claim 9, wherein the subtenant-specific execution environment assumes a role of the subtenant.

11. A system according to any one of claims 9 to 10, wherein the computer executable instructions further cause the serverless computing system to use the sub-tenant specific execution environment to interact with one or more tenant services to access tenant data based on a verification token indicating the sub-tenant.

12. The system of any one of claims 9 to 11, wherein to identify the subtenant-specific execution environment associated with the subtenant, the computer-executable instructions further cause the system to: determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and In response to determining that any execution environment in the set of execution environments is not associated with the subtenant identifier and the serverless function identifier, the subtenant-specific execution environment is instantiated, wherein the instantiation of the subtenant-specific execution environment includes generating the subtenant-specific execution environment using a verification token so that the subtenant-specific execution environment assumes the role of the subtenant.

13. A system according to claim 12, wherein in order to instantiate the sub-tenant specific execution environment, the computer executable instructions further cause the system to: select a non-tenant specific execution environment in a hot state to be modified into the sub-tenant specific execution environment, or create the sub-tenant specific execution environment, wherein the sub-tenant specific execution environment obtains the verification token based on the sub-tenant identifier.

14. The system of any one of claims 9 to 13, wherein to identify the subtenant-specific execution environment associated with the subtenant, the computer-executable instructions further cause the system to: determining whether any execution environment in the set of execution environments is associated with the subtenant identifier and the serverless function identifier; and In response to determining that at least one execution environment of the set of execution environments is associated with the subtenant identifier and the serverless function identifier, an execution environment of the at least one execution environment is selected as the subtenant-specific execution environment.

15. A system according to claim 14, wherein before activating the serverless function on the sub-tenant specific execution environment, the computer executable instructions further cause the system to determine whether the call is authorized to proceed based on at least one of an identity and access management (IAM) policy or the context of the call.