Deploy a Package
This page provides an overview of how to use the package deploy command in the CLI.
Once a package has been uploaded to kdb Insights Enterprise, it is ready for deployment.
- Run the Deploy command to bring your services online, as shown below.
Using the web interface or the CLI
kdb Insights Enterprise has both a web interface and command line interface (CLI). You can use either one to deploy or tear down a package. For information on how to deploy a database or pipeline configuration using the web interface, refer to the documentation on managing packages using the kdb Insights Enterprise Web Interface.
Deploy package
The deploy command enables you to deploy the database and pipeline entities defined in your package inside kdb Insights Enterprise. Run this command to deploy the full package:
kxi pm deploy mypackage
Running this command finds the latest version of the package to deploy. If you want to deploy a specific version, use the following command:
kxi pm deploy mypackage 1.0.0
This command searches kdb Insights Enterprise for mypackage
, version=1.0.0
and deploys its contents.
Deploy a specific pipeline
To deploy one pipeline instead of the full package, specify the pipeline when running the command. For example:
kxi pm deploy mypackage --pipeline pipe1
To deploy multiple pipelines included in the package, run the following command:
kxi pm deploy mypackage --pipeline pipe1 --pipeline pipe2
Deploy a specific database
To deploy a specific database included in the package, specify the database when running the kxi pm deploy
command. For example:
kxi pm deploy mypackage --db mydb
Deploy using --env
To inject environment variables when deploying a pipeline or a database, add --env
to your command. For example, by running the following command, the package deploys one pipeline with environment variables:
kxi pm deploy mypackage --pipeline pipe1 --env MYVAR=1
You can use the help command to provide information regarding the additional options.
Usage: kxi pm deploy [OPTIONS] PACKAGE [VERSION]
Deploy a package to an insights instance.
PACKAGE: package-name VERSION: package-version
╭─ Authentication option overrides ────────────────────────────────────────────╮
│ --hostname,--url TEXT Insights URL │
│ --realm TEXT Realm │
│ --client-id TEXT Client id │
│ --client-secret TEXT Client secret │
│ --auth-enabled/--auth-disabled Retrieve Bearer Token │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --env TEXT Inject environment │
│ variables to the deployed │
│ package. │
│ `[component_name:]VAR=valu… │
│ --output-format -o [json|table|csv|simple] Output format for the list │
│ command │
│ --db TEXT Deploy a database in the │
│ package │
│ --pipeline TEXT Deploy a pipeline in the │
│ package │
│ --server-timeout INTEGER Timeout for Insights server │
│ calls │
│ --yes,--assume-yes -y Automatic yes to prompts; │
│ assume "yes" as answer to │
│ all prompts andrun │
│ non-interactively. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Refer to the tracking deployments section further down for information on how to verify the status of your package.
For editing pipelines/databases without downloading the full package, refer to the documentation on the kxi pm edit
command
Inject Environment Variables
You can inject environment variables when you deploy a package to make small changes to settings in your package, such as to increase or decrease an application limit. Note that this is only available in the CLI.
There are two ways to inject environment variables during deployment using the --env
modifier:
Set environment variables for all components
Set an environment variable for all the components being deployed by using --env KEY=VALUE
. This applies the variable to the full package, or to the specific pipeline/database if only one pipeline or database is being deployed. For example:
kxi pm deploy mypackage --env myenvar=1
In the example above, kdb Insights Enterprise deploys the package named mypackage and sets the myenvar environment variable to a value of 1 on every process.
To change the value of myenvar, run the deploy command again with the new desired value. The command automatically tears down the existing deployment and deploys again with the new value.
Set environment variables for specific components
Use the --env component:KEY=VALUE
syntax to set the value for a specific component.
Components can be any of the following:
sm
dap
sequencer
- a specific pipeline name
- a specific sequencer name; for example
north
- a specific
dap
name
For example, to set an environment variable for sm
:
kxi pm deploy mypackage --env sm:myenvar=1
This applies myenvar=1
only to sm
during deployment.
Track deployments
To find the status of the running deployments, use the following command. This lists all the packages and their default values, as shown in the example below.
kxi pm list
╭────────────────────────┬─────────────────────┬─────────────────────┬───────┬────────┬───────────────────────────────────┬──────────────────────────────────────╮
│ name │ version │ deployment.status │ data │ access │ owner.name │ id │
├────────────────────────┼─────────────────────┼─────────────────────┼───────┼────────┼───────────────────────────────────┼──────────────────────────────────────┤
│ pkg-test1 │ 0.0.7 │ RUNNING │ yes │ ARWX │ service-account-test-publisher │ 253a6bc0-7672-4aa4-b3ff-655dc6826005 │
│ pkg-test-2 │ 0.0.1 │ Deployment Error │ yes │ ARWX │ user1 │ 3fb61cd9-0522-453f-8591-66a954ce07fd │
│ pkg-test-3 │ 0.0.1 │ - │ - │ ARWX │ user1 │ 3d64ad0e-de83-4db9-8956-84a6a0f11d2f │
╰────────────────────────┴─────────────────────┴─────────────────────┴───────┴────────┴───────────────────────────────────┴──────────────────────────────────────╯
Default values explained
Key | Description |
---|---|
Name | Package Name |
Version | Package Version |
Deployment Status | Indicates the overall state of the deployment |
Data | Indicates if the package has associated data on disk |
Access | The level of access the requesting user has |
Owner Name | The User who pushed the package originally |
ID | Unique ID for the package |
It is also possible to list other entities in a package, such as pipeline
, database
, view
, as well as their status. The exhaustive list can be seen below in the kxi pm list --help
output.
Usage: kxi pm list [OPTIONS] [[package|deployment|pipeline|view|database|udf]]
List objects stored on kdb+ Insights Enterprise Package Manager service.
╭─ Authentication option overrides ────────────────────────────────────────────╮
│ --hostname,--url TEXT Insights URL │
│ --realm TEXT Realm │
│ --client-id TEXT Client id │
│ --client-secret TEXT Client secret │
│ --auth-enabled/--auth-disabled Retrieve Bearer Token │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --filter -f TEXT Key-pattern pair to filter │
│ the returned packages on. │
│ Applies case-sensitive │
│ filtering using wildcard │
│ patterns. Multiple patterns │
│ ANDed together. Key names │
│ may include dot notation │
│ for nested values (e.g., │
│ owner.name=John*). │
│ --fields TEXT [default: name, package, │
│ version, function, status, │
│ data, access, owner, id, │
│ info] │
│ --output-format -o [json|table|csv|simple] Output format for the list │
│ command │
│ --server-timeout INTEGER Timeout for Insights server │
│ calls │
│ --yes,--assume-yes -y Automatic yes to prompts; │
│ assume "yes" as answer to │
│ all prompts andrun │
│ non-interactively. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