huggingface支持 #5

Closed
xy3xy3 wants to merge 0 commits from main into main
xy3xy3 commented 2025-02-07 23:29:20 +08:00 (Migrated from github.com)

Summary by CodeRabbit

  • New Features
    • Introduced a new endpoint for routing traffic to the dedicated Hugging Face service.
    • Launched a new Hugging Face registry service with enhanced configuration, including optimized storage management, deletion capabilities, and automated maintenance routines for upload purging.
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new endpoint for routing traffic to the dedicated Hugging Face service. - Launched a new Hugging Face registry service with enhanced configuration, including optimized storage management, deletion capabilities, and automated maintenance routines for upload purging. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2025-02-07 23:29:29 +08:00 (Migrated from github.com)

Walkthrough

The pull request introduces a new reverse proxy endpoint for the domain huggingface.{$DOMAIN} in the Caddyfile, ensuring that incoming requests are forwarded to a service at huggingface:5000. In addition, a new service named “huggingface” is added to docker-compose.yml, configured to always restart and mount its specific configuration file. A new configuration file is provided for the Hugging Face registry that outlines storage, deletion, maintenance, HTTP listening, and proxy settings.

Changes

Files Change Summary
Caddyfile Added a new reverse proxy configuration block for "huggingface.{$DOMAIN}" directing all requests to the backend service at huggingface:5000.
docker-compose.yml, huggingface/config.yml Introduced a new service "huggingface" in docker-compose with settings (image, container name, restart, volume mount) and provided a dedicated configuration file with registry settings.

Sequence Diagram(s)

sequenceDiagram
    participant User as Client
    participant Caddy as Reverse Proxy
    participant HF as Huggingface Service

    User->>Caddy: Request to huggingface.{$DOMAIN}
    Caddy->>HF: Proxy request to huggingface:5000
    HF-->>Caddy: Service Response
    Caddy-->>User: Return Response
  • sky22333/hub-proxy#4: The issue requests support for Hugging Face. This PR adds reverse proxy routing and a Docker service with registry configuration to address that request.

Poem

I'm a rabbit hopping through the code,
With new proxy trails where once was road.
The Huggingface service now takes flight,
Docker dreams shining in digital light.
🐰 Cheers to these changes, oh what a sight!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough The pull request introduces a new reverse proxy endpoint for the domain huggingface.{$DOMAIN} in the Caddyfile, ensuring that incoming requests are forwarded to a service at huggingface:5000. In addition, a new service named “huggingface” is added to docker-compose.yml, configured to always restart and mount its specific configuration file. A new configuration file is provided for the Hugging Face registry that outlines storage, deletion, maintenance, HTTP listening, and proxy settings. ## Changes | Files | Change Summary | |------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Caddyfile | Added a new reverse proxy configuration block for "huggingface.{$DOMAIN}" directing all requests to the backend service at huggingface:5000. | | docker-compose.yml, huggingface/config.yml | Introduced a new service "huggingface" in docker-compose with settings (image, container name, restart, volume mount) and provided a dedicated configuration file with registry settings. | ## Sequence Diagram(s) ```mermaid sequenceDiagram participant User as Client participant Caddy as Reverse Proxy participant HF as Huggingface Service User->>Caddy: Request to huggingface.{$DOMAIN} Caddy->>HF: Proxy request to huggingface:5000 HF-->>Caddy: Service Response Caddy-->>User: Return Response ``` ## Possibly related issues - sky22333/hub-proxy#4: The issue requests support for Hugging Face. This PR adds reverse proxy routing and a Docker service with registry configuration to address that request. ## Poem > I'm a rabbit hopping through the code, > With new proxy trails where once was road. > The Huggingface service now takes flight, > Docker dreams shining in digital light. > 🐰 Cheers to these changes, oh what a sight! <!-- walkthrough_end --> <!-- internal state start --> <!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS6xsRIvAxEAZmgYlA9KaBAYwMA5bMwClFwArAYAqojBkAAesgDMcfFG+sbgUGT0+M44BMRkyjT0TKzsXLz8wqLiUjLyTEpUqupaOqkmUHCoqJi5hKTkVEUKpRick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jxFns4MdDAsq0HbfETdjbdhQGLbgUt5bK3QmrbWzIjagA= --> <!-- internal state end --> <!-- tips_start --> --- <details> <summary>🪧 Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>, please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR. ([Beta](https://docs.coderabbit.ai/early-access#beta)) - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> <!-- tips_end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-02-07 23:31:27 +08:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

🧹 Nitpick comments (2)
huggingface/config.yml (1)

16-16: Add newline at end of file.

