Open alishah730 opened 1 year ago
I’m busy this weekend but if you can get me a credential to a testing repo I can look into this for you. Generally I would suggest subclassing the provider.Registry directly and very specifically providing the layers/media types but that’s just my preference. There are examples for how to do this in the documentation.
indeed I tried with custom layer as well with the example getting same. You can create a demo Harbor account. Or I can invite to the project. Please let me know
If you invite me would I still need to make the account? :thinking:
just need to fill out this form for demo https://demo.goharbor.io/ , no email verification is required.
alishah730/Asdf@1234 please use for testing
I tried making an account, the password that I put doesn't work, and it doesn't let me reset or make another one with the same email - I don't think I can help.
i can login using the creds
client = oras.client.OrasClient(insecure=True)
logged=client.login(username="alishah730",password="Asdf@1234",hostname="demo.goharbor.io")
print(logged)
output :
{'Status': 'Login Succeeded'}
@vsoch
The upload URL returns 404, I'm not sure what to say about that.
In [13]: upload_url
Out[13]: 'http://demo.goharbor.io/v2/oras/test/blobs/uploads/'
In [14]: r.json()
Out[14]:
{'errors': [{'code': 'BLOB_UPLOAD_UNKNOWN',
'message': 'blob upload unknown to registry'}]}
Yes you told me that, I'm not sure how it helps me further debug this. I think it's strange you can't use https
In [23]: r.json()
Out[23]: {'errors': [{'code': 'FORBIDDEN', 'message': 'CSRF token invalid'}]}
If the oras cli works then why not just use it?
If you want to help, perhaps you can use the working client in some debug mode to provide the url endpoints that are hit and we can compare side by side.
Yes you told me that, I'm not sure how it helps me further debug this. I think it's strange you can't use https
In [23]: r.json() Out[23]: {'errors': [{'code': 'FORBIDDEN', 'message': 'CSRF token invalid'}]}
If the oras cli works then why not just use it?
i need to write a script to customize and push 100+ artifacts.
Yes you told me that, I'm not sure how it helps me further debug this. I think it's strange you can't use https
In [23]: r.json() Out[23]: {'errors': [{'code': 'FORBIDDEN', 'message': 'CSRF token invalid'}]}
If the oras cli works then why not just use it?
oras push demo.goharbor.io/oras/test:latest repo.txt
Uploading fe7d9872a34c repo.txt
Uploaded fe7d9872a34c repo.txt
Pushed demo.goharbor.io/oras/test:latest
Digest: sha256:a1c6906c2ba07.
```...
Do you know if harbor accepts the single put request? It could be that it does not, hence the 404 response.
Do you know if harbor accepts the single put request? It could be that it does not, hence the 404 response.
not sure, if there is any blob upload API
@alishah730 could you please try a pull?
@alishah730 I'm testing chunked upload (which is currently disabled) and it's telling me the project does not exist:
Issue retrieving session url: {'errors': [{'code': 'UNAUTHORIZED', 'message': 'project oras not found: project oras not found'}]}
Could you please make it / verity it exists? Some registries I think require the target project to exist before you can push to it.
@alishah730 I'm testing chunked upload (which is currently disabled) and it's telling me the project does not exist:
Issue retrieving session url: {'errors': [{'code': 'UNAUTHORIZED', 'message': 'project oras not found: project oras not found'}]}
Could you please make it / verity it exists? Some registries I think require the target project to exist before you can push to it.
you can use demo/Asdf@1234 , I have created oras
@alishah730 is this the same one as before? demo/Asdf@1234
is the full project name? (sorry not familiar with how Harbor is organized!)
@alishah730 please provide a name that doesn't have a @
in it - I don't think that is valid for most registries - it typically is put before a digest at the end.
@alishah730 please provide a name that doesn't have a
@
in it - I don't think that is valid for most registries - it typically is put before a digest at the end.
this is password.
user : demo password : Asdf@1234 repo : oras host : demo.goharbor.io
sample docker push
docker push demo.goharbor.io/oras/test:latest
oh gotcha I interpreted what you said wrong. I'll try that!
okay I keep getting a 404. I don't know why - maybe another one of the oras developers can help. It's usually just me on here so you might have better luck pinging the slack and pointing at this issue.
using sample code from here https://github.com/oras-project/oras-py/blob/main/examples/simple/push.py with harbor https://demo.goharbor.io/harbor/projects
getting below error
Issue retrieving session url: {'errors': [{'code': 'BLOB_UPLOAD_UNKNOWN', 'message': 'blob upload unknown to registry'}]} raise ValueError(f"Issue retrieving session url: {r.json()}")
able to push same file via oras cli
is that harbor registry is not supported by oras? any working example with harbor pushing tar file?