Skip to content

📝 Document webhooks#554

Merged
coyotte508 merged 26 commits into
mainfrom
webhooks
Jan 11, 2023
Merged

📝 Document webhooks#554
coyotte508 merged 26 commits into
mainfrom
webhooks

Conversation

@coyotte508

@coyotte508 coyotte508 commented Dec 13, 2022

Copy link
Copy Markdown
Member

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Dec 13, 2022

Copy link
Copy Markdown

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

Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
coyotte508 and others added 2 commits December 13, 2022 17:09
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Co-authored-by: Simon Brandeis <33657802+SBrandeis@users.noreply.github.com>
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
coyotte508 and others added 2 commits December 13, 2022 17:50
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated

@patrickvonplaten patrickvonplaten left a comment

Copy link
Copy Markdown
Contributor

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

@sanchit-gandhi sanchit-gandhi left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread docs/hub/webhooks.md
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md
Co-authored-by: Julien Chaumond <julien@huggingface.co>
@Narsil

Narsil commented Dec 14, 2022

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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"])

@philschmid philschmid left a comment

Copy link
Copy Markdown
Contributor

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

coyotte508 commented Dec 16, 2022

Copy link
Copy Markdown
Member Author
  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

Wauplin commented Dec 16, 2022

Copy link
Copy Markdown
Contributor

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

@osanseviero osanseviero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md

`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
Copy Markdown
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

Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated

## 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
Copy Markdown
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
Copy Markdown
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 <osanseviero@gmail.com>
Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>

@julien-c julien-c left a comment

Copy link
Copy Markdown
Member

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 😹

@gary149 gary149 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
Comment thread docs/hub/webhooks.md Outdated
coyotte508 and others added 3 commits December 26, 2022 16:14
Co-authored-by: Victor Muštar <victor.mustar@gmail.com>

@SBrandeis SBrandeis left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.