Step 1 : Setup your project on gitlab

Step 1.1 : Host your project on GitLab

To be able to deploy your shiny app automatically and easily, your project must be hosted in gitlab.pasteur.fr.

Depending on your stage of development, you can either create a blank project or adapt an existing project (if you have already hosted your project on GitLab).

Important

In accordance with IT department recommendations and to comply with best practices in tool development, your project should not be hosted on your personal GitLab’s page but on your team GitLab’s page.

Option 1: Create a blank project

Go to GitLab, click 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. Here, we consider that you are a member of ada-team and want to name your project my-project.

Caution

Please don’t use “_” in your project name

Create a blank 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

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

If your project is hosted in your personal GitLab’s projects, please move it in your GitLab Team projects.
Go to your project page on GitLab, click on “Settings” –> “Generals” in the left menu.
Settings General

Select the “Advanced” section

Settings General

Follow the instructions in “Transfer” section, by selecting your team name in “Select your new namespace” :

transfer_project

Caution

Please don’t use “_” in your project name, use “-” instead.
You can change the project name in “Settings” –> “General” –> “Advanced” and “Change path “ section changepath

Step 1.2 : Re-use skeleton from shiny-k8s-example

Note

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

Shiny-k8s-example provides all the configuration files needed for deployment, which must be adapted to your application, as well as a sample Shiny application in Python and R.
Select the branch dedicated to the language you have chosen, and retrieve the folder you are interested in:
- In python : python zipped sources (from branch base-python )
- In R : r zipped sources (from branch base-r)

Extract and put the content of zipped folder at the root of your GitLab project.

The archive contains:
  • my_project : a shiny example project in the directory named .

  • chart : yaml configurations files describing how your application should be deployed in kubernetes

  • .gitlab-ci.yaml : a preconfigured CI/CD pipeline building the docker image wrapping your app. You will later adapt it to actually deploy you application in kubernetes

  • and more…

Note

The GitLab project named shiny-k8s-example is designed for shiny app developers, it applies the shiny-k8s toolkit. It contains only “values”, “parameters” and “files” that need to be customise by the user.
The GitLab project named shiny-k8s is designed for “developper” of the toolkit, kubernetes administrators and contains more informations. It contains recipies for building the docker image, the helm package, and the documentation.
For more details about shiny-k8s project, please visit the Developper Guide.