-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] circle-ci should only run/build plot_* files #12797
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
It's not really that, I'm not sure if we should run this example at all. Ping @qinhanmin2014 |
We should not ordinarily be running examples not preceded by plot_
|
Although, I really think we should run the examples even if they're not touched, since many changes in the codebase do affect the examples. |
I guess this PR now "fixes" the issue which was introduced in #10407, but doesn't solve the larger issue of us missing the new problems introduced in examples due to some changes in the codebase. We have a few options to improve the situation:
If all options are actually feasible, I personally prefer option 1; but I guess there are legitimate reasons for not running the examples all the time, and I have no idea about the capacity of circle-ci and if it can handle the load if we switch to 1. |
Thanks for the summary @adrinjalali. Maybe we can try to go with 1 and see if the impact on the CI duration is unbearable. |
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, we can try running all plot_
examples if the runtime is manageable.
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.
Do you know how we did this before #10407 @adrinjalali I'm pretty sure we have a way to do this previously.
build_tools/circle/build_doc.sh
Outdated
@@ -51,7 +51,7 @@ get_build_type() { | |||
fi | |||
git_range="origin/master...$CIRCLE_SHA1" | |||
git fetch origin master >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return) | |||
filenames=$(git diff --name-only $git_range) | |||
filenames=$(git diff --name-only $git_range -- `find . -name plot_*`) |
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.
According to the logs, maybe we should filter these files at changed_examples 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.
yeah, didn't think it's important, but now I applied the same filter there.
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 seems inconsistent with our output
filenames=XXX
if [ -z "$filenames" ]
echo QUICK BUILD: no changed filenames for $git_range
return
changed_examples=XXX
if [[ -n "$changed_examples" ]]
echo BUILD: detected examples/ filename modified in $git_range: $changed_examples
return
echo QUICK BUILD: no examples/ filename modified in $git_range:
so seems that filenames include all the files, not only examples.
I haven't checked yet. In the meantime, I'll let this PR be as is. We can either have it as a temporary solution, or wait until the other solution is ready. |
I don't think I'll approve if we're unable to figure out how we did this previously (i.e., how #10407 introduce the regression). Unfortunately I'm unable to figure this out. |
ping @lesteve what's your opinion on this? How did we filter examples which do not begin with |
@qinhanmin2014 I'm not sure what it is that you're not approving though. |
(1) I think filenames should include all the files, not only examples. See https://github.com/scikit-learn/scikit-learn/pull/12797/files#r243750313 |
And I've found #8849: Run more examples that do not start with plot_ on CircleCI :) |
@qinhanmin2014 there are two situations where we build the docs. In some cases we build all examples (building the master or release branches for instance), and when we choose to run only the changed examples (on PRs for instance). Before #10407 we were running all examples on all PRs, and #10407 was a proposal to only run changed files, and was accepted. The issue is that sphinx-gallery by default only chooses the files with a Regarding the issue of including all example and documentation files, I changed the filter pattern to include all Now if at some point #8849 gets in, and we haven't switched to what we're proposing here (i.e. going back to always running all examples), it should also modify the filter introduced in this PR, to include also files starting with The issue you pointed out about This all assumes we keep the proposal of #10407, and the discussion here is about reverting that, and always returning I hope this clears up things a bit. |
Took me a while to get what's happening but #10407 overwrote so +1 for this PR |
@@ -57,7 +57,7 @@ get_build_type() { | |||
echo QUICK BUILD: no changed filenames for $git_range | |||
return | |||
fi | |||
changed_examples=$(echo "$filenames" | grep -e ^examples/) | |||
changed_examples=$(echo "$filenames" | grep -E "^examples/(.*/)*plot_") |
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.
grep -e
seems enough?
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.
@adrinjalali Hmm, I tried locally and seems that grep -E won't work, I'm not familiar with -E.
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.
the -E
just gives special meaning to (
and )
, works for me. For me it's equivalent to grep -e "^examples/\(.*/\)*plot_"
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.
Apologies I went through your code too quickly.
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.
LGTM if CIs are green
A bit late to the party, but I agree with @amueller #12797 (comment). It is a bit unfortunate to have the A few comments:
|
Discovered in #12791 that if an example using the
TkAgg
matplotlib bcakend is touched, the doc build fails complaining that thetk
library is not present.This PR is to test this hypothesis, and then to propose a fix to those ubuntu images.