8000 CI Move documentation builder to actions by alfaro96 · Pull Request #21137 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 93 commits into from
Jun 1, 2022

Conversation

alfaro96
Copy link
Member
@alfaro96 alfaro96 commented Sep 24, 2021

Reference Issues/PRs

Towards #21068.

What does this implement/fix? Explain your changes.

This PR moves the documentation builder from circleci to GitHub Actions.

Any other comments?

I have only applied the minimal changes for git diff.

@alfaro96 alfaro96 changed the title [DOC] Move documentation builder to actions [CI] Move documentation builder to actions Sep 24, 2021
@alfaro96
Copy link
Member Author

I think that this is ready for a first review round.

CC @ogrisel and @thomasjpfan.

@alfaro96
Copy link
Member Author
alfaro96 commented May 2, 2022

BTW, we have to create a personal API token in circleci and add the CCI_TOKEN secret in GitHub.

Copy link
Member
@ogrisel ogrisel left a 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).

Copy link
Member
@thomasjpfan thomasjpfan left a 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!

@alfaro96
Copy link
Member Author

I have applied the suggested changes and solved the merge conflicts. Let us see if the tests are passing.

@alfaro96
Copy link
Member Author

The failure in the ci/circle: linux-arm64 job is unrelated to this pull request. It is also failing in the main branch.

@alfaro96
Copy link
Member Author

The documentation builder is working for the pull request and also for the main branch.

Copy link
Member
@thomasjpfan thomasjpfan left a 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.

@thomasjpfan thomasjpfan changed the title [CI] Move documentation builder to actions CI Move documentation builder to actions Jun 1, 2022
@thomasjpfan thomasjpfan merged commit eb95e44 into scikit-learn:main Jun 1, 2022
@lesteve
Copy link
Member
lesteve commented Jun 1, 2022

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.

A3E2

@alfaro96
Copy link
Member Author
alfaro96 commented Jun 1, 2022

You are right; we should avoid using external services to download the artifacts. I will open a pull request using the REST API from GitHub instead, as using an official service is always a more reliable option.

@lesteve
Copy link
Member
lesteve commented Jun 1, 2022

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"]}')

ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Aug 4, 2022
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre pushed a commit that referenced this pull request Aug 5, 2022
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0