Version: 6.3.3

Actions Overview

This is an overview of actions in Cortex Fabric.

At the core of every Skill is the action it takes to process data when it is invoked. Cortex supports two types of actions:

  • Jobs: Used to process high volumes of data that would normally consume long-term memory if run in the foreground, as well as for running programs that require little to no user interaction and are required to run on a regular basis.
  • Daemons: Web servers typically used for ML predictions and serving inquiries. Once started, a daemon runs indefinitely.

Jobs and daemons are deployed to Cortex and executed inside of Docker images.

List Actions

NOTE: Use options --project projectId or --profile profileName if you are not authenticated to a specific project or profile context.

To identify the actions that have been deployed independently from Skills for a project run:

cortex actions list --project projectName

A list of actions is returned. Actions that are deployed as part of a Skill are NOT listed. You can use these names to execute other action monitoring commands.

Response Example

┌────────────────────┬────────┬───────────────────────────┬──────────────────────┬─────────────────┐
│ Name │ Type │ Image │ Modified │ Author │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ test/actionr1 │ │ busybox │ 8 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ test/actionr2 │ │ busybox │ 8 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ daemonGood │ daemon │ busybox │ 2 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ cortex/httpbin │ daemon │ kennethreitz/httpbin │ 7 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ cortex/daemonGood │ daemon │ busybox │ 2 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤
│ hubblejob │ job │ hubblejob:py3 │ 2 months ago │ - │
├────────────────────┼────────┼───────────────────────────┼──────────────────────┼─────────────────┤

Get Action details

To fetch the details of an action including its status run:

cortex actions describe <actionName> --project projectName

Example

cortex actions describe hubblejob --project johan

Response Example

{
"_isDeleted": false,
"command": [],
"_projectId": "johan",
"name": "hubblejob",
"description": "",
"image": "hubblejob:py3",
"type": "job",
"scaleCount": 1,
"environment": "",
"environmentVariables": null,
"actionId": "cknz95z820000016t9ll5gfdx",
"createdAt": "2021-04-26T23:49:47.285Z",
"updatedAt": "2021-04-26T23:49:47.285Z",
"_version": 1
}

Delete Actions

Actions deleted from CLI are removed from deployment and the catalog, but they remain in your system database. The delete command sets the isDeleted flag for all versions of the action.

If you delete an action that is being used by a Skill/Agent, the Skill/Agent will no longer run.

To delete an action run the following CLI command:

cortex actions delete <action-name>

Define and Deploy Actions

Actions are defined as part of the Skill Definition process described here.

After they have been defined, Actions are saved/deployed as part of the Skill Definition described here in step 4.

Podspec

The podspec patch file is created for Kubernetes jobs and daemons. It provides full customization of the deployed action resources, including allocation of memory and vcpu resources and support for reserved GPU nodes. The podspec patch is merged with and overwrites the Kuberenetes job or daemon spec created by Fabric during action deployment. The podspec file is saved locally as a json file.

To use the podspec option when you save/deploy an action, append the command with -podspec file_location

Deploy with Additional K8S Resources

Optionally additional Kubernetes resource can be deployed along with a Skill's action.

When you save/deploy an action, use -k or -k8sResource option to pull in JSON or yaml files that define additional Kubernetes Resources for that are deployed with Skills using the Action.

cortex actions save -k hpa-file-locatioon.yaml pdb-file-location.yaml vs-file-location.yaml -- action-definition.json

EXAMPLE

cortex actions save -k retry-timeout.yaml pdb-example.yaml hpa-example.yaml -- action.json

Kubernetes Resources that you may configure and upload as .JSON or .YAML files that are saved locally.

Explanation, instructions and examples can be found at the links provided.

Types of K8S Resources