Comments (4)
Yep, you're absolutely right!
So, production setting to proxy for https://galaxy.ansible.com is to use --api-version v3
.
AND
Don't forget to clear response cache at client side, e.g.:
$ ansible-galaxy collection install --server http://galaxy.local --clear-response-cache cisco.nxos
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading http://galaxy.local/download/cisco-nxos-5.2.1.tar.gz?galactory_upstream_url=https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/cisco-nxos-5.2.1.tar.gz to /Users/m.shonichev/.ansible/tmp/ansible-local-70469xx4sc8et/tmptjzewn3r/cisco-nxos-5.2.1-4crdg6b1
Installing 'cisco.nxos:5.2.1' to '/Users/m.shonichev/.ansible/collections/ansible_collections/cisco/nxos'
cisco.nxos:5.2.1 was installed successfully
I see you don't plan to automatically forward v2
request for v3
upstream for now, so this issue can be closed.
Thank you so much for your support!
from galactory.
Hi @mshonichev , welcome! Thanks for the including so much info in this report, that's very helpful.
This line is especially interesting:
Tue, Oct 10 2023 5:52:46 pm INFO:galactory:Rewriting 'http://galaxy.local/api/v2/collections/cisco/nxos/' to 'https://galaxy.ansible.com/api/v2/collections/cisco/nxos/'
It means that the request from the ansible-galaxy
client came in as v2
.
Typically that means that the client detected no v3
from the server. The only reason that should have been the case is that galactory was not serving it.
If you hit http://galaxy.local/api/
what do you see?
Also, because you're using the INFO
log level, the output from when galactory first starts should show which Galaxy API versions it's initializing.
Finally, it might be helpful to add -vvvv
to the ansible-galaxy
run.
I have one theory so far: ansible-galaxy
caches upstream API responses, so perhaps it's using a cached v2 response? Try adding --no-cache
to the galaxy call as well.
from galactory.
Glad to hear that worked!
Indeed I don't plan to explicitly support v2 <-> v3
proxying; if it comes it would be as a side effect of re-doing how proxying is done using an actual client that's aware of both versions, but I doubt it will be any time soon.
Thanks very much for your interest in the software, I'd love to hear more about how you're using it and what your experience has been.
from galactory.
So, production setting to proxy for https://galaxy.ansible.com is to use
--api-version v3
.
One other thing to clarify (for anyone reading) is that you don't have to use --api-version v3
unless you want to never serve v2
. By default it will serve both (but proxying would not work cross-versions).
In this case clearing the cache (or using --no-cache
) is what would have fixed the issue.
from galactory.
Related Issues (20)
- internals: "fast detection" for collection iteration doesn't work for non-stable versions
- Direct collection URL (`href` field) is wrong
- Collection publishing doesn't work if the tarball is not base64 encoded
- Consider converting codebase to async
- Implement collection deletion
- Single-source the version
- 500 error on any collection that doesn't exist locally
- Forcing page counts onto upstream URLs broke v2 proxying partially
- The arm64 container build doesn't run the container
- "When specifying '_scheme', '_external' must be True." HOT 9
- Galaxy v2 - upstream response href fields are not rewritten
- Some errors in requests are not retried
- Allow for skipping logging of requests that meet some criteria
- theforeman.foreman collection could not be installed when using Galactory as a proxy. HOT 2
- docs: Example config for Artifactory generic remote repository?
- Add open telemetry
- Remove deprecated key/auth options
- Look at using flask-caching
- Support pagination
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from galactory.