-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add support for HF_HUB_USER_AGENT_ORIGIN to add user-agent Origin field in Hub requests. #3061
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
Conversation
…in field in Hub requests.
Dockerfile.neuron
Outdated
@@ -18,7 +18,7 @@ RUN apt-get update -y \ | |||
&& rm -rf /var/lib/apt/lists/* \ | |||
&& apt-get clean | |||
|
|||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.80.1 --profile minimal -y | |||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.84.0 --profile minimal -y |
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.
You can use rust-toolchain.toml
:
COPY rust-toolchain.toml rust-toolchain.toml
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
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.
We can also not pipe anything into sh
while we're at it, but there are unfortunately a lot of these occurrences.
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.
I'm not sure of what would be the best way to avoid the pipe. rustup-init
checks the architecture to download the right installer which we need to do. We could copy rustup-init
in the repo and add a check for rust-init
signature for each architecture but needs to be updated for each update. Do you have other ideas in mind?
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.
That's already alright to checksum the installer (although the installer of the installer should probably have the same treatment.).
There's the simple "we need deterministic builds" aspect. And then there's the "we don't want supply chain attacks" side of things. checksum goes a long way.
Ideal is a key word here.
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.
You can use
rust-toolchain.toml
:COPY rust-toolchain.toml rust-toolchain.toml RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
This command does not install any toolchain, which was precisely the whole point of the previous command. Am i missing something ?
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.
Yes but the correct toolchain (from rust-toolchain.toml
) will be installed with cargo-chef
.
At least it works here:
text-generation-inference/Dockerfile_llamacpp
Lines 38 to 41 in d8ff7f2
COPY rust-toolchain.toml rust-toolchain.toml | |
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none | |
ENV PATH="/root/.cargo/bin:$PATH" | |
RUN cargo install cargo-chef --locked |
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.
I still don't understand how it could work: the code snippet in llamacpp is different than the one you suggested above for neuron.
This one installs explicitly the 1.85.0 toolchain, instead of specifying none
, which doesn't install any toolchain.
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.
It was working, the correct toolchain was automatically installed at this step:
RUN cargo install cargo-chef --locked
But I confirm it is not the case anymore.
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.
LGTM
This pull-request breaks the neuron build: was it tested ? |
@dacorvo Yes, it builds on https://github.com/huggingface/text-generation-inference/actions/runs/13627605158/job/38160431550 |
The issue is not related to |
What does this PR do?
Adds support for HF_HUB_USER_AGENT_ORIGIN to add user-agent Origin field in Hub requests.
Useful to track collabs.