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
Native runtime
Code package-based deployment
Copy page
Download PDF
Code package-based deployment
Native functions support two deployment methods: using code packages and using images. For code package-based deployments, first package your code files into a ZIP file. This topic describes how to package your code.​
Limits​
  • If your main program depends on other local files (for example, config.yaml), include these dependencies in the package and reference them via relative paths in your code.​
  • The maximum size of a ZIP file that can be uploaded via the veFaaS console is 256 MiB. If your ZIP file exceeds 256 MiB, submit a ticket for technical support.​
Procedure​
  1. If you are using a compiled language (such as Go), write a compilation script (build.sh) to compile the code before packaging files. The following is an example of the build.sh compilation script.​
​
#! /bin/bash​
set -ex​
cd `dirname $0`​
​
go mod tidy​
​
# Note: the binary should be compiled using linux env so as to run on FaaS Platform XD.​
GOOS=linux GOARCH=amd64 go build -v -ldflags '-w -extldflags "-static"' -o main​
​
  1. In the current directory of the program, execute the following commands to compile the code and package the files.​
​
./build.sh​
​
zip -FSr vefaas-native-default.zip .​
​
What to do next​
  1. Create a Web app function in the veFaaS console. When you create the function, set its deployment method to "Code" and the code package type to "Upload code locally". For detailed steps, see Creating Web applications.​
  1. Release your function code and configuration. For details, see Releasing functions.​
​
Last updated: 2026.08.19 14:06:05