Skip to content

[MRG+2] DOC build pdf when master or version branch - #7747

Merged
jnothman merged 4 commits into
scikit-learn:masterfrom
waterponey:pdf_doc_build
Oct 29, 2016
Merged

jnothman merged 4 commits into
scikit-learn:masterfrom
waterponey:pdf_doc_build

Conversation

@waterponey

@waterponey waterponey commented Oct 25, 2016 •

Copy link
Copy Markdown
Contributor

Reference Issue

Takeover of PR #7671 for issue #7543

What does this implement/fix? Explain your changes.

This modify the circleCI build to make it build pdf documentation when branch is master or a version number.

@jnothman

Copy link
Copy Markdown
Member

LGTM; at least worth trying!

@jnothman jnothman changed the title DOC build pdf when master or version branch [MRG+1] DOC build pdf when master or version branch Oct 25, 2016
@waterponey

Copy link
Copy Markdown
Contributor Author

I'm using two github account to check the behaviour after PR. Let me get back at you after that's checked.

Comment thread build_tools/circle/build_doc.sh Outdated
# Build and install scikit-learn in dev mode
python setup.py develop

if [[ "$CIRCLE_BRANCH" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]

@lesteve lesteve Oct 25, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason why the && -z "$CI_PULL_REQUEST" has disappeared from my latest comment here.

My understanding is that we should never build the pdf in pull requests because it takes too much time

My expectation is that CIRCLE_BRANCH is going to be master in a PR (because the PR is targeting master). I may be wrong about that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually thinking about it, I remember now that CircleCI builds in branches and not (as you kind of would expect from Travis) on the result of the merge of the PR into master, so CIRCLE_BRANCH may be the name of the branch in the fork.

Still it's better to make sure that we never build the pdf in a PR, for example some beginners create PRs from their master branch sometimes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm but it would allow us to build pdf on PR branches if we want to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, from what I understand, when you do a PR, the build is done on the branch once. In this first build, we'll have CIRCLE_BRANCH = "name_of_the_branch_on_your_fork" and CI_PULL_REQUEST="something"
Then I think, when you merge it to master, this generates another build which will be build from merged master with CI_PULL_REQUEST = nothing. That's what I'm trying to check right now but I keep having time out errors and error from Travis for some reasons I don't get...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm but it would allow us to build pdf on PR branches if we want to.

I assume we wanted to mirror the behaviour of #7671, i.e. only build the pdf doc on pushes into master or into release branches and never inside a PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah probably... depends on how long it takes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

optipng certainly takes too long for doing it in branches.

@amueller

Copy link
Copy Markdown
Member

What happened to optipng? But I'm happy to merge this one first. LGTM

@amueller amueller added this to the 0.18.1 milestone Oct 25, 2016
@waterponey

Copy link
Copy Markdown
Contributor Author

@amueller right now, I have a lot of timeout issues on my side when trying to build on circleCI so I'd rather do another PR later after I'm sure this PR is working well since I'm afraid optipng would take more time (that's what I understand from your previous discussion).

@amueller

Copy link
Copy Markdown
Member

ok fair.

@lesteve

lesteve commented Oct 25, 2016

Copy link
Copy Markdown
Member

Have you tried to run make pdf in your branch locally to make sure it succeeds ? Looking at your branch you don't have 387f25c (from 6 days ago), which fixed the latex build (confusingly and in contrary to TravisCI CircleCI does the build on your fork branch and not on the result of the merge of your branch into master).

What may happen is that you have a latex error and you end up hitting the usual latex interactive prompt in case of error asking you to type x to exit. That would be a reason for the time-out.

@lesteve

lesteve commented Oct 25, 2016

Copy link
Copy Markdown
Member

It looks like you don't have the raised (to 1 hour) timeout either. I would try to rebase your branch on master to see whether your problem just disappear ...

@waterponey

Copy link
Copy Markdown
Contributor Author

Ok, I'll try that ASAP. Thanks for the help !

DOC build pdf when master or version branch
@waterponey

Copy link
Copy Markdown
Contributor Author

