Working on RENKU

This section describes the general steps to setup this project in RENKU.

Tested with RENKU release 0.5.1

First, choose the appropriate instance of RENKU for your work:

1. Import the R project “template” into RENKU

Importing projects can be done using the GitLab web application that is part of the RENKU system.

Go to the appropriate RENKU’s GitLab then: button01 -> button02 -> button03.

Use https://github.com/auwerxlab/survival_analysis.git as the Git repository URL and fill the other fields according to your needs:

_images/gitlab_screenshot_01.png

2. Build the working environment image

You need a first commit to trigger the build of the project’s docker image.

A simple way to get a first commit is to update the README.rst with your author’s information and a short description.

You can do it directly in GitLab by selecting the README.rst file and using the button04 button.

Once you are done, click on button05.

This will trigger the build of the project’s docker image - have a cup of ☕ as this can take a while.

3. Launch an Interactive Environment

After creating the project in RENKU’s GitLab, it will appear in your projects list in the RENKU web interface.

Launch a new Interactive Environment to start working on the project:

_images/ui_screenshot_01.png

4. Install R packages

This R project uses packrat to manage R packages.

The R packages sources are provided along with this project. However, compiled R libraries are not.

Therefore, the R libraries first need to be compiled from the provided sources using the packrat::restore() command.

This step is done automatically by the Dockerfile 😃.

When opening the project in RENKU for the first time, change the packrat libraries location from the R project to the docker image using the python renku-r-tools package. This can be done from a Terminal within a running Interactive Environment:

$ renku-r ln-packrat-lib -p . -s /home/rstudio/packrat

5. Save your work !

Warning

Work done within a running Interactive Environment gets lost when the environment is stoped, unless it is saved using git! 💥

Danger

Understand what you are doing. Hosting your project on the wrong repository can expose sensitive information and data! 💥

It usually boils down to the following points:

  • Understand the project’s privacy requirments.

  • Know who has access to the git repository.

  • If you whitness a breach, immediatly inform the responsible persons and fix the breach (make sure to also delete all sensitive information from previous versions and logs).

Renku uses GitLab/git for version control and to save the work that is done within a running Interactive Environment.

When you are ready to save changes made to the project, take a snapshot of all its files:

$ git add -A

Then, commit the changes:

$ git commit -m "<your_short_description>"

And finally, push the committed changes to the remote git repository in the RENKU GitLab:

$ git push

6. Keep up to date with the last version of the project “template”

To keep updated with the last version of the code, set an upstream remote repository and use the git rebase command.

Set the upstream remote repository:

$ git remote add upstream https://github.com/auwerxlab/survival_analysis.git

Whenever you need the latest updates from the upstream repository, run:

$ git fetch upstream
$ git rebase upstream/master

👍 That is it!