elixir-nx / xla

Pre-compiled XLA extension
Apache License 2.0
83 stars 21 forks source link

Github API rate-limits cause flaky builds #43

Closed aej closed 1 year ago

aej commented 1 year ago

Hi!

I've been building and deploying exla on render.com and their IP addresses look to be heavily rate-limited by Github's API. This causes lots of failures while building the xla library into an elixir application.

To get around this I've been passing in my own HTTP auth headers to curl in a fork (see https://github.com/aej/xla/commit/5e88ca775069b24e24e3541d7b083491196e0b09).

It would be great if we could support passing in generic arguments to the two libraries used here (curl & wget). Perhaps we could support an environment variable like NETWORK_TOOL_OPTS which just then gets passed directly into the cli call.

eg:

curl -> curl --fail --silent -L #{System.get_env("NETWORK_TOOL_OPTS")} #{url} wget -> wget -q -O - #{System.get_env("NETWORK_TOOL_OPTS")} #{url}

This would mean we can support any additional arguments library users have and not only http headers.

jonatanklosko commented 1 year ago

Hey! I would do something less specific to the CLI tools. I'm thinking XLA_DOWNLOAD_HEADERS that we can translate to CLI args regardless of what we use underneath. For most practical purposes it should be fine to accept "key: value;key: value", but happy to hear better alternatives. @josevalim wdyt?

josevalim commented 1 year ago

What about XLA_DOWNLOAD_UA?

jonatanklosko commented 1 year ago

@josevalim you mean env var for a specific header? In that case we rather want auth and not user-agent, no? But it may be too limiting to support just one specific header?

josevalim commented 1 year ago

I see. So your header approaches works, :+1:.