The deployment uploads the code package to Data 360. After deployment, your function is available as a chunking strategy option in the search index builder.
| Edition Table |
|---|
| Available in: Developer, Enterprise, Performance, and Unlimited Editions. See Data 360 edition availability. |
| User Permissions Needed | |
|---|---|
| To deploy a custom function and use it for search index chunking: | Permission set: <ul><li>Data Cloud Architect</li></ul> |
Prerequisites
- Write your custom chunking function and validate it locally. See Write a Custom Chunking Function.
Deploy Your Custom Function by Using the Salesforce CLI
-
Open a terminal, and go to the root of your code extension function package (the folder that contains
payload/).cd <path-to-root-folder-of-function-package> -
Make sure that you are signed in to the target org.
sf org display --target-org <ORG_ALIAS> -
Refresh package metadata from the package root.
sf data-code-extension function scan --entrypoint ./payload/entrypoint.py -
Deploy your code extension function.
sf data-code-extension function deploy --name <DEPLOYMENT_NAME> --package-version <PACKAGE_VERSION> --description "<DESCRIPTION>" --package-dir <PACKAGE_DIR> --target-org <ORG_ALIAS> [--network <NETWORK_VALUE>] [--cpu-size CPU_L|CPU_XL|CPU_2XL|CPU_4XL]Example:
sf data-code-extension function deploy --name <DEPLOYMENT_NAME> --package-version <PACKAGE_VERSION> --description "<DESCRIPTION>" --package-dir ./payload --target-org <ORG_ALIAS> --cpu-size CPU_XL
-
--name <DEPLOYMENT_NAME>(required): Name for your code extension deployment. -
--package-version <PACKAGE_VERSION>(required): Semantic version for the package (for example,1.0.0). -
--description "<DESCRIPTION>"(required): Short description of the deployment. -
--package-dir ./payload(required): Directory that contains your packaged function (typically./payloadunder the package root). -
--target-org <ORG_ALIAS>(required): Org username or alias (same as othersfcommands). -
--cpu-size(optional): The CPU size:CPU_L,CPU_XL,CPU_2XL(default), orCPU_4XL. Larger sizes provide more processing power but consume more credits. To understand how the compute size affects the compute model and credit consumption, see Salesforce Help: Billing Considerations for Code Extension. -
--network(optional): Network setting for packages that include Jupyter notebooks (for example,hostfor host network mode).Example:
sf data-code-extension function deploy --name my_chunking_function --package-version 1.0.0 --description "Custom chunking for product pages" --package-dir ./payload --target-org myorg --cpu-size CPU_L
- Confirm that the code deployment is successful. See Monitor Custom Function Deployments.