You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Sandbox application
Wildcard domain configuration for sandbox applications
Copy page
Download PDF
Wildcard domain configuration for sandbox applications
A sandbox application is the fundamental unit of a cloud sandbox, which is used for managing resource scheduling and operation. This topic mainly describes how to create, use, and manage cloud sandbox applications in the veFaaS console.​
Creating sandbox applications​
Prerequisites​
  • An API Gateway (APIG) instance and corresponding services (domain names) have been created to expose the application endpoint. For details, see Creating instances and Creating services.​
  • (Optional) The Volcano Engine Torch Log Service (TLS) has been activated. If you need to use a custom logging project to handle function logs, ensure that the project and topics have already been created. For details, see Creating log projects and Creating log topics. ​
  • (Optional) The Volcano Engine Virtual Private Cloud (VPC) service has been activated, and a VPC, subnets, and security groups have been created in the region where the function is to be deployed. For details, see Creating VPCs, Creating subnets, and Creating security groups.​
  • (Optional) Read Mounting TOS for instructions related to Torch Object Storage (TOS).​
Procedure​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. In the left navigation bar, click Cloud sandbox > Sandbox app. Then, click Create sandbox app.​
  1. On the Create sandbox applications page, specify parameters according to the following instructions.​
  • ​
    Parameter​
    Description​
    Basic information​
    ​
    Name​
    Specify a custom name for the sandbox application. The sandbox application name must be unique within the same account. The name cannot be modified after being created.​
    Description​
    Enter the description of the sandbox application. It can be left empty.​
    For sandbox images​
    ​
    Container image​
    Deploy sandbox applications by using container images:​
    • Public image: The ready-to-use public images provided by default.​
    • Custom images: The custom images that are already preheated. You can filter images by ID or address.​
    For the description of sandbox images, see Sandbox images.​
    Startup command​
    ​
    Enter a start command for the application. If you need to specify a script file, use an absolute path and make sure that the script file has executable permissions.​
    tip​
    • If you set the Container image parameter to Public image, veFaaS will provide the default start command based on the selected image. You can modify the command if necessary.​
    • If you set the Container image parameter to Custom images: veFaaS will automatically parse the configuration file of the target image to obtain the start command. You can modify it if necessary.​
    Listening port​
    Enter the port that the HTTP server listens on.​
    warning​
    • Avoid using the ports that are already occupied by veFaaS: 9000, 9001, 9990.​
    • The enabled HTTP server needs to listen on 0.0.0.0:Port or *:Port. Otherwise, a request timeout error will occur.​
    Gateway routing configuration​
    ​
    Domain type​
    The domain type of the sandbox application. Valid values:​
    • Unified domain: All the instances in a sandbox application share the same domain name. You can target a specific instance by including the x-faas-instance-name header or the faasInstanceName query parameter in requests.​
    For description of sandbox instances, see Sandbox instances.​
    APIG instance​
    Select an APIG instance. The sandbox application will use an APIG instance as the traffic entrance.​
    Gateway service​
    Select the service that corresponds to the APIG instance.​
    Route name​
    Specify a custom route name. The route name cannot be modified after being created.​
    Path​
    Set a request path through which the sandbox application can be accessed. It can be matched only by a prefix and must start with a forward slash (/).​
    Environment variables​
    ​
    Environment variables​
    ​
    Configure custom environment variables, which can be directly read during the runtime of the function code.​
    tip​
    If you set the Container image parameter to Custom images, veFaaS will automatically parse the configuration file of the target image to obtain the environment variables for the image. You can modify it if necessary.​
    Advanced settings​
    For details, see Function configuration.​
    ​
  1. Read and select the checkbox of Function Service Terms of Service and Function Service Product Service Level Agreement, and then click Confirm to create the sandbox application.​
