Function Compute provides common layers. You can configure the layer feature for your functions without providing custom layers. This topic describes how to configure common layers for a function.
Common layers supported by Function Compute
Function Compute supports the following types of common layers. For more information about common layers, see Common layers.
Custom runtimes
Custom runtimes, such as Python 3.10 and Node.js 17, are included. In addition, collections
of the dependency libraries for some custom runtimes are provided. For example, the
common layer Python310-Package-Collection
contains some dependency libraries commonly used in Python.
Common layer | Compatible runtime | Description |
---|---|---|
Python310 | Custom | Python 3.10.5 runtime layer |
Python310-Package-Collection | Custom | A collection of common dependency libraries for the Python 3.10 runtime |
Python39 | Custom | Python 3.9.13 runtime layer |
Python39-Package-Collection | Custom | A collection of common dependency libraries for the Python 3.9 runtime |
Python38 | Custom | Python 3.8.13 runtime layer |
Python38-Package-Collection | Custom | A collection of common dependency libraries for the Python 3.8.13 runtime |
Python36 | Custom | Python 3.6.15 runtime layer |
Python36-Package-Collection | Custom | A collection of common dependency libraries for the Python 3.6.15 runtime |
Dotnet6 | Custom | ASP.NET 6.0.5 runtime layer |
PHP81 | Custom | PHP 8.1 runtime layer |
PHP80 | Custom | PHP 8.0 runtime layer |
PHP72 | Custom | PHP 7.2 runtime layer |
Java11 | Custom | Java 11 runtime layer |
Java17 | Custom | Java 17 runtime layer |
Nodejs17 | Custom | Node.js 17 runtime layer |
Nodejs16 | Custom | Node.js 16 runtime layer |
Nodejs14 | Custom | Node.js 14 runtime layer |
Nodejs12 | Custom | Node.js 12 runtime layer |
Common dependency libraries
Common layer | Compatible runtime | Description | Version (the version number of the core library) |
---|---|---|---|
Python39-SciPy1x |
|
An open source scientific computing library |
|
Python39-PyTorch1x |
|
An open source machine learning framework (CPU edition) |
|
Python39-Pandas1x |
|
An open source data analysis and processing tool based on NumPy |
|
Nodejs-Puppeteer17x |
|
A Headless Chrome tool | puppeteer-v17.1.0 |
Alibaba Cloud SDKs
Common layer | Compatible runtime | Description | Version |
---|---|---|---|
Aliyun-DataX |
|
Open source edition of Alibaba Cloud DataWorks Data Integration | datax_v202205 |
Only part of the common layers are listed. If you fail to find the layer that you want to use, Contact Us.
Configure common layers by using the console
Prerequisites
Create a functionProcedure
- Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
- In the top navigation bar, select a region. On the Services page, click the desired service.
- On the Functions page, find the desired function and click Configure in the Actions column.
- In the Layers section, click + Add Layer and select Add Official Common Layer from the drop-down list.
- In the Official Common Layer drop-down list, view the layer description and license information and select a common layer. Select a layer version from the Layer Version drop-down list, and then click Save.
- A function can be configured with a maximum of five layers, including custom layers and public layers.
- When multiple layers are configured for a function, the content of these layers is merged and stored in the /opt directory in reverse order. If layers contain files with the same name, the files in the first configured layer overwrites the files with the same names in the later configured layer.
Configure common layers by using Serverless Devs
Prerequisites
Procedure
Additional information
You can use OpenAPI Explorer to call API operations and use SDKs.