-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
CI Move documentation builder to actions #21137
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
Conversation
I think that this is ready for a first review round. CC @ogrisel and @thomasjpfan. |
BTW, we have to create a personal API token in |
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.
Sorry for the late review. Assuming you can resolve the conflicts, this LGTM. I can create the need secret upon merging if we agree on the name (see below).
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.
Sorry for the late review. This is very good work!
I have applied the suggested changes and solved the merge conflicts. Let us see if the tests are passing. |
The failure in the |
The documentation builder is working for the pull request and also for the |
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 have a minor comment, otherwise LGTM
I added the circleci API into this repo's secrets, so it should work when we merge.
My understanding is that this is using an external service https://nightly.link/ to conveniently (i.e. without token) be able to download the GHA artifact from the CircleCI build. Is there a plan to use the github REST API instead? I looked a bit at it and it seems the way it could work is the following:
curl -i \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/scikit-learn/scikit-learn/actions/artifacts/257506940/zip This seems a bit more work but probably more reliable than relying on a non-official service to download artifacts. |
You are right; we should avoid using external services to download the artifacts. I will open a pull request using the REST API from |
In case it can be useful, below is a snippet using PyGithub to get a temporary download url from a workflow run_id and a build name (doc vs doc-min-dependencies). This may be simpler than using the REST API directly. I don't think PyGithub allows you to download directly artifacts. The snippet may be improved of course. from collections import defaultdict
import os
import re
from github import Github
token = os.environ["GITHUB_TOKEN"]
gh = Github(token)
sk_repo = gh.get_repo("scikit-learn/scikit-learn")
run_id = 2422530744
build_name = "doc"
wr = sk_repo.get_workflow_run(run_id)
_, artifacts_info = wr._requester.requestJsonAndCheck("GET", wr.artifacts_url)
(artifact,) = [
each for each in artifacts_info["artifacts"] if each["name"] == build_name
]
headers, _ = wr._requester.requestJsonAndCheck("GET", artifact["archive_download_url"])
print(f'temporary download_url: {headers["location"]}') |
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Reference Issues/PRs
Towards #21068.
What does this implement/fix? Explain your changes.
This PR moves the documentation builder from
circleci
toGitHub Actions
.Any other comments?
I have only applied the minimal changes for
git diff
.