dependencies.sh 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. If initialization time is a concern, see Docker images for how to build and use custom Docker images.
Here is an example dependencies.sh, which installs the tree utility:
apt-getupdate&&apt-getinstall-ytree
The tree utility can now be called inside your predictor.py:
Cortex allows you to specify a path for this script other than dependencies.sh. This can be useful when deploying different versions of the same API (e.g. CPU vs GPU dependencies). The path should be a relative path with respect to the API configuration file, and is specified via predictor.dependencies.shell.