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

Could we add a point in the docs about setting up CI ? #522

Open
lrnv opened this issue Apr 5, 2024 · 6 comments
Open

Could we add a point in the docs about setting up CI ? #522

lrnv opened this issue Apr 5, 2024 · 6 comments

Comments

@lrnv
Copy link

lrnv commented Apr 5, 2024

Hey,

In one of my packahe, I wanted to use RCall in tests to compare the results I have with existing R packages that are supposed to compute the same quantities.

To do that locally, it was really easy with RCall and shout out for that !

But On github actions, it was waaaaaay harder to setup. I finally found a proper way to do it copying the solution from https://github.com/szcf-weiya/MonotoneSplines.jl/actions/runs/7955113426/job/21713557684#step:6:2 that i found.. i dont even know how. I looked around for a few hours before finding a solution.

Considering the hassle and the burden of setting this up, I wander if a specific piece of documentation (which has to live here in RCalll) would be possible so that, next time, it would be easier to setup.

I could propose a PR to the docs to write down what i found.

@lrnv lrnv changed the title Could we add a point in the docs about sttup up CI ? Could we add a point in the docs about setting up CI ? Apr 5, 2024
@evangorstein
Copy link

Agreed! I just had a similar experience struggling to figure out how to use RCall in the automatic testing environment with github actions (locally, testing run smoothly). Considering that one huge use case of RCall is to compare the results of your Julia implementation with the results from a given R package, it would be extremely helpful to have it documented how to set up the automatic testing environment so that RCall works.

@lrnv
Copy link
Author

lrnv commented Apr 11, 2024

@evangorstein could you share your setup ? Mine is unfortunately still in private repo but will be released soon

@evangorstein
Copy link

I ended up copy-pasting from the workflow for MonotoneSplines.jl that you linked to. That is, I included the following in my workflow file

      - uses: r-lib/actions/setup-r@v2
        with:
          r-version: ${{ matrix.r-version }}
      # actually it seems that without installing `libcurl4-openssl-dev`, there also exists a libcurl.so, but at `/lib/x86_64-linux-gnu/libcurl.so.4` instead of `/usr/lib/x86_64-linux-gnu/libcurl.so.4`
      # for consistency with previous setting and also recommended at https://github.com/r-lib/actions/tree/v2/setup-r-dependencies, continue to install `libcurl4-openssl-dev`
      - name: Install libcurl on Linux
        if: runner.os == 'Linux'
        run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev
      - name: Install Dependencies for R
        run: |
          r = getOption("repos")
          r["CRAN"] = "https://cloud.r-project.org/"
          options(repos=r)
          install.packages("some_package")
        shell: sudo Rscript {0}

and then later

      - uses: julia-actions/julia-runtest@v1
        env:
          LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libcurl.so.4
          LD_LIBRARY_PATH: /opt/R/${{ matrix.r-version }}/lib/R/lib

I'm not sure whether all of this is necessary, but I included it all just in case.

@palday
Copy link
Collaborator

palday commented Apr 12, 2024

I'm not opposed to adding some tips to the docs in a section titled something like "Using RCall in CI". Two other places to look for examples:

@lrnv
Copy link
Author

lrnv commented Apr 30, 2024

Just to give a small status update since this is runing on a private repo EDIT: not anymore got published, the file is there. The way of setting R packages that i used (the r-lib/actions/setup-r-dependencies@v2 action) gives automatic caching of them from a run to the next and is the actual recomended way of doing this.

However I still struggle to get it stable : it installs the last version of every R package each times, which is known to be buggy, and in 3 weeks I had to upload the R version twice from 4.1 to 4.3 to 4.4.0 now... Maybe there is something that could be done to freeze package versions with R::renv but I was not able to make it work.

@cecileane
Copy link

I also recently struggled with this, mostly to make Julia RCall find the path to R under macos-latest. It worked with this setup.

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

No branches or pull requests

4 participants