|
| 1 | +# Custom PyPI Configuration |
| 2 | + |
| 3 | +This document explains how to configure custom PyPI sources when building jetson-containers. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +To use a custom PyPI server, set these environment variables before building: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Set your custom PyPI server |
| 11 | +export LOCAL_PIP_INDEX_URL="https://your-pypi-server.com/simple" |
| 12 | +export PIP_UPLOAD_HOST="your-pypi-server.com" |
| 13 | + |
| 14 | +# Build with custom PyPI server |
| 15 | +./build.sh package-name |
| 16 | +``` |
| 17 | + |
| 18 | +## Environment Variables |
| 19 | + |
| 20 | +| Variable | Purpose | Example | |
| 21 | +|----------|---------|---------| |
| 22 | +| `LOCAL_PIP_INDEX_URL` | Primary PyPI index URL | `https://pypi.example.com/simple` | |
| 23 | +| `PIP_UPLOAD_HOST` | Hostname for SSL trust | `pypi.example.com` | |
| 24 | +| `PIP_TRUSTED_HOSTS` | Additional trusted hosts | `pypi.example.com,pypi.org` | |
| 25 | + |
| 26 | +## Common Use Cases |
| 27 | + |
| 28 | +### Corporate PyPI Mirror |
| 29 | +```bash |
| 30 | +export LOCAL_PIP_INDEX_URL="https://pypi.corporate.com/simple" |
| 31 | +export PIP_UPLOAD_HOST="pypi.corporate.com" |
| 32 | +``` |
| 33 | + |
| 34 | +### Regional Mirrors |
| 35 | +```bash |
| 36 | +# China - Tsinghua University |
| 37 | +export LOCAL_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" |
| 38 | +export PIP_UPLOAD_HOST="pypi.tuna.tsinghua.edu.cn" |
| 39 | + |
| 40 | +# China - Aliyun |
| 41 | +export LOCAL_PIP_INDEX_URL="https://mirrors.aliyun.com/pypi/simple" |
| 42 | +export PIP_UPLOAD_HOST="mirrors.aliyun.com" |
| 43 | +``` |
| 44 | + |
| 45 | +### Private Repository |
| 46 | +```bash |
| 47 | +export LOCAL_PIP_INDEX_URL="https://pypi.internal.company.com/simple" |
| 48 | +export PIP_UPLOAD_HOST="pypi.internal.company.com" |
| 49 | +export PIP_TRUSTED_HOSTS="pypi.internal.company.com" |
| 50 | +``` |
| 51 | + |
| 52 | +## How It Works |
| 53 | + |
| 54 | +By default, jetson-containers uses: |
| 55 | +- **Primary**: `https://pypi.jetson-ai-lab.io` (NVIDIA's cache) |
| 56 | +- **Fallback**: `https://pypi.org/simple` (Standard PyPI) |
| 57 | + |
| 58 | +Your custom settings override the primary cache while keeping the fallback for reliability. |
| 59 | + |
| 60 | +## Troubleshooting |
| 61 | + |
| 62 | +### SSL Certificate Issues |
| 63 | +```bash |
| 64 | +# Add to trusted hosts |
| 65 | +export PIP_TRUSTED_HOSTS="your-host.com,pypi.org" |
| 66 | +``` |
| 67 | + |
| 68 | +### Authentication Required |
| 69 | +```bash |
| 70 | +export PIP_UPLOAD_USER="your-username" |
| 71 | +export PIP_UPLOAD_PASS="your-password" |
| 72 | +``` |
| 73 | + |
| 74 | +### Verify Configuration |
| 75 | +```bash |
| 76 | +# Check what pip will use in container |
| 77 | +docker run --rm your-container pip config list |
| 78 | +``` |
| 79 | + |
| 80 | +The system automatically falls back to standard PyPI if your custom server is unavailable. |
0 commit comments