FunctionGraph allows you to mount file systems to your functions. Multiple functions can share the same file system. This greatly expands the function execution and storage space compared with the temporary disk space allocated to a function.
FunctionGraph supports the following types of file systems:
SFS Turbo
SFS Turbo supports the following storage classes: Standard (500 GB-32 TB), Standard-Enhanced (10 TB-320 TB), Performance (500 GB-32 TB), and Performance-Enhanced (10 TB-320 TB). SFS Turbo is expandable to 320 TB, and provides fully hosted shared file storage. It features high availability and durability, and supports massive quantities of small files and applications requiring low latency and high input/output operations per second (IOPS). SFS Turbo is suitable for high-performance websites, log storage, compression and decompression, DevOps, enterprise offices, and containerized applications. For details, see SFS Service Overview.
ECS
A directory on an ECS is specified as a shared file system (see Mounting an ECS Shared Directory) by using the network file system (NFS) service. The directory can then be mounted to a function in the same VPC as the ECS so that the function can read and write data in the directory. ECS file systems make it possible for dynamic expansion of compute resources. This type of file system is suitable for low service demand scenarios.
Benefits from using these file systems:
The function execution space can be greatly expanded comparing with /tmp.
A file system can be shared by multiple functions.
ECS compute resources can be dynamically expanded and existing ECS storage capability can be used to achieve stronger computing performance.
Note
You can write temporary files in the /tmp directory. The total size of these files cannot exceed 10,240 MB.
Before adding file systems to a function, specify an agency with permissions for accessing the file system services for the function.
There is a limit on the maximum number of agencies you can create, and cloud service agencies cannot be modified. Therefore, you are advised to create an agency with high-level permissions, for example, Tenant Administrator, to allow a function to access all resources in the selected region. For more information, see Configuring Agency Permissions.
Before mounting an SFS Turbo file system to a function, specify an agency that has been granted SFS Administrator and VPC Administrator permissions for the function. If no agencies are available, create one in IAM.
Configuring VPC Access
An SFS Turbo file system is accessible only in the VPC where it has been created. Before mounting such a file system to a function, enable VPC access for the function.
On the SFS console, obtain the information about the VPC and subnet where a file system is to be mounted to your function. For details, see "File System Management".
Enable VPC access by referring to Configuring the Network and enter the VPC and subnet obtained in 1.
Mounting an SFS Turbo File System
SFS Turbo file systems can be mounted in the same way as SFS file systems. Select a file system and set the access path.
Before mounting an ECS shared directory to a function, specify an agency that has been granted Tenant Guest and VPC Administrator permissions for the function. If no agencies are available, create one in IAM. For details, see Creating an Agency.
Configuring VPC Access
Before adding an ECS shared directory, specify the VPC where the ECS is deployed. View the VPC information on the details page of the ECS. Click the VPC name to go to the VPC details page, and view the subnet.
Set the acquired VPC and subnet for the function.
Mounting an ECS Directory
Enter a shared directory and function access path.
Local repository address: file:///path/to/local/repo
gpgcheck: indicates whether to enable the GNU privacy guard (GPG) to check the validity and security of RPM package resources. 0: The GPG check is disabled. 1: The GPG check is enabled. If this option is not specified, the GPG check is enabled by default.
Save the configurations.
Run the following command to clear the cache:
yumcleanall
Run the following command to install nfs-utils:
yuminstallnfs-utils
Create a shared directory.
When you open /etc/exports and need to create shared directory /sharedata, add the following configuration:
/sharedata 192.168.0.0/24(rw,sync,no_root_squash)
Note
The preceding configuration is used to share the /sharedata directory with other servers in the 192.168.0.0/24 subnet.
After the preceding command is run, run the exportfs -v command to view the shared directory and check whether the setting is successful.
Run the following commands to start the NFS service:
systemctlstartrpcbindservicenfsstart
Create another shared directory.
For example, to create the /home/myself/download directory, add the following configuration to /etc/exports: