-
Notifications
You must be signed in to change notification settings - Fork 808
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
Add PyPI cache to test runs #5726
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
061e822
to
d33e0b1
Compare
@@ -166,6 +180,7 @@ jobs: | |||
|
|||
- name: "Cargo test" | |||
run: | | |||
export UV_INDEX_URL="http://localhost:80/simple" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export UV_INDEX_URL="http://localhost:80/simple" | |
export UV_INDEX_URL="http://localhost/simple" |
Shouldn't be a need to specify the port in this case
Can I help here? |
Feel free yeah. Though I'm not sure how we'll handle the test changes. |
I presume using |
I was thinking of just filtering pypi/localhost url to [PYPI_SERVER].
It works for me locally |
I don't think that'll be sufficient, but it may be worth a try. I run into SSL errors when using |
Before putting a lot of effort into snapshot correctness, you should probably see if this actually helps performance on the tests that do pass. |
What do you think? |
I was hoping for much more than that, though it's still nice. I wonder where we're spending all of our time in that case? |
The git dependencies seem to be the slowest to me, which could be cached too but that'd require some changes in the nginx server. |
Curious, was this after the requests got cached in nginx? (all nginx hits) |
Might be better to use an actual http proxy (e.g. squid) if we want to leverage |
Yes tried it a few times.
Local caching didn't help too much here.
|
FWIW I tried to setup squid today and it's non-trivial because you still need to have it support SSL, which requires a self-signed cert etc. Annoyingly the image at |
And for posterity, I tried using Caddy and Nginx but both are not really designed for caching a forward proxy. |
Agreed, SSL support is still non-trivial in this situation for transparent proxy cases. We'd need an action that generates a set of certs for you and make them trusted in every job. |
I used this one-liner for a self-signed cert
|
Makes sense, I use mkcert these days which makes a Root CA for you as well and helps make specific certs for specific hosts (including client certs). This then allows you do transparent proxying with SSL interception as needed. At least locally it's great, CI maybe not. |
@@ -166,6 +180,7 @@ jobs: | |||
|
|||
- name: "Cargo test" | |||
run: | | |||
export UV_INDEX_URL="http://localhost:80/simple" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export UV_INDEX_URL="http://localhost:80/simple" | |
export UV_INDEX_URL="http://127.0.0.1:80/simple" |
https://www.youtube.com/watch?v=98SYTvNw1kw
and with @samypr100 suggestion
export UV_INDEX_URL="http://localhost:80/simple" | |
export UV_INDEX_URL="http://127.0.0.1/simple" |
@@ -144,6 +144,14 @@ jobs: | |||
if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | |||
runs-on: | |||
labels: "ubuntu-latest-large" | |||
services: | |||
pypyi-cache: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pypyi-cache: | |
pypi-cache: |
Probably a typo?
Is disabling ssl verification an option? |
Does that switch to using HTTP instead of HTTPS? I sort of don't think so, it just ignores bad certificates. |
I primarily focus on the git dependencies. Here are a couple of options I've been exploring lately:
This way, we don't need to make any further changes, and requests from
Note: I haven't yet tested options 2 and 3 with authentication-related scenarios. More research is needed. |
This continues to look quite challenging, though I think it would be very valuable I don't think there's a clear path forward for this pull request. |
Part of #5713