System packages

Cortex looks for a file named in the top level Cortex project directory (i.e. the directory which contains cortex.yaml). For example:

├── cortex.yaml
├── ...
└── is executed with bash shell during the initialization of each replica (before installing Python packages in requirements.txt or conda-packages.txt). Typical use cases include installing required system packages to be used in your Predictor, building Python packages from source, etc.

Here is an example, which installs the tree utility:

apt-get update && apt-get install -y tree

The tree utility can now be called inside your

import subprocess
class PythonPredictor:
def __init__(self, config):["tree"])