-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Automatic docs for launcher #1044
Changes from all commits
c2eaa28
1da6e24
4cab978
86736cb
2bddc78
7206fe3
e40b942
94065cd
c6590fd
a9753a5
0c77c75
a44a82b
dac2348
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Automatic Documentation for Launcher | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'merveenoyan/autodoc' | ||
|
||
jobs: | ||
update_docs: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Launcher | ||
id: install-launcher | ||
run: | | ||
cd launcher | ||
cargo build | ||
cd .. | ||
|
||
- name: Run TGI Launcher docs | ||
id: run-launcher-help | ||
run: | | ||
output=$(text-generation-launcher --help) | ||
echo "::set-output name=output::$output" | ||
|
||
- name: Update Docs | ||
run: | | ||
output="${{ steps.run-launcher-help.outputs.output }}" | ||
rm /docs/source/basic_tutorials/launcher.md | ||
echo '```' >> /docs/source/basic_tutorials/launcher.md | ||
echo $output >> /docs/source/basic_tutorials/launcher.md | ||
echo '```' >> /docs/source/basic_tutorials/launcher.md | ||
echo "Docs are updated!" | ||
|
||
git add launcher.md | ||
git commit -m "Update launcher.md" | ||
git push | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be doing a new push to main, but the workflow triggers with every new push. Wouldn't this trigger an infinite loop? (not sure) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I think it would be better to make this check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I setup what you said of having a check instead of force-push, and it also works. Both are fine, but indeed it could trigger infinite loop I don't knwo how GH handles those. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this always be up to date since it runs every time there's a change in
so whenever there's a change in the file it will always remove the launcher.md and then create new one and post output. Is this what you mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed git pushes and it will only update after merger to main (I think below is only way to do so? see https://github.com/orgs/community/discussions/26724#discussioncomment-3253093)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will think more on this, I can't push this way either :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion was to, rather than GA updating This means that users, not GA, will be forced to run the command to update the doc (it could be a bash script encapsulating everything as well). (again, no strong opinion, it has its pros and cons) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did it like so: (also started working in another PR since in this fork the action is not triggered)
|
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 don't think the GitHub Actions workflow has anything installed to run
text-generation-launcher --help
. You will need to either install this in GH Actions or use a Docker GA that allows you to dodocker run ghcr.io/huggingface/text-generation-inference:latest --help
(which I think has same output)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.
Maybe include it in the
build
step too (because there it's available as the docker image)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.
@osanseviero @Narsil I feel like installing from docker doesn't make sense given
text-generation-launcher --help
will not checkmain.rs
in that branch, does it? So is the output going to come from the source? I tested it and it was coming from docker.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 realized
make install
works better for this case.