-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package][ci] added CI stage for R package (fixes #2335, fixes #2569) #2530
Conversation
I think that R environment from conda is not appropriate to run unit tests. Not many users use it, it has its own bugs, it has huge delay in updating package versions, it doesn't work normally on Windows, it means that compilation of LightGBM will be performed by conda's specific compilers. Can you please consider using vanilla R environment? #1143 (comment) |
Sure I can look. To be clear, I'm only using conda as an installer for R itself ( I'll take a look at non-conda R environment. |
ok next issue, I am seeing this on Travis but not locally
When I run locally, I do see that a file
However, that WARNING is not generated on my local machine (macOS High Sierra,R 3.5.0). Of the extensions complained about in that warning, I only see one in that file:
Currently on Travis I'm building with R 3.6.1. I'm going to try with R3.5.0 just to see if the . R version difference is to blame. Next I'll check |
d4d0a9e
to
1c01778
Compare
^src/compute/.git$ | ||
^src/compute/.gitignore$ | ||
^src/compute/CONTRIBUTING.md$ | ||
^src/compute/README.md$ |
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.
src/compute
is the boost stuff we pull in as a git submodule. It's important that the random other stuff from that repo isn't bundled with the R package, as R CMD check
will complain about things like a .git/
folder being put into a source distribution.
R-package/R/lgb.prepare_rules2.R
Outdated
@@ -46,7 +46,7 @@ | |||
#' Species = c( | |||
#' "setosa" = 3L | |||
#' , "versicolor" = 2L | |||
#' , virginica" = 1L | |||
#' , "virginica" = 1L |
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.
fixes
Error: LaTeX error. Mismatched quote or braces
When building the documentation.
.travis.yml
Outdated
# - TASK=mpi METHOD=pip | ||
# - TASK=gpu METHOD=source PYTHON_VERSION=3.5 | ||
# - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 | ||
- TASK=r-pkg R_VERSION=3.6.1 |
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.
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.
Then this variable should be named something like R_VERSION_MAC
to avoid any misleading interpretation.
BTW, why did you abandoned the idea to install the latest version from CRAN sources for Ubuntu?
Do we have any limitation in using chars here? 😄 TASK=r-package
seems to be more pretty to see.
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.
ha nope no limitation, happy to use r-package
. r-pkg
is a bad habit of mine from other projects.
why did you abandoned the idea to install the latest version from CRAN sources for Ubuntu
I followed the instructions from https://cran.r-project.org/bin/linux/ubuntu/README.html which SAY you should get 3.6.x, but still ended up with 3.4.x. I'm not sure why. We are using bionic (Ubuntu 18.04) on Travis, and it seems 3.4.x is the latest r-base
release available. I think I see the problem though...found in this answer that there is one more step to see more versions from that server. I think in my latest commit, I have it successfully installing 3.6.1
Alright, I think this PR is finally ready for review. I've left some comments above calling out items that I think might be concerning. I expect we'll have a conversation about two more things:
@StrikerRUS I know you don't have an R environment to test some of the changes in, but I would definitely like your input on the changes I'm making to |
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.
Small reminder for contributors to R-package: next R release might be 4.0 (I guess if we test against R-devel, we will do it manually for the moment)
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.
Please see below my comments about the CI part.
875eff4
to
3c67ec6
Compare
@StrikerRUS please see 64a46b5 and let me know what you think. Azure pipelines was failing because we are currently getting Ubuntu 14.04 ( I think the solution in that commit should work. |
thanks! just switched them back in d98211f |
All working! @StrikerRUS could you take one more look? |
.vsts-ci.yml
Outdated
@@ -11,7 +11,7 @@ variables: | |||
resources: | |||
containers: | |||
- container: ubuntu1404 | |||
image: lightgbm/vsts-agent:ubuntu-14.04 | |||
image: lightgbm/vsts-agent:ubuntu-14.04-dev |
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.
All working! @StrikerRUS could you take one more look?
👍
guolinke/lightgbm-ci-docker#7 has been merged, so you can switch container back to the production version.
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.
switched back in 9ab619c
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! Thanks!
Thanks so much! I think it's ok to merge with your approval + @Laurae2 's. Do you agree? This one touches a lot of stuff so want to be sure it's ok. |
@jameslamb Sure! @Laurae2's review was outdated, so I re-requested a fresh one from him. |
@Laurae2 could you take one more look? |
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
Thanks for the reviews and help along the way! I'm excited to merge this one 😀 |
I'm still committed to getting R CI running in GitHub Actions (#2353 ) but I think there is also an immediate benefit to having the R package built + unit tests run at all, and tacking that on to Travis is the easiest path.
In this PR, I propose adding an
r-pkg
stage to our Travis configuration to at least test the R package on Ubuntu and macOS. That will catch issues like #2524 , where a change on the C++ side breaks the R package. We can handle tests on Windows, tests with different versions of R, running on GitHub Actions, etc. in later PRs.Opening as a draft PR since I may need to build a few times to get feedback from Travis. I'll change to regular PR and add reviewers when I think it's ready and worthy of your time, but comments are welcome any time!