Setup the project to run on Kubernetes

The project in GitLab

Project must be hosted in gitlab.pasteur.fr. You can either create a blank project, or adapte an existing project.

Option 1: Create a blank project

Go to GitLab, clic on “New Project” in the top right corner of the page, and choose “Blank Project”.

On the next screen choose where you want your project to be hosted. We consider that you are a member of ada-team and want to name your project my-project.

Choose the visibility of the project from the three possibilities:
- public –> unauthenticated users can view the public access directory and clone the project
- internal –> any authenticated users can clone the project and view the public access directory
- private –> only members of the project or group can clone the project and view the public access directory

Note

More details in gitlab pasteur documentation at https://gitlab.pasteur.fr/help/user/public_access

Create a blank project

Warning

If the visibility of your project is private or internal, dont’t forget to Define deploy token in the next step, after you completed the setup (mandatory).

Note

We now considere that you project is at https://gitlab.pasteur.fr/ada-team/my-project

Create an empty directory named my_project, this directory will contains your sources. Note that you can also Store the sources in customly named directory.

Option 2: Use an existing GitLab project

Let us consider that a project already exists, available at https://gitlab.pasteur.fr/ada-team/my-project Your sources are expected to be in a folder, we consider that this folder is my_project, if it is not the case you can also Store the sources in customly named directory.

Re-use skeleton from example

Examples hosting a Python and R app are provided. These two examples are the skeleton for starting a new project. Choose the branch dedicated to the language you chose, and get the scripts.

Extract and put the content at the root of your project, except for the directory my_project which should not override yours.

Warning

The gitlab project named shiny-k8s-example designed for user is based on previous one named shiny-k8s.
The shiny-k8s-example project contains only “values”, “parameters” and “files” need to be customise by the user, the developper of the shiny app.
The shiny-k8s project is designed for “developper” or administrator K8s and contains more informations.
Like class heritage, the shiny-k8s-example project herits from shiny-k8s project.
For more details about shiny-k8s project, please visit the Developper Guide.

Store the sources in customly named directory

Let us consider that you want to store the sources in src folder. You have to update the Dockerfile``file, and change the ``COPY instruction:

...
# Copy you shiny app
-COPY ./my_project /srv/shiny-server
+COPY ./src /srv/shiny-server
...

You also have to update the docker-compose file, in volume instruction, to run locally your app:

services:
    shiny-server:
    build: ...
    volumes:
-        - ./my_project:/srv/shiny-server/
+       - ./src:/srv/shiny-server/