Funcraft is discontinued and no longer receives updates. If you use Funcraft to manage Function Compute resources, migrate to Serverless Devs. Serverless Devs supports additional capabilities such as stress testing and dependency installation.
This topic explains how to migrate to two Serverless Devs components: the FC component and the Resource Orchestration Service (ROS) component.
Choose a migration path
Select a migration path based on your current setup:
| Target component | Migration method | When to use |
|---|---|---|
| FC component | Run conversion command (recommended) | You have a Funcraft template.yml in your project directory and have not yet deployed resources |
| FC component | Sync resources | Your functions are already deployed to Function Compute and you want to skip YAML conversion |
| ROS component | Run conversion command | You manage infrastructure with ROS and need a ROS-compatible s.yaml |
For more information about Serverless Devs components, see Components.
Prerequisites
Before you begin, make sure you have:
Serverless Devs installed and configured
A Funcraft project with a
template.ymlfile, or functions already deployed to Function Compute
Migrate to the FC component
Method 1: Run the conversion command (recommended)
This method converts your Funcraft template.yml into a Serverless Devs s.yaml.
Navigate to the directory of the function managed by Funcraft.
Run the conversion command:
s cli fc fun2s --target s.yamlThe command generates an
s.yamlfile in the project directory. The output looks similar to:fc-transform.zip file decompression completed [2021-09-02T10:31:28.870] [INFO ] [FC-TRANSFORM] - Using funcraft yaml: /test/demo/template.yml [2021-09-02T10:31:28.884] [INFO ] [FC-TRANSFORM] - Reminder serverless devs yaml path: /test/demo/s.yaml Tips for next step ====================== * Invoke Event Function: s local invoke -t s.yaml * Invoke Http Function: s local start -t s.yaml * Deploy Resources: s deploy -t s.yaml End of method: fun2s
Parameters
| Parameter | Required | Description |
|---|---|---|
--source | No | Path to the Funcraft function directory. |
--target | No | Name of the output YAML file. Defaults to s.yaml or s.yml. Specify this parameter to use a custom file name. |
--force | No | Overwrites the output file if a file with the same name already exists. |
--region | Yes | Region where you want to deploy the resources. |
Method 2: Sync resources
If your functions are already deployed to Function Compute, sync them directly instead of converting a YAML file. This lets you start managing existing deployments with Serverless Devs.
For sync command details, see Sync commands.
Migrate to the ROS component
Navigate to the directory of the function managed by Funcraft.
Run the conversion command:
s cli fc-transform fun2ros --target s.yamlThe command generates an
s.yamlfile in the project directory. The output looks similar to:[2021-09-02T10:34:53.909] [INFO ] [FC-TRANSFORM] - Using funcraft yaml: /test/demo/template.yml [2021-09-02T10:34:53.923] [INFO ] [FC-TRANSFORM] - Reminder serverless devs yaml path: /test/demo/s.yaml Tips for next step ====================== * Deploy Resources: s deploy -t s.yaml End of method: fun2ros
Parameters
| Parameter | Required | Description |
|---|---|---|
--source | No | Path to the Funcraft function directory. |
--target | No | Name of the output YAML file. Defaults to s.yaml or s.yml. Specify this parameter to use a custom file name. |
--force | No | Overwrites the output file if a file with the same name already exists. |
--region | Yes | Region where you want to deploy the resources. |
What to do after migration
After the s.yaml file is generated, use it to manage your functions with Serverless Devs:
Test locally before deploying:
Event functions:
s local invoke -t s.yamlHTTP functions:
s local start -t s.yaml
Deploy to Function Compute:
s deploy -t s.yaml