Add a newline character at the end of the file to comply with YAML standards.

 proxy:
   remoteurl: https://huggingface.co
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

docker-compose.yml (1)

59-59: Add newline at end of file.

Add a newline character at the end of the file to comply with YAML standards.

       - "./huggingface/config.yml:/etc/docker/registry/config.yml"
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 59-59: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa2b15a3e and 00bc44f054.

📒 Files selected for processing (3)
  • Caddyfile (1 hunks)
  • docker-compose.yml (1 hunks)
  • huggingface/config.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
docker-compose.yml

[error] 59-59: no new line character at the end of file

(new-line-at-end-of-file)

huggingface/config.yml

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (4)
Caddyfile (1)

25-27: LGTM!

The new reverse proxy configuration for huggingface.{$DOMAIN} follows the established pattern and correctly maps to the huggingface service.

huggingface/config.yml (2)

1-12: LGTM! Storage and maintenance configuration looks good.

The configuration follows best practices:

  • Filesystem storage with dedicated root directory
  • Deletion enabled for cleanup
  • Reasonable maintenance settings (72h age, 1m interval)

13-16: LGTM! HTTP and proxy settings are properly configured.

  • HTTP listening address matches the reverse proxy configuration
  • Remote URL correctly points to huggingface.co
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

docker-compose.yml (1)

54-59: LGTM! Service configuration is consistent with other registry services.

The huggingface service follows the established pattern:

  • Uses the same registry image version (2.8.3)
  • Consistent naming and restart policy
  • Proper volume mount for config.yml
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 59-59: no new line character at the end of file

(new-line-at-end-of-file)

**Actionable comments posted: 0** <details> <summary>🧹 Nitpick comments (2)</summary><blockquote> <details> <summary>huggingface/config.yml (1)</summary><blockquote> `16-16`: **Add newline at end of file.** Add a newline character at the end of the file to comply with YAML standards. ```diff proxy: remoteurl: https://huggingface.co + ``` <details> <summary>🧰 Tools</summary> <details> <summary>🪛 YAMLlint (1.35.1)</summary> [error] 16-16: no new line character at the end of file (new-line-at-end-of-file) </details> </details> </blockquote></details> <details> <summary>docker-compose.yml (1)</summary><blockquote> `59-59`: **Add newline at end of file.** Add a newline character at the end of the file to comply with YAML standards. ```diff - "./huggingface/config.yml:/etc/docker/registry/config.yml" + ``` <details> <summary>🧰 Tools</summary> <details> <summary>🪛 YAMLlint (1.35.1)</summary> [error] 59-59: no new line character at the end of file (new-line-at-end-of-file) </details> </details> </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 1aa2b15a3e79b667dab2dcc0e2173577199edb29 and 00bc44f05423766dc9126cd5385e331f9c2d432d. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `Caddyfile` (1 hunks) * `docker-compose.yml` (1 hunks) * `huggingface/config.yml` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 YAMLlint (1.35.1)</summary> <details> <summary>docker-compose.yml</summary> [error] 59-59: no new line character at the end of file (new-line-at-end-of-file) </details> <details> <summary>huggingface/config.yml</summary> [error] 16-16: no new line character at the end of file (new-line-at-end-of-file) </details> </details> </details> <details> <summary>🔇 Additional comments (4)</summary><blockquote> <details> <summary>Caddyfile (1)</summary> `25-27`: **LGTM!** The new reverse proxy configuration for huggingface.{$DOMAIN} follows the established pattern and correctly maps to the huggingface service. </details> <details> <summary>huggingface/config.yml (2)</summary> `1-12`: **LGTM! Storage and maintenance configuration looks good.** The configuration follows best practices: - Filesystem storage with dedicated root directory - Deletion enabled for cleanup - Reasonable maintenance settings (72h age, 1m interval) --- `13-16`: **LGTM! HTTP and proxy settings are properly configured.** - HTTP listening address matches the reverse proxy configuration - Remote URL correctly points to huggingface.co <details> <summary>🧰 Tools</summary> <details> <summary>🪛 YAMLlint (1.35.1)</summary> [error] 16-16: no new line character at the end of file (new-line-at-end-of-file) </details> </details> </details> <details> <summary>docker-compose.yml (1)</summary> `54-59`: **LGTM! Service configuration is consistent with other registry services.** The huggingface service follows the established pattern: - Uses the same registry image version (2.8.3) - Consistent naming and restart policy - Proper volume mount for config.yml <details> <summary>🧰 Tools</summary> <details> <summary>🪛 YAMLlint (1.35.1)</summary> [error] 59-59: no new line character at the end of file (new-line-at-end-of-file) </details> </details> </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->

Pull request closed

Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/hubproxy#5