5. Uploading packages to servers

Upon reaching this point of the workshop, we have seen the basics on how to create DataSHIELD packages and how to make sure that they work on our computers. The next logical step is to upload them to a real server to do the final testing on a real scenario.

On this section we will see how to do this using an Opal server. If anyone from Molgenis would like to contribute a subsection dedicated to Armadillo, please do a PR.

Opal

Opal, developed by OBiBa, is a comprehensive core data management application that plays a vital role in the DataSHIELD infrastructure. This server application delivers a wide range of tools for importing, transforming, and describing data, as well as managing subject identifiers during data import and export processes.

In order to upload our server packages to it, we have two distinct methods 1 using the opal web interface, and 2 using the opalr package from our computer. We will focus on the second method on this workshop.

The opalr package offers us many administration functionalities; installing packages, uploading data, managing permissions…

Installing a GitHub hosted package

The first option that we will explore is to install a package that is hosted on a GitHub repository. To do that we will do the following.

o <- opalr::opal.login(
    username = "user",
    password = "password",
    url = "https://myopal.org"
)
opalr::dsadmin.install_github_package(
    opal = o,
    pkg = "repo/package",
    ref = "main",
    profile = "default"
)

The procedure is quite similar to the one of using DataSHIELD, first you need to create a connection to Opal, and then you perform operations on it.

Warning

In order to sucessfully install packages on the Opal, we have to login using an account with administrator privileges. On real world deployments probably we will not have them.

Installing a local package

The second case corresponds to not having the package on GitHub, or maybe in the case we want to test it on an real server before actually putting the code on GitHub.

Fortunatelly opalr also offers the option of uploading the package we have on our computer to the Opal server. In order to do that we have to run the following code

o <- opalr::opal.login(
    username = "user",
    password = "password",
    url = "https://myopal.org"
)

opalr::dsadmin.install_local_package.install_github_package(
    opal = o,
    path = devtools::build(),
    profile = "default"
)
Warning

For this to work we need to be running the R session on the working directory where our package is located. We can check our working directory with getwd() and change it with setwd("/our/new/path").

Exercise 5

  1. Find the administration credentials for the opal-demo.obiba.org server.

Username: administrator

Password: password

  1. Push the package we developed throughout this workshop (dsServer) to the Opal server.

  2. Test that the package works on the Opal server.