Skip to content
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

Version support and automatic CI build #2214

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

intelkevinputnam
Copy link

Description

replaces #1785

Version of docs built using CI: https://intelkevinputnam.github.io/scikit-learn-intelex/

There are two major changes in this PR:

  1. Version switching support
  2. CI deployment to GitHub pages via GitHub action

Version Switching Support

All published versions must be tracked in doc/versions.json as this will allow all subsequent versions of the docs to automatically be able to switch to the latest without needing to rebuild the docs.

The version is supplied by the installed version of scikit-learn-intelex (latest by default in the CI script). This way building the docs is not dependent on the oneDAL environment with the goal of making it easier to contribute to and edit the docs. It should also make builds faster.

Since the move to the UXL Foundation, version switching is broken in the latest version of the docs because of there is a hard coded path to the versions.json that no longer exists (it was intel.github.com/scikit-learn-intelex). It also is now settable in the conf.py (html_context)

CI Deployment to GitHub Pages via GitHub Action

GitHub pages will be updated automatically. A new directory will be added for each version of scikit-learn-intelex. When the same version is built twice, it is overwritten. See .github/workflows/publish.yml for the script. The branch will need to be changed to main before it will work on the main branch. I'm not sure it is necessary to have the docs built on every merge into main. Adding workflow_dispatch: to the list of conditions for running the action can provide a handy "deploy whenever you feel like it" option.

To build the docs locally, run ./build-docs.sh. Docs can be previewed locally by starting a web server (python3 -m http.server) in the _build directory and using localhost:8000/scikit-learn-intelex as the URL.


Checklist to comply with before moving PR from draft:

PR completeness and readability

  • I have reviewed my changes thoroughly before submitting this pull request.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have added a respective label(s) to PR if I have a permission for that.
  • I have resolved any merge conflicts that might occur with the base branch.

Signed-off-by: Putnam, Kevin <kevin.putnam@intel.com>
Signed-off-by: Putnam, Kevin <kevin.putnam@intel.com>
Signed-off-by: Putnam, Kevin <kevin.putnam@intel.com>
Signed-off-by: Putnam, Kevin <kevin.putnam@intel.com>
@david-cortes-intel
Copy link
Contributor

@intelkevinputnam I'm seeing several misrendered things in the docs from your branch.

For example:
image

This is how it looks for me in a local build:
image

make html

source ./set_version.sh
export SPHINXPROJ=scikit-learn-intelex
Copy link
Contributor

Choose a reason for hiding this comment

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

We also have daal4py with docs under doc/daal4py.

import subprocess
import os

def get_version():
Copy link
Contributor

Choose a reason for hiding this comment

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

@icfaust Could you please look into whether this captures the version number correctly.

background-color: #2980b9;
}

div#version-switcher-dropdown {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: if we have this line right here, do we still need to add a version selector in the conf.py file?

"version_selector": True,

I understand that version selector plugin is meant for ReadTheDocs, so don't know how it plays with these.

# -- Project information -----------------------------------------------------

project = "Intel(R) Extension for Scikit-learn*"
copyright = "Intel"
author = "Intel"

# The short X.Y version
version = "2025.0.0"
version = os.environ.get('DOC_VERSION','')
Copy link
Contributor

Choose a reason for hiding this comment

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

How about changing the version to "latest" here when it doesn't find the env. variable?

@@ -0,0 +1,19 @@
[
{
"name": "2025.0 (latest)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this file auto-generated from the releases that we have as github tags instead? It's BTW missing some version numbers, such as 2024.7.0:
https://github.com/uxlfoundation/scikit-learn-intelex/releases

git config --global user.email "${GITHUB_ACTOR}@github.com"
git add .
git commit -m "latest HTML output"
git push -f https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: what happens if something goes wrong during the build? For example, we might run into errors such as failing to import the modules from which autodoc generates documentation, which would manifest as a "warning" being issued but some docs still being built.

Could there be a check for build warnings that would make this script fail (avoiding pushing anything to GH) if something goes wrong?

@@ -0,0 +1,19 @@
[
Copy link
Contributor

Choose a reason for hiding this comment

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

What about "stable" version tag in addition to latest?

@david-cortes-intel
Copy link
Contributor

Perhaps this PR could be a good opportunity to address one topic around the version numbers: in open source projects, version "latest" or "dev" is typically meant for docs from "latest commit of the master branch", while the "last released version" is typically "stable".

This is the case for the docs of the scikit-learn package which this repository builds upon, and for most other machine-learning-related libraries such as gradient boosting frameworks and similar.

Could we make the switch here so that the freshest release would be "stable" and have "latest" as something built periodically from the main branch?

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.

2 participants