Hello Artifact Repositories team,
I’m trying to develop a Python library to be used with python-transforms outside of the platform and running into issues depending on the transforms
library.
Using conda-auth
(https://conda-incubator.github.io/conda-auth/) in --token
mode I can authenticate to the Artifact Repository underpinning a Stemma repository (https://my-stack.palantirfoundry.com/artifacts/api/repositories/ri.stemma.main.repository.{my-repository-locator}/contents/release/conda
)
I can then successfully run conda install --override-channels -c https://my-stack.palantirfoundry.com/artifacts/api/repositories/ri.stemma.main.repository.{my-repository-locator}/contents/release/conda transforms
.
Unfortunately, adding this artifacts repository to the channels
section of my ~/.condarc
results in an unexplained HTTP 401 Unauthorized from Artifacts (detailed below).
My conda_recipe/meta.yaml
looks like:
# usual `package`, `source`, `test`, and `about` sections
build:
noarch: python
script: {{ PYTHON }} -m pip install . --no-deps
requirements:
build:
- python =3.9
- setuptools
run:
- python =3.9
- transforms
extra:
channels:
- https://my-stack.palantirfoundry.com/artifacts/api/repositories/ri.stemma.main.repository.{my-repository-locator}/contents/release/conda
Running conda build conda_recipe
fails with the following error:
Multi-download failed. Reason: Transfer finalized, status: 401 [https://my-stack.palantirfoundry.com/artifacts/api/repositories/ri.stemma.main.repository.{my-repository-locator}/contents/release/conda/noarch/repodata.json] 0 bytes
According to the environment troubleshooting docs (https://www.palantir.com/docs/foundry/transforms-python/environment-troubleshooting#multi-download-failures):
This error means either that you do not have access to the artifacts channel from which packages are downloaded, or that the artifact is not available on the enrollment.
Given that conda install
succeeded and that there are no dependencies other than setuptools
and transforms
, both of which were installed as transitive dependencies of transforms
(python
is managed by conda), why is this error thrown on conda build
?
The same error comes up if I try to run conda-lock lock -f conda_recipe/meta.yaml --lockfile conda_recipe/.conda-lock.yml -p osx-arm64 -p linux-64 -p linux-aarch64
(still the case with only -p osx-arm64
or -p linux-64
instead of all three).
Other things I’ve tried:
- including
conda-forge
anddefaults
in the list of channels - replacing the Stemma repository RID with
ri.transforms.python.artifacts.repository
orri.transforms.python.artifacts.runtime
conda install --override-channels -c {artifactRepositoryURL} transforms
→conda env export > environment.yml
→conda env update -f environment.yml
; this throwsCondaAuthError Unable to find authorization token for requests with channel {artifactRepositoryURL}
- ensured that the relevant backing artifacts repositories are set on my Stemma repository (the default ones that a newly-created python transforms repository is initialized with)
Other context:
- The library does need to be developed outside of Foundry
- The library will be uploaded to an Artifacts Repository inside Foundry to be used
- Doing a similar thing with NPM packages works just fine with the Stemma repository as the only NPM registry
Summary:
- developing a Python library outside of the platform with Conda as the package manager & build system
- Using a Stemma repository as a Conda channel
conda install transforms
works;conda build
throws an unexplained HTTP 401