Use private pip repositories
To use private pip repository you must add customized pip.conf file pointing to your custom PyPI repository.
For example, your custom pip.conf file can look like this:
1
[global]
2
timeout = 60
3
index-url = http://pypi.python.org/simple/
Copied!
If you need to specify the certificate to use during pip install you want to specify the path to it in a pip.conf file e.g.
1
[global]
2
timeout = 60
3
index-url = http://pypi.python.org/simple/
4
cert = /model/files/cert.pem
Copied!
You can tell pip to use this pip.conffile in the install-command field inside serving.yaml:
1
kind: Model
2
name: linear_regression
3
runtime: "hydrosphere/serving-runtime-python-3.7:3.0.0"
4
install-command: "PIP_CONFIG_FILE=pip.conf pip install -r requirements.txt"
5
payload:
6
- "src/"
7
- "requirements.txt"
8
- "pip.conf" # location of your pip.conf
9
- "cert.pem" # location of your certificate. It'll be available under /model/files/cert.pem
10
- "model.h5"
11
contract:
12
name: infer
13
inputs:
14
x:
15
shape: [-1, 2]
16
type: double
17
outputs:
18
y:
19
shape: [-1]
20
type: double
Copied!
Last modified 3mo ago
Export as PDF
Copy link