-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set up pulp-python sync from JFrog local pypi repository #669
Comments
I moved the issue to the pulp_python repository since the issue is with this plugin. I would try to remove the It is still possible we might not fully support authenticated syncs, atleast through normal use of the remote's |
Unfortunately, I did try removing |
If you want to directly set the url on the remote without validation you can do it through the shell. On the pulp instance run py_remote = Remote.objects.get(name="your_python_remote_name")
py_remote.url = "https://<username>:<password>@<host>/artifactory/pypi/pypi-local/"
py_remote.save() This should bypass the validation done through the API. |
Is
|
It might not be. Instead use its suggestion |
Setting the credentials in the URL seems to have worked, so we're not getting the unauthenticated user business anymore.
The 404 appears to be related to both |
Both |
Do you know if |
It should follow redirects, and same with |
I looked through the worker logs and it looks like Pulp finds the package list (there are in fact 26 packages to sync) but hits .netrc errors when trying to pull them:
|
Those Can you check the output of the sync task? The logs say it completed, so it should give info on how many packages it synced. If the number of synced packages is zero then can you try to curl |
@grzleadams Did you ever get the sync to work? |
No, we were in a bit of a time crunch so I just downloaded all the files and added them to Pulp manually. |
I see. Well when you have time, I am willing to continue helping out to resolve this issue, else we can close it if no longer needed. |
I came across this and have discovered that it appears Artifactory does not have the I have attempted many permutations of URLs and the only one that appears to work is |
Good find @treydock. @grzleadams Looks like we found the cause of the problem, they haven't implemented the JSON api. Some options you could try:
We can probably support syncing from repositories that don't support the JSON apis, but there would be some limitations like only immediate syncing would be available and some of the advanced metadata filters might not work. If this is something you want we can change this to a feature request. |
We actually moved off JFrog, so I don't feel strongly either way. I don't know how many people are trying to sync Artifactory to Pulp... my guess is not many. |
For now we're going to sync directly from pypi.org and then at some point move to having teams package Python dependencies as RPMs using something like pyp2rpm, similar to what Foreman does to package Pulp. We likely won't be putting a lot of effort into using Pulp for Python packages due to sync issues that I think are just limitations of PyPi API and what bandersnatch has to do to perform a full sync of PyPi.org. Even with the broken Artifactory API the PyPi sync took 8 hours and that prevents new publications while the sync is running. Our use case is a little unique in that we will be frequently creating publications and distributions to create numerous and frequent "snapshots" of all repositories that can be accessed in parallel to other "snapshots". This means we had to switch to include lists for PyPi remotes in Pulp so that the sync is a much smaller number of API calls to the upstream PyPi API. One issue we ran into using include list with the Python plugin for Pulp is bandersnatch doesn't resolve dependencies so I had to come up with a script to use johnnydep to work out dependencies for a list of Python packages and populate the correct include list. In our unique use case this would mean a team wishing to install a new Python package would first have to inform Pulp of this new package need and also run the script to pull out the dependency list to fully populate the includes list. |
Yes, I don't recommend trying to sync all of PyPI using Pulp. There are just too many packages and due to limitations of Pulp's current architecture you would need an insanely powerful machine for the database to handle the sync. The frequent snapshots sounds like a pretty normal usecase for Pulp, but I guess the syncs were taking too long to meet the frequent requirement? As for dependency solving for syncs, I had a PR opened to add this feature (#626), but I never finished it because Python dependencies are hard to solve and I wasn't confident in my solution. The big issue is that the metadata is not set up for easy dependency solving, so the best you can do is try to cast as wide a net as possible for potential dependencies, but even with that strategy some might still slip through the crack. |
Version
Deployed via Operator:
Describe the bug
I set up a Pulp python remote pointing at a local JFrog pypi repository (
"url": "https://<redacted>/artifactory/api/pypi/pypi-local/simple"
), providing valid credentials in the process (withusername
andpassword
), and linked it with a Pulp python repository and distribution. However, it appears that the credentials are not being passed during the requests when syncing, or the URL is being malformed, or something. From JFrog logs (note thenon_authenticated_user
and401
):For what it's worth, that URL also looks strange... I would expect
.../simple/<redacted>/json
, not.../simple/pypi/<redacted>/json
. It's worth noting that Artifactory requires the username/password to be included in the URL but Pulp prevents that:To Reproduce
Steps to reproduce the behavior:
Expected behavior
The sync should happen successfully.
Additional context
N/A
The text was updated successfully, but these errors were encountered: