conda_pypi_name_mapping does not honor the mirror_middleware
Checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
none
Issue description
pypi_name_mapping is download directly from github, and does not changed to a mirror url when set.
Expected behavior
pypi_name_mapping json can be downloaded from a mirror url in a corp environments.
We are about to change the whole pypi mapping implementation. This will download multiple files from a subdomain of prefix.dev.
I have little experience with corporate firewalls. To better understand hownwe should approach this I have some questions. Would an administrator want to mirror this mapping in the internal network (its just static files that are updated on a regular basis), will it be added as an exception, what is the standard procedure of making sure tools have access to required files from the web?
We are about to change the whole pypi mapping implementation. This will download multiple files from a subdomain of prefix.dev.
I have little experience with corporate firewalls. To better understand hownwe should approach this I have some questions. Would an administrator want to mirror this mapping in the internal network (its just static files that are updated on a regular basis), will it be added as an exception, what is the standard procedure of making sure tools have access to required files from the web?
@baszalmstra thanks for your reply. The corp firewalls may have different effects, some are blocking in/out network by default and ACL rules based on the user roles must be applied with expiration, and others may limit the default network bands, making the building process veeeeery slow. So for building the dev environments quickly, we always use internal mirrors for many types of repo (e.g., pipy, maven, conan, conda-forge), and also for many important static or slow changed sites, such as github release files. The gateway hosts for mirroring would setup better in/out network band and all needed ACL rules, the ops could only do these once.
@baszalmstra will this issue be resolved in the PR https://github.com/prefix-dev/pixi/pull/888 ?
hey @obust !
Yes, using conda-pypi-map you will be able to define your own location of the mapping ( that could be a local one or a remote one )
example:
conda-pypi-map = { "conda-forge" = "https://gist.githubusercontent.com/nichmor/fbd2d03d1ae4d8c950710a8918386211/raw/ffa191d09da63b599c733ec444dd47c123cb6c3d/custom_conda_forge_mapping.json", "robostack" = "robostack_mapping.json"}
also we store a simplified version here: https://github.com/prefix-dev/parselmouth/blob/main/files/mapping_as_grayskull.json so you could also point to it
let me know if it helps your usecase
it sounds like it will help indeed. thanks
Hi all,
I think I'm running into a related issue on our university's HPC system where internet access is only possible through internet proxies, which are set as environment variables (http_proxy, https_proxy and ftp_proxy) in the .bashrc. After adding the following section to my pyproject.toml:
[tool.pixi.pypi-dependencies]
my_project = { path = ".", editable = true }
I'm running into this error:
pixi run python
⠄ default:linux-64 [00:00:04] resolving conda
⠤ default:osx-64 [00:00:04] resolving conda × failed to download pypi name mapping
├─▶ Middleware error: File still doesn't exist
├─▶ File still doesn't exist
╰─▶ No such file or directory (os error 2)
Locally it works. Any suggestions?
It would be great to get this to work. As far as I know, these kind of proxies are quite common on HPC systems.
Hey @maawoo ! Thanks for reporting this!
For better diagnostic of your problem I would like to ask if internet access somehow is restricted on your HPC system? Can you access external domains, as https://conda-mapping.prefix.dev?
Also, if you add following configuration
conda-pypi-map = { "conda-forge" = "https://raw.githubusercontent.com/prefix-dev/parselmouth/main/files/mapping_as_grayskull.json" }
under [project] table in pixi.toml, it will work when running on HPC?
Hey @nichmor I've kind of got a similar issue, on a corporate firewall where trying to reach https://conda-mapping.prefix.dev will result in a DNS error - name does not resolve.
We use artifactory to mirror conda-forge and pypi.
[project]
...
channels = ["https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge"]
conda-pypi-map = { "https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge" = "local/mapping_as_grayskull.json" }
I've a similar setup for UV, pointing export UV_INDEX_URL=https://artifactory.<company>/api/pypi/pypi/simple.
Is it possible to not perform the downloading of the pypi name mapping if a conda-pypi-map is provided, and it matches the only channel provided?
Hi @nichmor,
For better diagnostic of your problem I would like to ask if internet access somehow is restricted on your HPC system? Can you access external domains, as https://conda-mapping.prefix.dev/?
As far as I understand there is no restriction as long as the proxy variables are used. Installing pixi with curl and bash in the command line is not a problem for example because curl is checking these variables automatically (see here).
Also, if you add following configuration [...] under
[project]table inpixi.toml, it will work when running on HPC?
I've tried it under [tool.pixi.project] in my pyproject.toml but that didn't work.
Hey @nichmor I've kind of got a similar issue, on a corporate firewall where trying to reach https://conda-mapping.prefix.dev will result in a DNS error - name does not resolve.
We use artifactory to mirror conda-forge and pypi.
[project] ... channels = ["https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge"] conda-pypi-map = { "https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge" = "local/mapping_as_grayskull.json" }I've a similar setup for UV, pointing
export UV_INDEX_URL=https://artifactory.<company>/api/pypi/pypi/simple.Is it possible to not perform the downloading of the pypi name mapping if a conda-pypi-map is provided, and it matches the only channel provided?
thanks for suggestion! I'm working on this in : #1300
Hi @nichmor,
For better diagnostic of your problem I would like to ask if internet access somehow is restricted on your HPC system? Can you access external domains, as https://conda-mapping.prefix.dev/?
As far as I understand there is no restriction as long as the proxy variables are used. Installing pixi with curl and bash in the command line is not a problem for example because curl is checking these variables automatically (see here).
Also, if you add following configuration [...] under
[project]table inpixi.toml, it will work when running on HPC?I've tried it under
[tool.pixi.project]in mypyproject.tomlbut that didn't work.
hey @maawoo ! could please show the list of channels that are used in your project and the custom local mapping that you provide? I think #1300 should fix your issue as we will not requests anymore our mapping if custom one is exhaustive in cover all your project channels.
Checks
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.Reproducible example
none
Issue description
pypi_name_mapping is download directly from github, and does not changed to a mirror url when set.
Expected behavior
pypi_name_mapping json can be downloaded from a mirror url in a corp environments.
hey @gzm55 ! pypi_name_mapping from our https://conda-mapping.prefix.dev and raw.githubusercontent.com/prefix-dev/parselmouth are not affected by your mirrors middleware. If you want to mirror them you can use the approach from @i-like-bikes example:
[project]
...
channels = ["https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge"]
conda-pypi-map = { "https://artifactory.<company>/artifactory/api/conda/org.anaconda.conda-forge" = "local/mapping_as_grayskull.json" }```
specifying a custom location for mapping
hey @maawoo ! could please show the list of channels that are used in your project and the custom local mapping that you provide? I think #1300 should fix your issue as we will not requests anymore our mapping if custom one is exhaustive in cover all your project channels.
Hi @nichmor,
I'm only using the conda-forge channel and not using a custom local mapping. I'll check if it works for me once #1300 is included in a regular release.