Version 1.4.1 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

Deployment

This page provides an overview of approaches to deploy RDepot.

It is recommended to have a look at the Architecture page first to familiarize yourself with the RDepot components and their role.

Docker

Images

OpenAnalytics-maintained docker images are available on docker hub:

The images are based on adoptopenjdk images.

Both RDepot images are available under several tagging strategies:

  • versioned (e.g. 1.4.1): Recommended for production.
  • snapshots (e.g. 1.5.0-SNAPSHOT): Bleeding edge. Not recommended for production.
  • latest: Most recent build. Not recommended for production.

Example (Docker Compose)

The following prerequisites are needed:

  • docker (https://www.docker.com/)

  • docker-compose (https://docs.docker.com/compose/)

    While not a strict requirement, docker-compose will help you better manage the multiple containers that are involved. This guide will continue to use docker-compose, but you should be able to convert the example to standard docker.

    (Install i.e. by issuing pip install docker-compose)

  • port 80 is not used (localhost, check for nginx or apache service)

An example docker-compose YAML file:

version: '3'
services:
  proxy:
    image: library/nginx:alpine
    container_name: oa-rdepot-proxy
    restart: unless-stopped
    volumes:
      - ./docker/proxy/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./docker/proxy/sites-enabled/rdepot:/etc/nginx/sites-enabled/rdepot:ro
      - repository:/opt/rdepot/repo/:ro
    ports:
      - 80:80
    depends_on:
      - app
      - repo
    networks:
      - oa-rdepot
  db:
    image: library/postgres:alpine
    restart: unless-stopped
    hostname: oa-rdepot-db
    container_name: oa-rdepot-db
    volumes:
      - ./docker/db/rdepot.sql:/docker-entrypoint-initdb.d/rdepot.sql:ro
    networks:
      - oa-rdepot
    environment:
      - POSTGRES_PASSWORD=mysecretpassword
  app:
    image: openanalytics/rdepot-app:1.4.1
    restart: unless-stopped
    hostname: oa-rdepot-app
    container_name: oa-rdepot-app
    entrypoint:  java -jar /opt/rdepot/rdepot.war
    networks:
      - oa-rdepot
    depends_on:
      - db
    environment:
      - DB_URL=jdbc:postgresql://oa-rdepot-db:5432/postgres
      - DB_USERNAME=postgres
    healthcheck:
      test: ["CMD-SHELL", "if [ \"$$(curl -I localhost:8080 2>/dev/null | grep HTTP/1.1 | cut -d\" \" -f2)\" != \"302\" ]; then exit 1; else exit 0; fi;"]
      interval: 10s
      timeout: 10s
      retries: 10
  repo:
    image: openanalytics/rdepot-repo:1.4.1
    restart: unless-stopped
    hostname: oa-rdepot-repo
    container_name: oa-rdepot-repo
    volumes:
      - repository:/opt/rdepot/
    networks:
      - oa-rdepot
networks:
  oa-rdepot:
    ipam:
      config:
        - subnet: 192.168.49.0/24
volumes:
  repository:

The missing files (for volume mapping) can be found in our Git repository:

The final step is to launch the Docker containers using docker-compose:

docker-compose up -d

One can then go to http://localhost to log in.

There is an admin user with username einstein and password testpassword.
See this file for the included configuration which specifies the user credentials. One can override these parameters using environment variables.

To complete an end-to-end flow: R package to R Depot to Repository Server to R client, the following steps are needed:

  • create a repository with (or edit)
  • submit one or more packages to that repository via the R Depot web interface
  • publish the repository using the green button in the repositories view (if needed)
  • go to the published package page (repositories view, click repository name, click package name)
  • use the install URL shown on the published package page to install the package in R
    install.packages("somePackage", repos = c("http://localhost/repo/repositoryName", getOption()))
    

To (re)start with fresh database:

  • remove the containers via docker-compose down -v
  • start up again using docker-compose up -d

Kubernetes

Kustomize

TODO

Helm?

There are currently no plans to maintain helm charts from OpenAnalytics.

Example (Minikube)

TODO

WAR & JAR

The latest versions of RDepot are available on our downloads page in WAR and JAR format.

This is currently not the recommended approach to deploy RDepot. This route is only relevant in the following cases:

  • you wish to develop and/or extend RDepot
  • you are not able to run docker on your platform of choice

Download both rdepot-app-1.4.1-application.war (sha256, md5) and rdepot-repo-1.4.1-application.jar (sha256, md5) and start them by executing java -jar rdepot-app-1.4.1-application.war and java -jar rdepot-repo-1.4.1-application.jar respectively.