Skip to content

Conversation

@coyotte508
Copy link
Member

@coyotte508 coyotte508 commented Dec 13, 2022

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 13, 2022

The documentation is not available anymore as the PR was closed or merged.

coyotte508 and others added 2 commits December 13, 2022 17:09
Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Simon Brandeis <[email protected]>
coyotte508 and others added 2 commits December 13, 2022 17:50
Co-authored-by: Patrick von Platen <[email protected]>
Co-authored-by: Patrick von Platen <[email protected]>
Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Take my feedback with a grain of salt. My front-end / networks knowledge is quite limited and I spent 0 time on googling any of the words / definitions.

For me a full-on walk-through of:

  1. Set up a webhook
  2. An example of how this webhook is triggered

Possible with some screenshots in-between would be super useful

Copy link
Contributor

@sanchit-gandhi sanchit-gandhi left a comment

Choose a reason for hiding this comment

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

Also not sure if I fall under your target audience! But if I do, I'd reiterate what Patrick has suggested and try and make the doc a bit more 'interactive' (either more examples or a full walkthrough)

The examples you've listed for Repo, Discussion and Comment are useful - they were the bits that were most clear for me. Until that point, it's a bit abstract and harder to understand from an ML practitioner point of view.

Co-authored-by: Julien Chaumond <[email protected]>
@Narsil
Copy link

Narsil commented Dec 14, 2022

Overall I think it's a good document (and agree with all the comments still open).

What I think could take this the extra mile would be to do a tutorial of a full fledge hook. Like let's say I need to update my API when the model is modified ?

@coyotte508
Copy link
Member Author

Overall I think it's a good document (and agree with all the comments still open).

What I think could take this the extra mile would be to do a tutorial of a full fledge hook. Like let's say I need to update my API when the model is modified ?

And the hook could be hosted on a space!

I have something similar planned but it's not ML related (deploying a website on code changes), I think something ML-related would be better.

@julien-c
Copy link
Member

my thinking is that we can first do a "private beta" shipping of this (maybe using a hardcoded org like spaces-explorers when Spaces were in private beta) and get some team members or external fellows to experiment with this, and contribute some guides. WDYT?

@coyotte508
Copy link
Member Author

my thinking is that we can first do a "private beta" shipping of this (maybe using a hardcoded org like spaces-explorers when Spaces were in private beta) and get some team members or external fellows to experiment with this, and contribute some guides. WDYT?

not PRO users? x)

@coyotte508
Copy link
Member Author

Thank you @patrickvonplaten @xianbaoqian @sanchit-gandhi for your suggestions!

I rewrote the docs taking into account your comments and adding a few screenshots, it's previewable at https://moon-ci-docs.huggingface.co/docs/hub/pr_554/en/webhooks.

I also added a full payload as an example, and changed event and domain to event.action and event.scope. The scope is now a single string, eg repo.config (instead of ["repo", "config"])

Copy link
Contributor

@philschmid philschmid left a comment

Choose a reason for hiding this comment

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

Looks amazing. 😍 This will allow us to build many cool features next year and examples for real MLOps automation.

Two question from my side are:

  1. Will the API be public to create webhooks? and will it then be integrated into huggingface_hub?
  2. Is there a way to identify the webhook request to a hub user programmatically?, e.g. whoisthis?secret=SECRET. => returns the userId
    -> This would allow us to add a "route" to the endpoints (UI), /webhooks to automatically rollout deployments.

@coyotte508
Copy link
Member Author

coyotte508 commented Dec 16, 2022

  1. Will the API be public to create webhooks? and will it then be integrated into huggingface_hub?

Haha cc @Wauplin

See comment on original PR: https://github.com/huggingface/moon-landing/pull/4477#discussion_r1048361481

Opened an issue: https://github.com/huggingface/moon-landing/issues/4888. It'll be easy to make it public once it's live.

  1. Is there a way to identify the webhook request to a hub user programmatically?, e.g. whoisthis?secret=SECRET. => returns the userId
    -> This would allow us to add a "route" to the endpoints (UI), /webhooks to automatically rollout deployments.

We can add whoisthis?webhookId=XXX, since webhook.id will be passed in the payload.

Also created https://github.com/huggingface/moon-landing/issues/4889

@Wauplin
Copy link
Contributor

Wauplin commented Dec 16, 2022

Will the API be public to create webhooks? and will it then be integrated into huggingface_hub?

Thanks for the ping. Actually yes it could be but not the priority for now.

@coyotte508 coyotte508 marked this pull request as ready for review December 16, 2022 09:08
Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

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

Nice!


`event.scope` can take one of the following values:

- `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if a better format for this would be a table with three columns: event.scope value, description, associated actions


## Rate limiting

Each webhook is limited to 1,000 triggers per 24 hours. You can check the daily triggers for your webhook in your webhook settings, in the "Activity" tab.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a link here for the activity tab

Copy link
Member Author

Choose a reason for hiding this comment

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

not possible - the activity tab is hf.co/settings/webhooks/xxxx/activity , it depends on the individual webhook's id

coyotte508 and others added 3 commits December 19, 2022 11:58
Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Omar Sanseviero <[email protected]>
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

BTW did you see there's an existing api-webhook page

https://huggingface.co/docs/hub/api-webhook

Might make sense to redirect that old one to the new one

Slightly more concerning, that no-one ever contacted us to get access to the webhook hahaha 😹

Copy link
Contributor

@gary149 gary149 left a comment

Choose a reason for hiding this comment

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

Made a batch of copywriting suggestions.

Copy link
Contributor

@SBrandeis SBrandeis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@coyotte508 coyotte508 merged commit 82f0d1e into main Jan 11, 2023
@coyotte508 coyotte508 deleted the webhooks branch January 11, 2023 10:18
@julien-c
Copy link
Member

please review also the related #627

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.