Using a private package index
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.
| Variable | Purpose |
|---|---|
UV_DEFAULT_INDEX | The index that replaces PyPI. Either a URL or <name>=<url>. |
UV_INDEX | Additional 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_FILE | CA 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 formhttps://<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 onlyUV_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_orPIP_, or if an Extra Pip Requirements entry is an option such as--index-url. See Restrictingextra_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>_PASSWORDlets 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.
- Kubernetes (Helm)
- ECS (Terraform)
- ECS (CloudFormation)
- Docker
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
Store the credentials in AWS Secrets Manager, then add the variables to the
remote-ingestion-executor
module inputs. Each secret goes in both secrets (injected into the container) and task_exec_secret_arns (lets the task
execution role read it), next to the entries you already have for the access token:
module "datahub_remote_executor" {
# ... existing inputs ...
environment = [
{
name = "UV_DEFAULT_INDEX"
value = "corp=https://artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple"
},
]
secrets = [
# ... DATAHUB_GMS_TOKEN ...
{
name = "UV_INDEX_CORP_USERNAME"
valueFrom = aws_secretsmanager_secret.pypi_index_username.arn
},
{
name = "UV_INDEX_CORP_PASSWORD"
valueFrom = aws_secretsmanager_secret.pypi_index_password.arn
},
]
task_exec_secret_arns = [
# ... access token secret ...
aws_secretsmanager_secret.pypi_index_username.arn,
aws_secretsmanager_secret.pypi_index_password.arn,
]
}
The template's Environment Variables (OptionalEnvVars) and Source Secrets (OptionalSecrets) parameters split
each entry on = and ,, so a value cannot contain either character. That rules out the <name>=<url> form; use a plain
URL instead.
For an index without authentication, set the parameter:
OptionalEnvVars=UV_DEFAULT_INDEX=https://artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple
For an index with authentication, store the full URL including the credentials in AWS Secrets Manager and pass the secret instead, so that the password never appears in the stack parameters. URL-encode any special characters in the user name and password.
aws secretsmanager create-secret \
--name datahub-remote-executor-pypi-index \
--secret-string 'https://<user>:<token>@artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple'
OptionalSecrets=UV_DEFAULT_INDEX=arn:aws:secretsmanager:<region>:<account-id>:secret:datahub-remote-executor-pypi-index-AbCdEf
The template grants the task execution role read access to every secret listed in OptionalSecrets.
Add the variables to the docker run command from Deploy using Docker:
docker run -it \
--env UV_DEFAULT_INDEX="corp=https://artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple" \
--env UV_INDEX_CORP_USERNAME="<user>" \
--env UV_INDEX_CORP_PASSWORD="<token>" \
... \
<docker-image>
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:
- Kubernetes (Helm)
- ECS (Terraform)
- ECS (CloudFormation)
- Docker
image:
repository: <registry>/datahub-executor-custom
tag: <tag>
module "datahub_remote_executor" {
# ... existing inputs ...
datahub = {
# ... existing settings ...
image = "<registry>/datahub-executor-custom"
image_tag = "<tag>"
}
}
The template has a parameter for the image tag only. Change the repository in the Image property of the container
definition in your copy of the template, and set ImageTag to your tag.
Use your image as <docker-image> in the docker run command.
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
- Kubernetes (Helm)
- Docker
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
docker run -it \
--volume "$(pwd)/ca-bundle.crt:/etc/datahub/tls/ca-bundle.crt:ro" \
--env SSL_CERT_FILE=/etc/datahub/tls/ca-bundle.crt \
... \
<docker-image>
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 logs | Likely cause |
|---|---|
401 Unauthorized or a hint about missing credentials | Wrong credentials, or the <NAME> in UV_INDEX_<NAME>_USERNAME / _PASSWORD does not match the index name. |
| A certificate verification error | The index's CA is not in the bundle SSL_CERT_FILE points at. |
| A package or version is reported as not found | The index does not proxy PyPI, or blocks that package. |
The run fails before installing, naming extra_env_vars | A 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_FILE | The bundle holds only your CA. Add the public root certificates. |