Skip to content

Tool Hosting Guide

Introduction

This guide is designed to assist researchers in hosting and deploying tools (in the form of web applications) on the La Rochelle University (LRU) UCLR platform.

If your application is a static website (for example, one created using Quarto or Shinylive), you can use the GitLab Pages system via the university's GitLab server.

If your application requires a server (for instance, to execute R or Python code), UCLR offers an application deployment service based on ShinyProxy.

While the service is currently operational, the resources available on the UCLR server—hosted by the IT Department (DSI)—are limited (in terms of CPU, RAM, and disk space). Consequently, some applications cannot be deployed at this time.

UCLR provides:

  • 2 Linux-based servers:

  • A production server: accessible to everyone.

  • A test server: accessible only from within the LRU network (via LRU VPN, a wired connection, or the "ULR-secure" Wi-Fi network).

Please feel free to report any bugs or suggest improvements by emailing contact-uclr-support@univ-lr.fr. Your feedback helps us evolve the project to better meet the needs of its users. Prerequisites:

  • An LRU user account
  • Familiarity with the distributed version control system Git
  • Familiarity with Docker

Quick Start

Steps to host your application:

  1. Ensure your application works locally (on your own computer).

  2. Contact the UCLR team via email at contact-uclr-support@univ-lr.fr to request the creation of a new project on the university's GitLab instance (gitlab.univ-lr.fr) within the GitLab UCLR group. In your email, please provide answers to the following questions:

  3. What is the name of your application? (This will be used for the access URL—in the format https://data.univ-lr.fr/labs/shinyproxy/application-name—and as the name of the new project on GitLab.)

  4. Will your application be used by multiple users simultaneously?
  5. Provide a brief description of your application (1–3 lines).
  6. Does your application involve large datasets (> 100 MB)?
  7. Do you have a Dockerfile for your application?
  8. Should the source code for your project be made public (open source)? (GitLab project with public visibility)

  9. Wait for a response from the UCLR team.

  10. Pull the new project code from GitLab to your local machine (git pull).

  11. Add your code and push your changes to the repository (git add + git commit + git push).

  12. Contact the UCLR team via email to have them validate your application's setup; wait for their approval before proceeding to the next step.

  13. Trigger the build and deployment of your application from the repository (Build > Pipelines).

  1. Your application will be live at https://data.univ-lr.fr/labs/shinyproxy/application-name; you are then free to manage its updates independently.

My Repository

Following your hosting request, the UCLR team will create a repository containing an application template that meets specific requirements.

Example of an R Shiny application project; the files provided by UCLR are outlined in red.

  • .gitignore: A file that lists the files and directories to be excluded from the GitLab repository.
  • .dockerignore: A file that lists the files and directories to be excluded from the Docker image.
  • .gitlab-ci.yml: A file that manages continuous integration for the application; see the CI/CD Pipeline section.
  • Dockerfile: A Docker file that describes how to install and launch your application. Each time you release a new version of your application, this file is used to build the new image that will be deployed to the server.
  • Dockerfile.base: A Docker file that installs all of the project's dependencies; the Dockerfile is built upon this base image. This image must be built once; the build process is often lengthy (taking several minutes). If you update the version or add dependencies, you must rebuild the image.

It is recommended to include a README.md file to describe your project.

Clone the repository locally, add your code, and push your changes.

Détecter la langue Français Anglais Arabe Anglais Français Arabe 2 513

CI/CD Pipeline

The Continuous Integration and Continuous Deployment (CI/CD) pipeline allows you to trigger actions (jobs) to automate the building, testing, and deployment of your application.

The first stage is building your application (CI), which involves packaging it as a Docker image. The second stage is the deployment of your application—in the form of a Docker image—to the UCLR server (CD).

Accessing the CI/CD Pipeline

From your project's GitLab LRU interface, you can access the CI/CD pipeline via the Build menu on the left-hand side.

Screenshot of the GitLab project menu. The pipeline menu is highlighted with a red box.

The most recently triggered pipeline (from your latest push) appears at the top of the list.

By clicking on a pipeline (select its number in the "Pipeline" column—in this example, #53229), you can view the various jobs (automated or manual actions) it contains.

Screenshot of the GitLab pipeline list. The pipeline number is highlighted with a red box.

Pipeline Jobs

The various jobs in the UCLR pipeline are shown below:

The purpose of each job:

  • test: A manual job; scan-image checks your Docker image for dependencies with known security vulnerabilities. This check is performed using the scanning tool Trivy. If your project contains a dependency with a CRITICAL vulnerability, the job will fail.
  • build: manual jobs

  • build-and-push-base: builds the base Docker image

  • build-and-push: builds the application's Docker image (based on the base image)

  • deploy:

  • deploy-test: an automatic job triggered after build-and-push; it deploys or updates your application on the test server: https://test-uclr.univ-lr.fr/labs/shinyproxy/application-name

  • deploy-prod: a manual job to be triggered after build-and-push; it deploys or updates your application on the production server: https://data.univ-lr.fr/labs/shinyproxy/application-name

To execute a manual job, click its Run button:

Screenshot showing how to run a GitLab pipeline job. The buttons for executing the job are outlined in red.

Job Status

If an issue occurs during the execution of a pipeline, you can view the details of a specific job's execution.

  • On the page listing your pipelines, click the button for the most recently executed pipeline (under the Status column—e.g., "Passed"). This will display the sequence of jobs carried out by that pipeline.

  • Click on the job name to access its logs (the commands executed by that job).

Job statuses are listed here.

Help

Data Management

Login credentials (usernames, API keys, passwords, etc.) must never be written in plain text within your code.

Use environment variables (for example, a .env file) to manage your credentials securely.

There are several ways for your application to access data, such as:

  • Files: It is not recommended to use Git to store large data files (> 50 MB) or binary files (e.g., .exe, .bin). Instead, you should provide these files or folders to the UCLR team, who will then copy them onto the UCLR server.
  • Web APIs: Retrieving all data via an API can sometimes take a long time (> 30 seconds), forcing users to wait every time they access the application. To speed up application loading, you can pre-process the data (downloading and transforming it) so that it is readily available. This prepared data is then stored on the UCLR server. - Web API: If data needs to be updated regularly (for example, for a dashboard tracking specific indicators), you can create a new GitLab job that executes code to update your data. This code is run periodically via a scheduled GitLab pipeline—for instance, once a day at 11:00 PM (under Build > Pipeline schedules). If an error occurs during the pipeline execution, you will receive an email notification.

Using your application's Docker image locally

You can access the Docker image created by the CI/CD pipeline either through the GitLab website within your repository (to view or delete it) or via the command line (to use it).

On the GitLab website:

  • Access the Docker image via the left-hand menu under Deploy > Container registry.
  • Click on the link for the most recent Docker image (suffixed with latest) to retrieve the image URL (e.g., gitlab.univ-lr.fr:5050/uclr/private/traitements/uclreview:latest).

Via the command line:

Docker must be installed on your machine https://docs.docker.com/get-started/get-docker/.

If your project has restricted access (internal or private), you must:

  • Create a Personal Access Token (PAT) at gitlab.univ-lr.fr (User settings -> Access Tokens -> Add new token).
  • Select the read_registry scope and create the token (please note: keep the generated token in a secure place, as it will not be available again afterward. If lost, you will need to create a new one).
  • Log in to the LRU GitLab container registry:
    docker login -u <your LRU GitLab username (first letter of your first name + full last name)> -p <your LRU GitLab token> gitlab.univ-lr.fr:5050
    

Create a new local container from the Docker image hosted on the LRU GitLab; for example, for an R Shiny application:

docker run -it -p 3838:3838 gitlab.univ-lr.fr:5050/uclr/<path to your project>:latest

Access the application locally using your web browser: http://localhost:3838. If you need to share data between the container and your computer, you must mount a volume by adding the -v <path to folder or file on your PC>:<path to folder or file in the container> parameter to the command:

  • On Linux:
    docker run -it -p 3838:3838 -v /home/user/uclr/project/data:/app/data gitlab.univ-lr.fr:5050/uclr/<path to your project>:latest
    
  • On Windows:
    docker run -it -p 3838:3838 -v //c/Users/uclr/project/data:/app/data gitlab.univ-lr.fr:5050/uclr/<path to your project>:latest
    

If you need to pass values ​​to your application via environment variables, you must add the -e <variable name>=<variable value> parameter to the command:

docker run -it -p 3838:3838 -e DB_PASSWORD="xxxx" -e API_TOKEN_OPEN_API="xxxxx" gitlab.univ-lr.fr:5050/uclr/<path to your project>:latest

Best Practices

Security

  • Always ensure that files containing secrets (logins, passwords, API keys, etc.) are included in your .gitignore file.
  • Limit access to secret variables to only those users who strictly require it (applying the principle of least privilege).
  • Update your dependencies whenever a security vulnerability is discovered.
  • Rotate secrets on a regular basis.

Reproducibility

Best practices for reproducibility in digital analyses conducted using R: report by Thomas Sol Dourdin

Specify the exact versions of the dependencies (language version, modules, packages, etc.) that you are using. Practical tools for managing versions across different programming languages: