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

[r-package] cut CI-time dependency on craigcitro/r-travis (fixes #4348) #4353

Merged
merged 9 commits into from
Apr 12, 2019
Merged

[r-package] cut CI-time dependency on craigcitro/r-travis (fixes #4348) #4353

merged 9 commits into from
Apr 12, 2019

Conversation

jameslamb
Copy link
Contributor

Currently, this project's R stage on Travis depends on craigcitro/r-travis, a project that was officially deprecated in July 2016. In this PR, I propose a way to factor it out.

See #4348 and other linked issues there for more details.

Thanks for considering it!

@trivialfis
Copy link
Member

trivialfis commented Apr 10, 2019

@jameslamb Out of curiosity, I planed to learn R at some point for its abundant statistic libraries. But I found there's no implementation of R semantic tools for code navigation. Closest one I can find would be https://github.com/REditorSupport/languageserver , but their TODO list seems to be too long. Do you use any of these stuffs?

@hcho3
Copy link
Collaborator

hcho3 commented Apr 11, 2019

@jameslamb I changed Travis CI script to install R.

@jameslamb
Copy link
Contributor Author

Thanks @hcho3 . I see now that the R side of Travis is passing!

Is the failing Python task related to this? Or is it something transient that you've seen before?

@jameslamb
Copy link
Contributor Author

@trivialfis Thanks for the link, I've never seen this before!

I'm not familiar with language servers, but is the general idea here that you have a particular IDE you like and you want to be able to develop R code in it and get features like autocompletion, syntax highlighting, error flags, etc.?

RStudio is a wildly popular free, open source IDE amongst R developers. The source code is at rstudio/rstudio if you want to look around for how they do things like autocompletion of R code.

@jameslamb
Copy link
Contributor Author

CI restarted because I just rebased to current master and re-pushed (in case reviewers are wondering)

@jameslamb
Copy link
Contributor Author

Oh wait @hcho3 I still see a failure of the R test (https://travis-ci.org/dmlc/xgboost/jobs/518574498)

I think the bit of .travis.yml you edited will only affect Linux builds, but currently the xgboost R-package only gets tested in Mac OS. I'll go back to r-travis, I'm sure I just missed some step hidden in the many layers of indirection there.

@jameslamb
Copy link
Contributor Author

I am going to try using conda to install R on Mac. The things being done in r-travis required sudo which I feel weird about.

The conda approach has worked for me before, e.g. https://github.com/jameslamb/doppel-cli/blob/master/.ci/setup.sh#L19

@jameslamb
Copy link
Contributor Author

oh @hcho3 I see you just pushed a commit to update the homebrew deps. I did not notice that in .travis.yml! Let's see if it works.

If not, I'm going to try this in setup.sh

if [ ${TASK} == "r_test" ]; then

    conda install \
        -y \
        -c r \
        r-essentials

fi

)"

# install suggested packages separately to avoid huge build times
Rscript -e "install.packages(c('DiagrammeR', 'Ckmeans.1d.dp', 'vcd'), repos = 'https://cloud.r-project.org')"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hcho3 for my own knowledge, why was it necessary to change to cloud.r-project.org from the RStudio mirror?

Copy link
Collaborator

Choose a reason for hiding this comment

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

From this page: "Automatic redirection to servers worldwide, currently sponsored by Rstudio"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you

@jameslamb
Copy link
Contributor Author

pushed a commit to resolve this error:

* checking package dependencies ... ERROR
Packages suggested but not available:
  ‘knitr’ ‘rmarkdown’ ‘testthat’ ‘lintr’

@hcho3 what is xgboost's approach to dev version of the R package on Github? I see this warning:

* checking CRAN incoming feasibility ... WARNING
Maintainer: ‘Tong He <[email protected]>’
Insufficient package version (submitted: 0.82.0.1, existing: 0.82.1)

Is it just a mistake in the DESCRIPTION? Should current version on GitHub actually be 0.82.1.9000? Many R projects follow convention <cran_version>.9000

@jameslamb
Copy link
Contributor Author

Good news: green build on the R test after my most recent commit!
Bad news: R test took 36 minutes installing a million dependencies

In f843af3 I removed rmarkdown and knitr (should not be needed since we use --no-vignettes) and added the environment variable to suppress R CMD CHECK failing a build because of packages in Suggests not being present in the environment.

@codecov-io
Copy link

Codecov Report

Merging #4353 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4353   +/-   ##
=======================================
  Coverage   67.96%   67.96%           
=======================================
  Files         132      132           
  Lines       12251    12251           
=======================================
  Hits         8326     8326           
  Misses       3925     3925

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3078b59...f843af3. Read the comment docs.

@jameslamb
Copy link
Contributor Author

Alright, R tests are working! https://travis-ci.org/dmlc/xgboost/builds/519083803

They still take 35 minutes though, not sure how to work around that. DiagrammeR is just a heavy dependency with a lot of recursive dependencies.

I see that the python test is failing on the build. Do you think it is related to the current state of this branch, or just transient?

@hcho3
Copy link
Collaborator

hcho3 commented Apr 12, 2019

It’s transient failure. I restarted it. As for the long setup time, we can use Docker to cache builds in Jenkins (when R tests get migrated there)

@hcho3 hcho3 merged commit edae664 into dmlc:master Apr 12, 2019
@hcho3
Copy link
Collaborator

hcho3 commented Apr 12, 2019

Merging for now.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants