Skip to main content
Version: latest

Install Cortex Tools

This is a guide to installing SENSA Fabric tools on Windows and Mac/Linux:

  • SENSA Fabric CLI
  • Python Libraries (optional)

Also see:

Prerequisites

The following tables detail all the supported operating systems and software needed to run every component in Cortex.

Instructions on how get started with each component can be found by clicking that corresponding component's name in the table.

For backend dependencies see Cortex-Charts Installation and Configuration page.

MacOS/Linux

Cortex ComponentRequirements
Base- macOS X Sierra or greater
Console- Minimum screen resolution 1400x900px
CLI- Node 16 is required to use the CLI
- Node package manager - NPM
- Node version manager - NVM
Admin Console- A Chromium-based web browser, latest version of Chrome recommended
Cortex Python Library- Docker v20.x (API v1.12) or greater is required for building Skills using the Python Lib

Windows

Cortex ComponentRequirements
Base- Windows 7 or Windows 10
Console- Minimum screen resolution 1400x900px
CLI- 16 is required to use the CLI
- Node package manager - NPM
- Node version manager - NVM for Windows
Admin Console- A web browser, latest version of Chrome recommended
Cortex Python Library- Docker v20.x (API v1.12) or greater is required for building Skills using the Python Lib

MacOS/Linux Installation Steps

Steps listed below are detailed in the sections that follow.

  1. Open a terminal window.
  2. Install NVM (Node Version Manager).
  3. Install NodeJS using nvm.
    1. Install the SENSA Fabric CLI.
  4. Install Docker.
  5. Install the Profiles SDK.
  6. If you, plan to use Cortex-python libraries, install Conda.

Windows Installation Steps

Steps 4-7 listed below are detailed in the sections that follow.

  1. Install PowerShell (highly recommended!)
  2. Open a PowerShell (Administrator) command window.
  3. Make sure that your ExecutionPolicy is set Unrestricted. Enter get-executionpolicy. If the ExecutionPolicy is not Unrestricted, enter Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force -Verbose.
  4. Install NVM for Windows(See section below for details)
  5. Install NodeJS using nvm.
  6. Install the SENSA Fabric CLI.
  7. Install Docker.
  8. Install the Profiles SDK.
  9. If you, plan to use Cortex-python libraries, install Conda.

Install Node prerequisite

Install NVM on Windows

When installing NVM for Windows, there are two restrictions:

  • The installation path defaults to the current user account. If a different user on the same machine tries an nvm command, the command will not execute. To solve this issue, install nvm separately on each user's account.
  • Colorization packages for PowerShell commands might add Unicode to the node version number, preventing Cortex from fetching the correct version of node. To solve this, turn off colorization (Windows Key + CTRL + C toggles the color filter on and off); then reinstall node.

To install NVM for Windows:

  1. Go to the NVM WINDOWS repo README

  2. Scroll to DOWNLOAD NOW button (Screen shot).

    NVM for Windows README

  3. Scroll past release notes to list of binaries.

  4. Click nvm.setup.exe and download.

    NVM for Windows executable

  5. Open the file and click through the installer wizard.

Install NVM on MacOS/linux

NVM is written for MacOS/Linux.

Instructions for installing NVM are found here.

You may either download and run the install script manually, or use the following cURL or Wget command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh

On Mac/ Linux and Windows PowerShell, you install node from nvm the same way.

  1. Open a new terminal or PowerShell window.

  2. Verify the nvm is installed. (see section below)

  3. Run the following command.

    nvm install <latest or version number>

    EXAMPLE

    nvm install 16.13.0
  4. To use that version of node run:

    nvm use 16.13.0
  5. Verify the node installation.

Verify nvm and npm installations

You must have nodejs installed on you system in order to install the Cortex client. Node 16.x is recommended.

Test if node is installed properly by executing the following commands, if it is NOT available, you must install it using an option described below.

node -v
npm -v

Nodejs Installation Alternatives

Install nodejs as an Administrator or Root-user

NOTE: Do NOT attempt to use odd versions of node for installing Fabric CLI. Version 16 is currently tested.

Install node on the system as Administrator or Root-user on:

  • Redhat/Centos Linux: Run sudo yum install nodejs
  • Ubuntu/Debian Linux: Run sudo apt install nodejs
  • Windows 10: Download the Node.js installer, which includes the NPM package manager. Launch it and follow the install wizard, installing in the default location.

Verify the installation on your system.

Install nodejs Locally or as a Non-root user

On MACOS/Linux

  1. Create a cortex/ install folder.
    mkdir -p cortex/
  2. Set your context to that folder.
    cd cortex/
  3. Download nodejs 16.x binaries from https://nodejs.org/en. Select the binary that is created for your operating system.
  4. In your local drive find the path to that binary (Example:download/release/lv16.x/node-<VERSION>-linux-x64.tar.gz).
    wget https://nodejs.org/dist/v16.3.1/node-v16.3.1-linux-x64.tar.gz
  5. Extract the binaries to the install folder.
    tar xfvz node-v16.3.1-linux-x64.tar.gz
  6. Add NODEJS_HOME and PATH env variables for node, append the following to your ~/.bash_profile
    echo "export NODEJS_HOME=$PWD/node-v16.3.1-linux-x64" >> ~/.bash_profile
    echo "export PATH=$PATH:$NODEJS_HOME/bin" >> ~/.bash_profile

