-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Migrate pytorch_python_doc_build to github action #57371
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
Migrate pytorch_python_doc_build to github action #57371
Conversation
💊 CI failures summary and remediationsAs of commit 4c5fe73 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
bf4a5f6 to
7d33d8d
Compare
Codecov Report
@@ Coverage Diff @@
## master #57371 +/- ##
=======================================
Coverage 76.83% 76.83%
=======================================
Files 1986 1986
Lines 197988 197988
=======================================
+ Hits 152115 152131 +16
+ Misses 45873 45857 -16 |
7d33d8d to
be3ffae
Compare
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.
here's a job if condition that doc_push only runs on master
|
@seemethere updated, and moved to the same workflow as the previous python CI workflow so that they can share the artifacts. May need your approval again for the new workflows |
|
Oh, there's a template to generate this, hold on, will move the code there |
10f1da9 to
36caf82
Compare
Migrated to linux_ci_workflow.yml.in, and decouples doc build from tightly coupled with |
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.
we can also move cpp docs job to here in the future
36caf82 to
a414c14
Compare
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.
Note that the secrets GITHUB_PYTORCHBOT_TOKEN needs to be set up first before merging
|
question: why is the docs build being added as a gated job inside the (cc @seemethere) |
|
also, I have enabled GitHub Actions to run on this PR; when you have the chance, could you fix the lints? https://github.com/pytorch/pytorch/runs/2504623867 see this section in |
@pytorch/pytorch-dev-infra I am currently working on #57572 which should resolve this ergonomics issue |
Originally, I was implementing it in its own workflow, later I was debugging it and I agreed with @seemethere's comment that we can put the docs build together with linux_ci_workflow.yml.in, maybe they can share more steps together. But, the only dependencies that the doc build job requires is a I can refactor this and make it cleaner. |
9be290e to
7a2ba0c
Compare
.github/workflows/docs.yml
Outdated
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.
TODO, this may also need to include the cases for
- refs/heads/master
- refs/tags/vx.y.z
- refs/tags/vx.y.z-rc
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.
please add a todo comment
# TODO: add tags doc push for regex: `v[0-9]+(\.[0-9]+)*-rc[0-9]+`
also currently doc push is only enabled on nightly instead of master, should we change this to nightly?
makes sense; thanks!
either way sounds good to me :) |
7a2ba0c to
2fed6f4
Compare
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.
This needs to be dependent on the build stage since building the docs requires a binary, you can reference the test stage to see how to download the artifacts from the build stage
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.
thanks, yes sure, I may need to figure out how to iterate this faster
every change requires approvals - so each iteration requires a few hours of wait - anything special I can do to test the flow e2e on my own before requiring your review time?
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.
yeah this is unfortunately a pain point that we haven't yet solved; one hacky solution we could take in the short-term is have you make a tiny cosmetic diff and Jedi-land it so that GitHub no longer thinks you're a "first-time contributor", after which (I hope) you wouldn't need approval to run CI on this PR; @seemethere what do you think?
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.
as for running locally, I don't think we have a good solution for that yet either (but I could be wrong)
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.
tested a few times, and yes, indeed it requires the artifacts generated from the build step, I updated and may need a new approval for the workflows.
Noticeable changes are
- refactor
docker cpinto a singledocker run - download artifacts from
buildstep and mount as a volume - change from
shtobashto run in docker as it requirespushdwhich is a bash-only command - refactor circleci tag into GITHUB_REF - as gha only supports git ref
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.
To pass the "first-time contributor" PR #57779
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.
Can you see if you can simplify this docker logic here?
It'd be a good question to ask what it actually is trying to do and recreate the most minimally viable script from that.
For example, are the docker cp commands actually necessary here? Is the export id=$(docker run....) actually necessary or can we do it in a more simplistic docker run command?
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.
yes, did that, the only reason docker cp is necessary in circleci is that their docker engine is wired remotely - https://circleci.com/docs/2.0/building-docker-images/#mounting-folders. While github action docker is running locally and volume mount is doable.
2fed6f4 to
b67ee83
Compare
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.
generated from .github/scripts/regenerate_cancel_redundant_workflow.py
fb801b7 to
df3cfd3
Compare
|
now that #57779 is merged, hopefully it should automatically run GHA workflows for you without someone else having to approve them... if not then I'll be sad haha |
d702293 to
82af939
Compare
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 think we probably don't need to do this here, the reason we were doing the whole docker commit && docker push was to preserve artifacts from one stage to another
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.
This is for feature parity from circleci jobs. I think it can be useful if people rely on this debug image for quick iteration on their docs. Should we still remove it?
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.
just checked that the ecr user in gha doesn't have push permission, will remove this then
718d399 to
fcccfef
Compare
fcccfef to
4c5fe73
Compare
|
@zhouzhuojie has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@zhouzhuojie merged this pull request in 7756cb6. |
Summary: # Changes This PR migrates `pytorch_python_doc_build` from circleci to github actions. Noticeable changes - Refactor `docker cp` into a single `docker run` with volume mount, because the in circleci volume is not accessible from its remote docker engine - `pytorch_python_doc_push` job will have a race condition with circleci, which will be migrated in separate PRs Pull Request resolved: pytorch#57371 Reviewed By: samestep Differential Revision: D28416289 Pulled By: zhouzhuojie fbshipit-source-id: 04caccccf3d7eb7e2225846a406a53ccda356d44
Changes
This PR migrates
pytorch_python_doc_buildfrom circleci to github actions.Noticeable changes
docker cpinto a singledocker runwith volume mount, because the in circleci volume is not accessible from its remote docker enginepytorch_python_doc_pushjob will have a race condition with circleci, which will be migrated in separate PRs