Skip to main content

Using a private package index

Feature Availability
DataHub Core (OSS)
DataHub Cloud

By default a Remote Executor builds a Python virtual environment for each ingestion source at run time and installs acryl-datahub, the connector's dependencies and any Extra Pip Requirements into it with uv, from the public PyPI. This page shows how to send those installs to an internal mirror instead (Artifactory, Nexus, DevPI and similar), including credentials and a private certificate authority.

Runs that use a bundled connector install nothing at run time and need no package index. To use a private index while building a bundled image, see Bundling Additional Connectors.

Settings​

All of these are environment variables on the executor container.

VariablePurpose
UV_DEFAULT_INDEXThe index that replaces PyPI. Either a URL or <name>=<url>.
UV_INDEXAdditional indexes, searched before the default one. Space-separated list of URLs or <name>=<url> entries.
UV_INDEX_<NAME>_USERNAME
UV_INDEX_<NAME>_PASSWORD
Credentials for the index called <name>. <NAME> is the index name in upper case, with every character other than a letter or digit replaced by _.
SSL_CERT_FILECA bundle uv uses to verify the index's TLS certificate. Needed only when the index is signed by a private CA. See Private certificate authority.

The older names UV_INDEX_URL and UV_EXTRA_INDEX_URL are still accepted.

Things to know before you start:

  • The index must serve everything a run installs: acryl-datahub, all of its dependencies, and whatever your sources list under Extra Pip Requirements. In Artifactory this is typically a virtual repository that includes a remote repository proxying PyPI; its URL has the form https://<host>/artifactory/api/pypi/<repository>/simple.
  • Prefer one index over several. The executor image sets UV_INDEX_STRATEGY=unsafe-best-match, so when more than one index is configured uv takes the best matching version of a package from any of them. Combine your internal packages and the PyPI proxy in a single virtual repository and set only UV_DEFAULT_INDEX.
  • These settings cannot come from an ingestion source. A run fails if the source's extra environment variables contain a name starting with UV_ or PIP_, or if an Extra Pip Requirements entry is an option such as --index-url. See Restricting extra_pip_requirements.
  • Keep credentials out of the URL where your deployment tool allows it. A named index with UV_INDEX_<NAME>_USERNAME / UV_INDEX_<NAME>_PASSWORD lets the password come from a secret store while the URL stays in plain configuration.

Configure the index​

The examples use an index named corp at https://artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple. For an index that needs no authentication, leave out the credentials.

Create a Secret holding the credentials:

kubectl create secret generic pypi-index-credentials \
--from-literal=username=<user> \
--from-literal=password=<token>

Add the variables to the values.yaml of the datahub-executor-worker chart, then run helm upgrade:

extraEnvs:
- name: UV_DEFAULT_INDEX
value: "corp=https://artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple"
- name: UV_INDEX_CORP_USERNAME
valueFrom:
secretKeyRef:
name: pypi-index-credentials
key: username
- name: UV_INDEX_CORP_PASSWORD
valueFrom:
secretKeyRef:
name: pypi-index-credentials
key: password

Private certificate authority​

uv verifies the index's TLS certificate against the CA bundle named by SSL_CERT_FILE. The executor image sets it to the operating system bundle, /etc/ssl/certs/ca-certificates.crt, together with REQUESTS_CA_BUNDLE and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH, which the Python HTTP and gRPC clients read. An index whose certificate is issued by your organization's own CA fails verification until that CA is in the bundle.

SSL_CERT_FILE replaces the default bundle, it does not add to it, and ingestion runs read the same variable. The file you point it at must therefore hold the public root certificates as well as your own CA. Otherwise connections to DataHub Cloud and to your data sources start failing.

There are two ways to add your CA.

Add the CA to the image​

This works on every platform and is the only option on ECS, where a task cannot mount a file from configuration. Build an image on top of the executor image that adds your CA to the operating system bundle. All three variables above already point at that bundle, so no environment variable changes.

FROM <registry>/datahub-executor:<tag>

USER root
COPY corp-root-ca.crt /usr/local/share/ca-certificates/corp-root-ca.crt
RUN update-ca-certificates
USER datahub

Push the image to your registry and deploy it:

image:
repository: <registry>/datahub-executor-custom
tag: <tag>

Mount a CA bundle​

On Kubernetes and Docker you can leave the image unchanged and mount a bundle instead. Build the bundle from the image's own bundle plus your CA:

docker run --rm --entrypoint cat <docker-image> /etc/ssl/certs/ca-certificates.crt > ca-bundle.crt
cat corp-root-ca.crt >> ca-bundle.crt
kubectl create configmap datahub-executor-ca-bundle --from-file=ca-bundle.crt
extraVolumes:
- name: ca-bundle
configMap:
name: datahub-executor-ca-bundle
extraVolumeMounts:
- name: ca-bundle
mountPath: /etc/datahub/tls
readOnly: true
extraEnvs:
- name: SSL_CERT_FILE
value: /etc/datahub/tls/ca-bundle.crt

SSL_CERT_FILE is enough for package installs. If your data sources or other internal endpoints are signed by the same CA, set REQUESTS_CA_BUNDLE and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH to the same file.

Troubleshooting​

Run an ingestion source that is not bundled in the image and open the run's logs. The lines starting with Installing datahub: show the install commands, and uv's output below them names the index it contacted.

Symptom in the run logsLikely cause
401 Unauthorized or a hint about missing credentialsWrong credentials, or the <NAME> in UV_INDEX_<NAME>_USERNAME / _PASSWORD does not match the index name.
A certificate verification errorThe index's CA is not in the bundle SSL_CERT_FILE points at.
A package or version is reported as not foundThe index does not proxy PyPI, or blocks that package.
The run fails before installing, naming extra_env_varsA UV_ or PIP_ variable is set on the ingestion source. Move it to the executor's environment.
Connections to DataHub Cloud fail after setting SSL_CERT_FILEThe bundle holds only your CA. Add the public root certificates.