On WINDOWS PowerShell

  1. Create a local folder
    mkdir cortex
  2. Set your context within that folder
    cd cortex
  3. Pull down your Node version binary.
    find . - node-v16.3.1-windows-x64.zip .
  4. Unzip the binary.
    compact /u "Users/Admin/Downloads/node-v16.3.1-windows-x64.zip" /i /Q
  5. Add C:\Program Files\nodejs to your PATH environment variable:
  • a. Use the global Search to find "Environment Variables".
  • b. Click "Edit system environment variables".
  • c. Click "Environment Variables" in the dialog.
  • d. In the "System Variables" box, search for Path and edit it to include C:\Program Files\nodejs. (Make sure it is separated from any other paths by ;)

You must restart any currently-opened command prompts before changes take effect.

Set node default version

If you have multiple versions of node (npm) installed, you must set a version 16.x as the default (to be used in subsequent terminal sessions) and/or set that version as the version for the active session.

NVM does not automatically configure Node to the most recent version, so it is not enough to have a required version installed.

  • Set the default Node version for subsequent terminal sessions. Exit the terminal and open a new session with the default version.
    nvm alias default node
  • Set the active Node version in your session.
    nvm use default
    Add a version number to the end of the above commands to set as specific version as default or active.

Install the CLI

The Cortex command-line interface (CLI) helps you to perform many Cortex tasks from your terminal, including:

  • Generating and deploying skills
  • Invoking agent services
  • Configuring jobs and connections
  • And many other common developer tasks
caution

Use a node version manager, like NVM, to manage your Node installation. This can help to avoid file permission issues. See the npm documentation for help.

Install the Cortex CLI with NPM. The --location=global flag tells npm to install the cortex CLI globally.

npm install --location=global cortex-cli

To install a specific version of the CLI run:

npm install <package>@<version>

EXAMPLE ENTER THE APPROPRIATE VERSION NUMBER

npm install cortex-cli@2.0.5
note

DO NOT run pip install cortex or python3 -m pip install cortex. CognitiveScale does not own the cortex package. Installing this package may interfere with the operation of the CLI and the cortex-python libraries.

Test that the CLI is installed:

cortex -v

Install Cortex CLI as a non-root user (Mac and Linux)

If you are required to install the Cortex as a non-root user on your system follow the instructions below.

  1. Create a cortex/ install folder.
    mkdir -p cortex/
    cd cortex/
  2. Install cortex-cli within your install folder.
    npm install cortex-cli
  3. Add cortex client to your PATH, append the following to your ~/.bash_profile.
    export PATH=$PATH:$PWD/node_modules/.bin
  4. Test that cortex-cli is installed and available in the $PATH.
    cortex -h

### Install Cortex CLI as a non-root user (Windows)

If you are required to install the Cortex as a non-root user on your system follow the instructions below.

  1. Create a cortex/ install folder.
    mkdir -p cortex/
    cd cortex/
  2. Install cortex-cli within your install folder.
    npm install cortex-cli
  3. Add cortex client to your PATH, append the following to your ~/.bash_profile.
    export PATH=$PATH:$PWD/node_modules/.bin
  4. Test that cortex-cli is installed and available in the $PATH.
    cortex -h

See Use the CLI to configure the CLI.

Install the Cortex Profiles SDK

Installation instructions are provided in the Profiles SDK Examples Repo.

Install Docker

To build and run models and actions, Docker 1.9 or greater must be running locally on your computer. If you have not already installed Docker 1.9, use the following installation instructions. You need to create a Docker Hub account to download Docker.

After Docker has been installed locally, use the following steps to start running Docker:

1. Go into your Applications folder and click **Docker**.
2. The Docker logo will appear in either the Mac or Windows toolbar. Click the logo and verify that Docker is running.
  • For Windows users, see Install Docker For Windows.

    After Docker has been installed locally, use the following steps to start running Docker:

    1. Search for Docker, and select Docker Desktop in the search results.
    2. The Docker menu (whale menu) displays the Docker Subscription Service Agreement window. It includes a change to the terms of use for Docker Desktop.
    3. Click the checkbox to indicate that you accept the updated terms and then click Accept to continue. Docker Desktop starts after you accept the terms.

Install cortex-python library

note

In Cortex v6.x only the base library, cortex-python, is available.

In the cortex-python GitHub repo, the setup.py file specifies that the following libraries are required:

install_requires=[
'requests>=2.12.4,<3',
'requests-toolbelt>=0.8.0',
'python-jwt>=3.3.0,<4.0',
'pyyaml>=5.3.1,<6',
'cuid>=0.3,<1',
'tenacity>=8.0,<9.0',
'dill>=0.2.8.2'
]

Install the cortex-python library using pip3:

pip3 install cortex-python

Upgrade cortex-python libraries

Upgrade the the cortex-python libraries using pip:

pip3 install -U cortex-python

Install Profiles SDK

The Profiles SDK is used to build complex schemas with a substantial amount of data.