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
Gem Browser
Deploying Gem Browser applications with a few clicks
Copy page
Download PDF
Deploying Gem Browser applications with a few clicks
This topic describes how to deploy a Gem Browser application with a few clicks by using the Application Center of Volcano Engine Function as a Service (veFaaS).​
tip​
This feature is in beta. Contact your account manager to apply for a trial.​
Background information​
  • Application introduction​
GEM Browser is a lightweight cloud browser sandbox service that supports the Chrome DevTools Protocol (CDP) protocol, Puppeteer and Playwright tools, Server-Sent Events (SSE)/streamable HTTP calls, and Virtual Network Computing (VNC) remote operations. GEM Browser delivers the following features:​
  • Lightweight browser kernel with a significantly faster response than standard Chrome​
  • Supports CDP, with a single browser instance running in a container​
  • Supports browser display and manual takeover through VNC and Canvas, with screen resolution adjustable during runtime​
  • Supports proxy integration​
  • Supports custom browser add-ons such as uBlock​
  • Supports visual-mode screenshots (with browser tabs) and GUI operations​
  • Runtime​
Native runtime​
  • Associated cloud services​
warning​
The fees for using associated cloud services will be incurred. For billing details, see the billing documentation of the associated cloud services.​
  • veFaaS: veFaaS is used to create sandbox instances.​
Prerequisites​
  • All the cloud services associated with the application have been activated.​
  • The VeFaaSFullAccess, APIGFullAccess, and STSAssumeRoleAccess policies have been attached to Identity and Access Management (IAM) users. If one of the preceding policies is not attached, contact the root user or the administrator for authorization. For details, see Creating and authorizing users.​
  • An APIG instance of the serverless gateway type has been created. For detailed operations, see Creating instances.​
  • If you use veFaaS for the first time, make sure that the cross-service authorization is complete. If the authorization is not complete, the cross-service authorization page will appear, which provides guidance on authorization.​
  • A cloud sandbox instance has been created, and its access address has been obtained. For details, see Creating sandbox instances. You can also create a sandbox instance by using an API or an all-in-one SDK. For details, see the Creating sandbox instances by using the API or SDK section of this topic.​
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 App > My app.​
  1. On the My app page, click Create app.​
  1. On the Create app page, find the Gem Browser template and click Create.​
  1. On the Create app page, specify the parameters of the application.​
  • Basic information​
​
Parameter​
Description​
Selected template​
Displays the selected template. In this scenario, the template is Gem Browser.​
Name​
Specify a custom name for the application.​
Description​
Enter the description of the application. This parameter can be left empty.​
IAM role​
The Application Center provides the system default role ServerlessApplicationRole, which is granted permissions on some cloud resources that the Application Center needs to access.​
  • If your user roles do not contain this role, this role will be automatically added.​
  • If your user roles contain this role, the system will automatically detect whether all the policies required for the application are attached to this role. If a required policy is not attached, the console will display the name of the policy. You can click Add policy to add the policy.​
warning​
  • Make sure that the IAMReadOnlyAccess policy is attached to IAM users. Otherwise, they will not be authorized to obtain information about the ServerlessApplicationRole role.​
  • If IAM users need to attach policies to the ServerlessApplicationRole role, make sure that the IAMFullAccess policy is attached to the IAM users.​
Associated cloud services​
Displays the names, activation status, and activation purposes of all the cloud services that the current application needs to use.​
warning​
For more information about possibly incurred fees and account balance requirements when you use the associated cloud services, see veFaaS billing and APIG billing.​
​
  • Advanced settings​
​
Parameter​
Description​
Region​
The region where the application and its associated cloud resources are located.​
Function name​
Specify a custom name for the function.​
APIG instance​
Select the prepared APIG instance. APIG trigger-related resources will be automatically created for the APIG instance, including services, Upstreams, and routes.​
​
  1. Click Confirm to create and deploy the application.​
You will be automatically redirected to the application details page, which displays the application deployment logs in real time.​
Result validation​
After the application is deployed, click the access address under API Gateway in the cloud resources section of the application details page to open the interactive interface of your application.​
What to do next​
Using All-in-One Sandbox​
You can call All-in-One Sandbox by using an API, SDK, and MCP.​
  • API​
  • SDK​
tip​
In the sample code, $URL indicates the access endpoint of the sandbox. For the method of obtaining the endpoint, see Accessing sandbox instances.​
  • ​
    from agent_sandbox import Sandbox​
    from agent_sandbox.browser import Action_Click, Action_MoveTo, Action_Typing​
    ​
    # Initialize client​
    client = Sandbox(base_url="$URL")​
    ​
    # Get browser information​
    browser_info = client.browser.get_browser_info()​
    print(f"CDP URL: {browser_info.cdp_url}")​
    print(f"Viewport: {browser_info.viewport}")​
    ​
    # Take screenshot​
    screenshot_data = client.browser.take_screenshot()​
    with open("screenshot.png", "wb") as f:​
    for chunk in screenshot_data:​
    f.write(chunk)​
    ​
    # Execute GUI actions​
    # Move mouse to position​
    client.browser.execute_action(​
    request=Action_MoveTo(x=500, y=300)​
    )​
    ​
    # Click at current position​
    client.browser.execute_action(​
    request=Action_Click()​
    )​
    ​
    # Type text​
    client.browser.execute_action(​
    request=Action_Typing(text="Hello World")​
    )​
    ​
Related document​
Creating sandbox instances by using the API or SDK​
In addition to creating sandbox instances in the veFaaS console, you can also create sandbox instances by using an API or an all-in-one SDK.​
  • API​
  • SDK​
  • The sample Python all-in-one SDK is as follows.​
  • ​
    from __future__ import print_function​
    ​
    import os​
    import sys​
    ​
    # Add the parent directory to Python path so we can import agent_sandbox​
    sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))​
    ​
    from agent_sandbox.providers import VolcengineProvider​
    ​
    ​
    def main():​
    """​
    Main function demonstrating Volcengine provider usage.​
    """​
    # Configuration - replace with your actual credentials​
    access_key = os.getenv("VOLC_ACCESSKEY")​
    secret_key = os.getenv("VOLC_SECRETKEY")​
    region = os.getenv("VOLCENGINE_REGION", "cn-beijing")​
    ​
    # Initialize the Volcengine provider​
    provider = VolcengineProvider(​
    access_key=access_key,​
    secret_key=secret_key,​
    region=region​
    )​
    ​
    print("=== Volcengine Sandbox Provider Example ===\n")​
    ​
    function_id = "yato****"​
    ​
    print("1. Creating a sandbox...")​
    sandbox_id = provider.create_sandbox(function_id=function_id)​
    print(f"Create response: {sandbox_id}")​
    ​
    ​
    if __name__ == "__main__":​
    main()​
    ​
​
Last updated: 2026.08.19 14:06:07