Context: TruEra Model Execution Environments
Executing Python models in TruEra infrastructure requires (1) the creation of a virtual environment (via conda), and (2) populating that virtual environment with your model's dependencies.
These dependencies are then used execute the model on the configured data, generating predictions and feature influences that underpin many of TruEra Diagnostics' analytics.
Default PyPi and Conda repositories
To satisfy your model's dependencies, The TruEra service that executes your model reaches out to public-facing pip & conda repos on the internet:
Pip: https://pypi.python.org/simple
Conda: https://repo.anaconda.com/pkgs
If you cannot successfully ping these URLs from the host that is running your deployment of TruEra, you may need to modify the default pip & conda configuration files on the host.
These modifications can include the use of proxy servers, internal channels (mirrors) of these repositories, and/or additional security configurations related to SSL communication.
Configuring custom PyPi or Conda Repo
By default TruEra ships with pip.conf
and .condarc
files pointing to the default public repositories. In many enterprise installations, access to public repositories is blocked. In these cases, we can configure the python model runner to use local (on-premise / within the same virtual network) conda and pip repositories.
Required Information: pip & conda
- A private pip server index URL, which is used to locate the index for the pip packages.
- Privately hosted conda channel URLs.
Particular deployments might need reconfiguring other configurations as well. So we allow users to update the whole pip.conf
and .condarc
based on their requirements.
Pip & Conda reference documentation
Pip.conf
For more details on pip.conf
please follow:
Configuration - pip documentation v21.2.4
.Condarc
For more details on .condarc
please follow:
Using the .condarc conda configuration file - conda 4.10.3.post40+c1579681 documentation
With these two pieces of information, we can update the pip.conf
and .condarc
in the deployment to point to the correct (and accessible) repositories.
Configuring in Singlebox Mode
The updated/environment-specific pip.conf
and .condarc
should be copied to the config.override
directory of the installation.
Configuring in Kubernetes
pip.conf
and .condarc
are configured via K8s configmap model-runner-python-configmap.yaml
. When using helm
, .Values.modelrunner.python.config.pipConf
and .Values.modelrunner.python.config.condarc
are used as the configuration files verbatim.
Additional Configuration Examples: SSL & proxy use
SSL issues while fetching packages?
Mitigation:
For pip.conf
configure the trusted-host
appropriately, example:
[install]
trusted-host =
pypi.org
pypi.python.org
files.pythonhosted.org
For .condarc
configure ssl_verify: false
.
Configuring proxy to contact to internet
For pip.conf
[global]
proxy = <http://user>:password@proxy_name:port
For .condarc
proxy_servers:
http: <http://user:pass@corp.com:8080>
https: <https://user:pass@corp.com:8080>
Comments
0 comments
Please sign in to leave a comment.