Managing sandbox applications​
After creating a sandbox application, you can view its basic information, monitoring information, and logs. You can also manage it and set queries per minute (QPM) for the API that creates sandbox instances.​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. In the left navigation bar, click Cloud sandbox > Sandbox app.​
  1. On the Sandbox app page, view information about the sandbox application.​
  • ​
    Module category​
    Description​
    User-level QPM configuration​
    [Beta - apply for trial] There is a limit on the number of requests initiated by a sandbox application to create sandbox instances per minute. If different sandbox applications under the root user initiate instance creation requests concurrently, resource contention may occur, and resource quotas for high-priority business applications (such as inference applications) may be affected. In this scenario, veFaaS allows you to configure user-level QPM to provide resource isolation and priority guarantee.​
    After your application for using the beta feature is approved, you can view the shared QPM quota for all sandbox applications within the current account on the Sandbox app page. You can click Apply for user quota to obtain technical support and update the user-level QPM quota.​
    Quick deployment through templates​
    Display various sandbox application templates provided by veFaaS for quick deployment of sandbox applications. For more descriptions, see Cloud sandbox template.​
    Sandbox application information​
    In the sandbox application list, you can view the observability (monitoring information and logs) information of the target sandbox application, as well as other basic information such as tags, number of instances, and image addresses.​
    ​
  1. Find a sandbox application and click the application name to go to the details page.​
  • Top of the details page​
  • You can release or delete the application in the upper-right corner of the details page.​
  • Basic information​
  • ​
    Feature module​
    Description​
    Parameter configuration​
    View or modify the parameters of the sandbox application. For information about parameters, see the Creating sandbox applications section of this topic.​
    Change notice​
    Provides release prompts after configuration changes. After the configurations of the application are updated, the console will clearly display the differences in configuration items before and after the change. You can release the application based on the on-screen prompts.​
    ​
  • For sandbox instances​
  • ​
    Feature module​
    Description​
    Resource statistics​
    Displays the total number of instances and the number of running instances of the current application.​
    Resource quotas​
    Displays the usage and utilization of resources. You can click Apply for more to apply for higher quotas in Quota Center.​
    • Maximum number of instances: Displays the number of created instances of the current application and the proportion of the created instances to the quota. Click Settings to adjust the maximum number of available instances and the number of warm pools for the current application. If you need to configure more instances, go to Quota Center and apply for more resources by using the SandboxFunctionInstancesLimit parameter.​
    • Memory usage: Displays the memory usage of the current application and the proportion of the memory usage to the quota for the current account. You can apply for more resources in the Quota Center by using the SandboxMemory parameter.​
    • vCPU usage: Displays the vCPU usage of the current application and the proportion of the vCPU usage to the quota for the current account. You can apply for more resources in the Quota Center by using the SandboxVCPU parameter.​
    • Application QPM limit: [Beta - apply for trial] The application-level QPM configuration for cloud sandboxes allows you to control the number of requests to create sandbox instances per minute in the current sandbox application. This achieves more fine-grained resource quota management.​
    • After you apply to use the beta feature and configure the application-level QPM for the first time with technical support, you can view the QPM of the sandbox application in the Resource quotas module. You can click Apply next to the QPM to update the application-level QPM quota with technical support.​
    Instances​
    Display the instances of current sandbox application. If no sandbox instance is available, click Create sandbox instances to create one. For details, see Creating sandbox instances.​
    ​
  • Update log​
  • ​
    Feature module​
    Description​
    Update details​
    Displays the change information of the sandbox application. Click Change ID to view specific changes during a specific period of time.​
    Version rollback​
    Click Roll back in the Actions column that corresponds to a specific update ID. After the secondary confirmation, the application will be rolled back to the historical version.​
    ​
  • Monitoring​
  • You can view or configure monitoring for sandbox applications. For details, see Monitoring and logs.​
  • Logging​
Testing sandbox applications​
The following content will use an image named sandbox-fusion and tagged as Code type as an example to demonstrate how to test a sandbox application.​
Testing by using APIG​
Execute the curl command locally to call the API to test the cloud sandbox application. You can specify instance requests by using x-faas-insatnce-name.​
  • Replace https://****.apigateway-cn-beijing.volceapi.com with the actual access address of your cloud sandbox function.​
  • Replace the value of data as needed.​
tip​
  • If you are usingvefaas-public/sandbox-fusion, read the open-source document Sandbox fusion and then replace the value of the data parameter.​
  • If you are using a custom image, specify the value of the data parameter according to the actual requirements.​
  • ​
    curl 'https://****.apigateway-cn-beijing.volceapi.com/run_code' \​
    -H 'accept: application/json, text/plain, */*' \​
    -H 'accept-language: zh-CN,zh;q=0.9' \​
    -H 'content-type: application/json' \​
    -H 'x-faas-instance-name: vefaas-ojxvvagw-ondm2cscas-d1eg8b1vnaumg4bf9190-sandbox' \​
    --data '{​
    "code": "ls",​
    "language": "bash",​
    "files":{}​
    }'​
    ​
Performing testing by using Playground​
  1. On the details page of the sandbox application, go to the Basic information tab and find the Gateway routing configuration section, where you can view the access address of the application.​
  1. On the Sandbox Fusion page, click the Playground tab and then click Sandbox in the left navigation bar.​
  1. In the Code textbox, select a programming language and enter your code, and then click Submit to submit the code.​
  • After the code is run, view the result.​
Last updated: 2026.08.19 14:06:07