This container deploys a Python function to Cognite Functions, optionally with schedule(s).
In Azure Pipelines sample repo: https://github.com/cognitedata/functions-deploy-azure-pipelines
Set as environment variables when executing python /app/index.py
INPUT_FUNCTION_EXTERNAL_ID: What we will use as external_id for the function. If it is not unique within your project, the existing function will be overwritten!INPUT_FUNCTION_FOLDER: Parent folder for the function's code. Everything within this folder will be uploaded (so if you need your special CSV-file; don't worry, it will automatically be included!)INPUT_CDF_PROJECT: The name of your CDF project.INPUT_CDF_CLUSTER: The cluster your customer's CDF project lives in, like westeurope-1 or greenfield.INPUT_DEPLOYMENT_CLIENT_SECRET: Client secret, only to be used for DEPLOYMENT of the function.INPUT_DEPLOYMENT_CLIENT_ID: Client ID, only to be used for DEPLOYMENT of the function.INPUT_DEPLOYMENT_TENANT_ID: Tenant ID, only to be used for DEPLOYMENT of the function.INPUT_SCHEDULE_FILE: File location inside function_folder containing a list of schedules to be attached to your function. If this file exists, then schedules_client_secret, schedules_client_id and schedules_tenant_id will be required. Note: Schedule file will be ignored with a warning if it is pointing to a non-existing file. More details in section below.INPUT_SCHEDULES_CLIENT_SECRET: Client secret to be used at RUNTIME for the function, but ONLY for its scheduled runs! Note: Calling the function normally, still uses the caller's credentials!.INPUT_SCHEDULES_CLIENT_ID: Client ID to be used at RUNTIME for the function, but ONLY for its scheduled runs!INPUT_SCHEDULES_TENANT_ID: Tenant ID to be used at RUNTIME for the function, but ONLY for its scheduled runs!All optional parameters that has default values, can be found in src/defaults.py, i.e. they are not defined in action.yaml because of the typical multi-deploy-pattern used with this action.
INPUT_REMOVE_ONLY: Short-cut: Deletes function along with all attached schedules. Ignores most other parameters!INPUT_COMMON_FOLDER: The path to the folder containing code that is shared between functions. See section below for more details.INPUT_FUNCTION_FILE: The name of the file with your main function. Will default to handler.py if not given.INPUT_FUNCTION_SECRETS: The name of a Github secret that holds the base64-encoded JSON dictionary with secrets (see "secrets section").INPUT_FUNCTION_DEPLOY_TIMEOUT: The timeout limit (in seconds) for the function deployment. Once the timeout is reached, the deployment is canceled (an attempt to delete the function will be made).INPUT_DATA_SET_ID: Data set ID to use for the file uploaded to CDF (the function-associated file: zipped code folder). Requires two additional DEPLOYMENT capabilities: 'dataset:READ' and 'files:WRITE' scoped to either the dataset you are going to use, or 'all'. Note: If your data set is WRITE PROTECTED, you also need to add the capability 'dataset:OWNER' for it. Read more about data sets in the official documentation: Data setsINPUT_POST_DEPLOY_CLEANUP: Delete the code file object from CDF Files after successful Function deployment. Defaults to true.INPUT_DESCRIPTION: Additional field to describe the function.INPUT_OWNER: Additional field to describe the function owner.INPUT_CPU: Set fractional number of CPU cores per function. Ignored for functions running on Azure!. See defaults and allowed values in the API documentation.INPUT_MEMORY: Set memory per function measured in GB. Ignored for functions running on Azure!. See defaults and allowed values in the API documentation..yaml]- name: Daily schedule
cron: "0 0 * * *"
data:
lovely-parameter: True
something-else: 42
- name: Hourly schedule
cron: "0 * * * *"
data:
lovely-parameter: False
something-else: 777
- name: Hourly schedule # Same name as another schedule (allowed), but with no `data` (also allowed).
cron: "0 * * * *"
Content type
Image
Digest
sha256:4205789eb…
Size
384.6 MB
Last updated
almost 2 years ago
docker pull cognite/function-action:v1-github