Alright it seems to work as expected after a merge (it uses make dist instead of make html when it's a merge on master but not on PR). But it still times out so I have to take care of that...

@lesteve

lesteve commented Oct 27, 2016

Copy link
Copy Markdown
Member

But it still times out so I have to take care of that...

Do you have a log with the timeout somewhere that we could look at? Also it would be great to run make dist locally to have some idea of how long it takes. If everything else fails, there is a way to set up SSH access in a CircleCI so we could try that.

@waterponey waterponey closed this Oct 27, 2016
@waterponey

waterponey commented Oct 27, 2016 •

Copy link
Copy Markdown
Contributor Author

I think I fixed it. I had two different errors. One were due to the mldata returning error 500. I didn't fix it because it works sometimes (and once it works, I think it caches the data so we're okay). But I'll open an issue on that since it is troublesome.

The other issue is that sphinx needed more latex dependencies so I added them in the build.sh.

I ran it on circleCI on my own account and it takes 1 hour and 10 minutes (compared with the 38 minutes for the make html only.

@waterponey waterponey reopened this Oct 27, 2016
@jnothman

Copy link
Copy Markdown
Member

Thanks! This is before including optipng, though? So the time is to vastly increase.

@waterponey

Copy link
Copy Markdown
Contributor Author

Yes. it's without optipng. I think we should think a bit more carefully before including it since it might be taking a bit too long with optipng on to build on each push to master. Maybe we could do something like use a [make pdf] tag that would trigger a specific pdf build ? We should discuss that on a separate issue or PR I think.

@lesteve

lesteve commented Oct 28, 2016

Copy link
Copy Markdown
Member

Since it takes 30 minutes more, I'd be in favour of making sure that we never build the pdf in PRs as I said in #7747 (comment).

@lesteve

lesteve commented Oct 28, 2016

Copy link
Copy Markdown
Member

Other than that it's great that you got it working!

@lesteve

lesteve commented Oct 28, 2016

Copy link
Copy Markdown
Member

LGTM. Once this is merged we should monitor the build of the merge into master to make sure the pdf doc is built and there is no error.

@lesteve lesteve changed the title [MRG+1] DOC build pdf when master or version branch [MRG+2] DOC build pdf when master or version branch Oct 28, 2016
@waterponey

waterponey commented Oct 28, 2016 •

Copy link
Copy Markdown
Contributor Author

@waterponey

Copy link
Copy Markdown
Contributor Author

It works (and took 40 minutes only)

@jnothman

Copy link
Copy Markdown
Member

I'm okay with merging this without optipng, but optipng does make a big
difference to PDF file size, and no doubt to overall bandwidth to the
website. There may also be ways to reduce duplicated work between HTML and
PDF builders, reducing runtime, but I suspect they're hacky.

We should always consider the solution that for the very occasional task of
updating PDF documentation for a release (i.e. not master) this should be
done by hand, or by hook to a private server.

On 28 October 2016 at 23:49, waterponey [email protected] wrote:

It works (and took 40 minutes only)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7747 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz60A7uofsYNUveYw7iR5rGJYbL8cGks5q4e9DgaJpZM4Kfnm2
.

@waterponey

waterponey commented Oct 29, 2016 •

Copy link
Copy Markdown
Contributor Author

Does a lot of people download the pdf documentation ?

I agree with the manual build. There is already a feature that allows you to skip or force the build by adding a tag in the commit message so we might want to do that for the pdf build.

@jnothman

Copy link
Copy Markdown
Member

No, but if we don't have it, people request it. :)

On 29 October 2016 at 23:06, waterponey [email protected] wrote:

Does a lot of people download the pdf documentation ?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7747 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz6wGMefMt4vQem1W2W9u1uW8WYBzYks5q4zapgaJpZM4Kfnm2
.

@jnothman

Copy link
Copy Markdown
Member

Which means, I suppose, that it's better there and big than absent!

On 29 October 2016 at 23:22, Joel Nothman [email protected] wrote:

No, but if we don't have it, people request it. :)

On 29 October 2016 at 23:06, waterponey [email protected] wrote:

Does a lot of people download the pdf documentation ?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7747 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz6wGMefMt4vQem1W2W9u1uW8WYBzYks5q4zapgaJpZM4Kfnm2
.

@jnothman
jnothman merged commit e841996 into scikit-learn:master Oct 29, 2016
@jnothman

Copy link
Copy Markdown
Member

Thanks! Let's see how this goes...

amueller pushed a commit to amueller/scikit-learn that referenced this pull request Nov 9, 2016
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants