-
Notifications
You must be signed in to change notification settings - Fork 34
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
Issue with accessing a private JFrog registry #164
Comments
can you kindly confirm which version of oras-py are you using? btw fwiw and maybe it could help, it works for me with latest oras-py for push/pull for the public dockerhub: https://hub.docker.com/repository/docker/matteomortari/demo20241017-oraspy164 # ...
host = "registry-1.docker.io"
client = oras.client.OrasClient()
print(client.login(username=user, password=password, hostname=host))
client.push(target="registry-1.docker.io/matteomortari/demo20241017-oraspy164:latest", files=["artifact.txt"])
client.pull(target="registry-1.docker.io/matteomortari/demo20241017-oraspy164:latest", outdir="tmp") Using user and password per configured PAT which I've also tested from oras cli (go). Personally, I refrain from using programmatic login, and rely on the ~/.docker/config.json or similar auth secret from the environment. Btw, noticed the oras cli (go) does not require the Hope this helps! |
Hi @tarilabs, I am using a private registry here for dockerhub. I have tried running on the latest version (0.22.0) where I was getting the above error, updated the version value in original post. I also tried out with a lower version:
|
Also, checking the documentation: https://oras-project.github.io/oras-py/getting_started/user-guide.html where it says |
Can you provide more details about which registry is used as a "private dockerhub" so to attempt replicate the issue you are seeing? fwiw I'm also using CNCF Distribution, Zot and Quay (-lite) in another project regularly and that work for me using simply same environment auths. |
About
I think that refers to the fact that oras-py originally provided CLI bindings (ie, after pip install, you could use oras in Python as the cli client) but since they are advising to directly use Oras (go) as a cli client to avoid "duplications". I use oras-py as an SDK (ie as a Python library) in another project that way. But happy to be corrected here. |
Confirmed on this, we are using a JFrog registry for hosting artifacts.
|
ref oras-project#164 (comment) Signed-off-by: tarilabs <[email protected]>
I think you mean the refactor?
I think you mean like this: but I wish I understood better which test case to reproduce the failure :/ do you have some suggestions, please? |
I was able to get my code to work after applying the changes in the PR: #165 with the below snippet:
One question about the
For the pull and push functions in Can this be fixed? Should I open a different issue for this? |
Definitely! I would gladly review a PR to fix these. AFAIK the typing is just for checking during CI, etc., and nothing is checked or enforced when using a library. |
* core: add missing prefix property to auth backend ref #164 (comment) Signed-off-by: tarilabs <[email protected]>
raised my proposal as #166 :) hope this helps! |
@shaunak-cisco could you kindly test again with 0.2.24 ? That should solve original issue of as oras-py 0.2.24 contains both: so that we could resolve this issue accordingly? |
I am trying to run the basic pull example provided here: https://oras-project.github.io/oras-py/getting_started/user-guide.html with the python sdk. Following is the code snippet I am trying to run. The file getting pulled is already present in the repo pushed with the
oras
cli. I have tried pulling with the cli as well as a Golang SDK example which worked fine.Following is a snippet of the exception:
Looking at the above logs, the
prefix
attribute seems to get referred in/oras/auth/token.py:L117
but I could not see where it is getting set in the codebase.Any pointers on if my code may not be accurate here? cc: @vsoch
Edit: Version used:
0.2.22
The text was updated successfully, but these errors were encountered: