Skip to content
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

feat: add support for HF_HUB_USER_AGENT_ORIGIN to add user-agent Origin field in Hub requests. #3061

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Hugoch
Copy link
Member

@Hugoch Hugoch commented Feb 26, 2025

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.

@Hugoch Hugoch requested review from Narsil and mfuntowicz February 28, 2025 14:54
@Hugoch Hugoch marked this pull request as ready for review February 28, 2025 14:54
@@ -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
Copy link
Collaborator

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

Copy link
Collaborator

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.

Copy link
Member Author

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?

Narsil
Narsil previously approved these changes Feb 28, 2025
Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants