FAQ
How to open the last run pipeline ?
First chose in (1) the appropriate branch, master, main, my-new-feature, … then either click on the pipeline status (2). You can acces to all pipeline using Build>Pipelines (3a,3b).
In pipeline UI, you can filter on view, here after we are about to filter pipelines to show only from main branch.
Job failed in fetch-log-dev job
Why does Kubernetes indicat that it cannot pull image?
If you have a waring/error in job fetch-log-dev despite job passed for Build and deploy-example,
or if you get the “503 Service unavailable” page when trying to access to your app,
Failed to pull image "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz:53f29ed4": rpc error: code = Unknown desc = failed to pull and unpack image "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz:53f29ed4":
failed to resolve reference "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz53f29ed4":
failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://gitlab.pasteur.fr/jwt/auth?scope=repository%3Ahvaret%2Fcheckmyindex%2Fdev%3Apull&service=container_registry: 403 Forbidden
… This may be due to a lack of deploy token. | | If your project became/is private or internal, you may have forgot to indicate that the registry (where the images are stored) is also private, and/or did not provided credentials to Kubernetes through the CI. | If so, read 4.4.1 Private registry and deploy token to indicate that the registry is private, and then provide the credentials with Step 4.1: Define a deploy token (Optionnal).
How to fix build error during docker compose during R packages installation ?
During the build of docker image following docker compose command line, it’s possible that installation error occur.
Example :
...
177.2 x Failed to build terra 1.7-39
179.6 Error:
179.6 ! error in pak subprocess
179.6 Caused by error in `stop_task_build(state, worker)`:
179.6 ! Failed to build source package 'terra'
179.6 Full installation output:
179.6 * installing *source* package 'terra' ...
179.6 ** package 'terra' successfully unpacked and MD5 sums checked
179.6 staged installation is only possible with locking
179.6 ** using non-staged installation
179.6 configure: CC: gcc
179.6 configure: CXX: g++ -std=gnu++17
179.6 checking for gdal-config... no
179.6 no
179.6 configure: error: gdal-config not found or not executable.
179.6 ERROR: configuration failed for package 'terra'
179.6 * removing '/tmp/RtmpBf6Kdv/pkg-lib11d6ed53c/terra'
179.6 ---
179.6 Backtrace:
179.6 1. pak::pkg_install(pkg = packages_list$Package_name[i])
179.6 2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...)...
179.6 3. err$throw(res$error)
179.6 ---
179.6 Subprocess backtrace:
179.6 1. base::withCallingHandlers(cli_message = function(msg) { ...
179.6 2. get("pkg_install_do_plan", asNamespace("pak"))(...)
179.6 3. proposal$install()
179.6 4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, ...
179.6 5. base::withCallingHandlers({ ...
179.6 6. pkgdepends:::handle_events(state, events)
179.6 7. pkgdepends:::handle_event(state, i)
179.6 8. pkgdepends:::stop_task(state, worker)
179.6 9. pkgdepends:::stop_task_build(state, worker)
179.6 10. base::throw(new_pkg_build_error("Failed to build source package {pkg}", ...
179.6 11. | base::signalCondition(cond)
179.6 12. global (function (e) ...
179.6 Execution halted
------
Dockerfile:15
--------------------
13 |
14 | # Install R packages
15 | >>> RUN Rscript /opt/scripts/install_r_packages.R
16 |
17 | # grant shiny to created bookmark state directory in this directory
--------------------
ERROR: failed to solve: process "/bin/sh -c Rscript /opt/scripts/install_r_packages.R" did not complete successfully: exit code: 1
ERROR: Service 'shiny-server' failed to build : Build failed
A quick search on web, permits to identify that system package is required.
In the case of the previous example, we find, thanks to this link,
that it’s necessary to install libgdal-dev package.
In order to install it inside your container, you just add it in the Dockefile file ( see dedicated section Adapting the Dockerfile to your needs ) as below.
# install additional dependencies, comment the block if you don't have one
# add libgal-dev in order to fix "configure: error: gdal-config not found or not executable"
RUN apt-get update \
&& apt-get install -y \
wget \
libgdal-dev \
&& rm -rf /var/lib/apt/lists/*
After modification, you have just to run again the docker compose command line ( see dedicated section run locally ).
docker compose up --build
How to fix infinite installing R package during docker compose ? How to install “tidyverse” R packages ?
When you run a “docker compose” command, if the step “installation of R package” doesn’t finish without error, like in this example with the installation of R package “tidyverse”
1docker compose up --build
2[+] Building 2138.3s (8/15)
3=> [shiny-k8s-toolkit internal] load build definition from Dockerfile
4=> => transferring dockerfile: 1.30kB
5=> [shiny-k8s-toolkit internal] load metadata for registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
6=> [shiny-k8s-toolkit internal] load .dockerignore
7=> => transferring context: 2B
8=> [shiny-k8s-toolkit 1/11] FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
9=> [shiny-k8s-toolkit internal] load build contex=> => transferring context: 22.23kB
10=> CACHED [shiny-k8s-toolkit 2/11] WORKDIR /srv/shiny-server/
11=> CACHED [shiny-k8s-toolkit 3/11] COPY ./my_packages_to_install.csv /opt/scripts/packages_to_install.csv
12=> [shiny-k8s-toolkit 5/11] RUN Rscript /opt/scripts/install_r_packages.R
13=> => # i No downloads are needed
14=> => # v 1 pkg + 68 deps: kept 57 [1.1s]
15=> => # [1] "Installation done!!"
16=> => # [1] "Installation of: "
17=> => # [1] "tidyverse"
You need to install some system dependencies in your docker image. Please check the dependencies needed with the R command pak::pkg_sysreqs("tidyverse")
1pak::pkg_sysreqs("tidyverse")
2"apt-get install -y libcurl4-openssl-dev libssl-dev make zlib1g-dev pandoc libfreetype6-dev libjpeg-dev libpng-dev libtiff-dev libicu-dev libfontconfig1-dev libfribidi-dev libharfbuzz-dev libxml2-dev"
Add the dependenciesin the Dockerfile file like bellow :
1# Add workdir information
2WORKDIR /srv/shiny-server/
3
4# Build image from the base image, previously configured for you
5# Full list of images can be found at
6# https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list
7FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
8
9# Add workdir information
10WORKDIR /srv/shiny-server/
11
12# Install additional dependencies, uncomment the block if you have one, and edit/duplicate line 12
13RUN apt-get update \
14 && apt-get install -y \
15 libcurl4-openssl-dev \
16 libssl-dev \
17 make \
18 zlib1g-dev \
19 pandoc \
20 libfreetype6-dev \
21 libjpeg-dev \
22 libpng-dev \
23 libtiff-dev \
24 libicu-dev \
25 libfontconfig1-dev \
26 libfribidi-dev \
27 libharfbuzz-dev \
28 libxml2-dev \
29 && rm -rf /var/lib/apt/lists/*
How to fix infinite installing R package during docker compose ? How to install “tidyverse” R packages ?
When you run a “docker compose” command, if the step “installation of R package” doesn’t finish without error, like in this example with the installation of R package “tidyverse”
1docker compose up --build
2[+] Building 2138.3s (8/15)
3=> [shiny-k8s-toolkit internal] load build definition from Dockerfile
4=> => transferring dockerfile: 1.30kB
5=> [shiny-k8s-toolkit internal] load metadata for registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
6=> [shiny-k8s-toolkit internal] load .dockerignore
7=> => transferring context: 2B
8=> [shiny-k8s-toolkit 1/11] FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
9=> [shiny-k8s-toolkit internal] load build contex=> => transferring context: 22.23kB
10=> CACHED [shiny-k8s-toolkit 2/11] WORKDIR /srv/shiny-server/
11=> CACHED [shiny-k8s-toolkit 3/11] COPY ./my_packages_to_install.csv /opt/scripts/packages_to_install.csv
12=> [shiny-k8s-toolkit 5/11] RUN Rscript /opt/scripts/install_r_packages.R
13=> => # i No downloads are needed
14=> => # v 1 pkg + 68 deps: kept 57 [1.1s]
15=> => # [1] "Installation done!!"
16=> => # [1] "Installation of: "
17=> => # [1] "tidyverse"
You need to install some system dependencies in your docker image. Please check the dependencies needed with the R command pak::pkg_sysreqs("tidyverse")
1pak::pkg_sysreqs("tidyverse")
2"apt-get install -y libcurl4-openssl-dev libssl-dev make zlib1g-dev pandoc libfreetype6-dev libjpeg-dev libpng-dev libtiff-dev libicu-dev libfontconfig1-dev libfribidi-dev libharfbuzz-dev libxml2-dev"
Add the dependenciesin the Dockerfile file like bellow :
1# Add workdir information
2WORKDIR /srv/shiny-server/
3
4# Build image from the base image, previously configured for you
5# Full list of images can be found at
6# https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list
7FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.0
8
9# Add workdir information
10WORKDIR /srv/shiny-server/
11
12# Install additional dependencies, uncomment the block if you have one, and edit/duplicate line 12
13RUN apt-get update \
14 && apt-get install -y \
15 libcurl4-openssl-dev \
16 libssl-dev \
17 make \
18 zlib1g-dev \
19 pandoc \
20 libfreetype6-dev \
21 libjpeg-dev \
22 libpng-dev \
23 libtiff-dev \
24 libicu-dev \
25 libfontconfig1-dev \
26 libfribidi-dev \
27 libharfbuzz-dev \
28 libxml2-dev \
29 && rm -rf /var/lib/apt/lists/*
How to upgrade my helm dependency / I can’t enable a feature
Note
Don’t forget to stop the current deployed instance by clicking on
pipeline’s step before apply the changes.
Basic use case is that the doc mention a feature, you enable it in values.yaml, but don’t see the effect. The cause can be that you don’t use latest version of the helm package, the part of the toolkit which provide feature such as storage, nodowntime, …
Until June 2024, the helm package was named shiny-server and version was pinned to a specific version, only allowing to get updates from minor release.
To prevent misunderstanding about the purpose of the helm package, we renamed it shiny-k8s-toolkit-helm.
We also now recommend that you always use the latest version.
To do we provide a script that will update three files of the toolkit to use the latest version witht the new name of the helm package.
# go into your project, where .gitlab-ci.yml is.
wget https://gitlab.pasteur.fr/hub/shiny-k8s-example/-/raw/advanced-scripts/apply-package-renaming.sh
chmod a+x apply-package-renaming.sh
./apply-package-renaming.sh
# three file should have been renamed
git diff
Here after is what your git diff should look like : changes in values.yaml, Chart.yaml and gitlab-ci.yaml
$ git diff
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index xxxxxxx..yyyyyyy 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,23 +43,23 @@ build:
- >
echo "helm upgrade --install --namespace=${NAMESPACE}
--render-subchart-notes
- --set shiny-server.ingress.className=${INGRESS_CLASS}
- --set shiny-server.ingress.hostname=${PUBLIC_URL}
- --set shiny-server.imageFullNameAndTag=${IMAGE}
- --set shiny-server.registry.username=${DEPLOY_USER}
- --set shiny-server.registry.password=xxxx
- --set shiny-server.registry.host=${CI_REGISTRY}
+ --set shiny-k8s-toolkit-helm.ingress.className=${INGRESS_CLASS}
+ --set shiny-k8s-toolkit-helm.ingress.hostname=${PUBLIC_URL}
+ --set shiny-k8s-toolkit-helm.imageFullNameAndTag=${IMAGE}
+ --set shiny-k8s-toolkit-helm.registry.username=${DEPLOY_USER}
+ --set shiny-k8s-toolkit-helm.registry.password=xxxx
+ --set shiny-k8s-toolkit-helm.registry.host=${CI_REGISTRY}
--values ./${CHART_LOCATION}/${VALUES_OVERRIDE_FILENAME:-values.yaml}
${CI_COMMIT_REF_SLUG}-${CHART_LOCATION} ./${CHART_LOCATION}/"
- >
helm upgrade --install --namespace=${NAMESPACE}
--render-subchart-notes
- --set shiny-server.ingress.className=${INGRESS_CLASS}
- --set shiny-server.ingress.hostname=${PUBLIC_URL}
- --set shiny-server.imageFullNameAndTag=${IMAGE}
- --set shiny-server.registry.username=${DEPLOY_USER}
- --set shiny-server.registry.password=${DEPLOY_TOKEN}
- --set shiny-server.registry.host=${CI_REGISTRY}
+ --set shiny-k8s-toolkit-helm.ingress.className=${INGRESS_CLASS}
+ --set shiny-k8s-toolkit-helm.ingress.hostname=${PUBLIC_URL}
+ --set shiny-k8s-toolkit-helm.imageFullNameAndTag=${IMAGE}
+ --set shiny-k8s-toolkit-helm.registry.username=${DEPLOY_USER}
+ --set shiny-k8s-toolkit-helm.registry.password=${DEPLOY_TOKEN}
+ --set shiny-k8s-toolkit-helm.registry.host=${CI_REGISTRY}
--values ./${CHART_LOCATION}/${VALUES_OVERRIDE_FILENAME:-values.yaml}
${CI_COMMIT_REF_SLUG}-${CHART_LOCATION} ./${CHART_LOCATION}/
diff --git a/chart/Chart.yaml b/chart/Chart.yaml
index xxxxxxx..yyyyyyy 100644
--- a/chart/Chart.yaml
+++ b/chart/Chart.yaml
@@ -24,6 +24,6 @@ version: 1.0.0
appVersion: "1.0.0"
dependencies:
-- name: shiny-server
- version: "~0.6.0"
+- name: shiny-k8s-toolkit-helm
+ version: "*"
repository: "https://gitlab.pasteur.fr/api/v4/projects/5334/packages/helm/stable"
diff --git a/chart/values.yaml b/chart/values.yaml
index xxxxxxx..yyyyyyy 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -1,4 +1,4 @@
-shiny-server:
+shiny-k8s-toolkit-helm:
autoscaling:
enabled: false
nodowntime:
How to fix error “UPGRADE FAILED: failed to create resource” ?
If, after upgrade my helm dependency by changing name of helm package, you obtain the following error in the “deploy” pipeline step :
Error: UPGRADE FAILED: failed to create resource: admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: host "XXXXXX.dev.pasteur.cloud" and path "/" is already defined in ingress XXXXX/XXXX
You have just forget to stop previously the running instance. Click on
pipeline’s step and on
to deploy again.
Uploading to data dir
When data are too large, or can simply not be visible in the gitlab project, you can upload the content directly in a persistent storage. First enable persistent storage, then create a zip with the data you want to upload and upload it to fex.pasteur.fr, and then trigger the gitlab ci task that will fetch this dir and unzip it into your persistent storage.
The task is named send-fex-to-dev for uploading in dev environment (and resp. ...-prod in prod). To find this task, open the last run pipeline, and click on the task. On the page that just open, provide a variable where the key is FEX_URL, and the value the data folder you want to upload, zipped. Finally, click Run job.
- When digging deeper, this task will :
download the archive
unzip it in a folder named
addedcopy the current content of the distant data dir in a local folder named
removedpurge the distant data dir
copy the fresh local data dir in the distant one
add as artifact folders
addedandremoved. If facing issue with “too large artifact”, consider removing path(s) from artifacts section of this task.
Download content of data dir
You may want to store some insights from the usage of your app, such as the computation time of a job or the strain analyzed. In such a case, you don’t want to expose this information to users, so you should store it in the data folder. The data directory can be downloaded within GitLab using the following CI job. Just append this snippet to your gitlab-ci.yml, but don’t forget to adapt the namespace to your settings. You will then be able to trigger this job similarly to how you trigger the log fetcher. The job use GitLab artifact, you are limited to 1GB (as of oct. 2025).
.download-data-folder-from-somewhere:
stage: "🔧 Configuration"
needs: []
when: manual
image: harbor.pasteur.fr/kube-system/helm-kubectl:3.14.0
variables:
SUB_DIR_OR_FILE: ""
CHART_LOCATION: "chart"
script:
- mkdir -p fetched
- POD=$(kubectl get po -l "app.kubernetes.io/instance=${CI_COMMIT_REF_SLUG}-${CHART_LOCATION}" --output jsonpath='{.items[0].metadata.name}')
- echo $POD
- |
until kubectl wait --for=condition=ready pod ${POD} --timeout=1s
do
date
sleep 1
kubectl get po
done
- kubectl exec $POD -- ls -lah data
- kubectl exec $POD -- ls -lah data/${SUB_DIR_OR_FILE}
- kubectl cp $POD:data/${SUB_DIR_OR_FILE} fetched/
artifacts:
when: always
public: false # otherwise non-member can see this artifact
paths:
- fetched
expire_in: 1 month
download-data-folder-from-dev:
extends: .download-data-folder-from-somewhere
variables:
NAMESPACE: "rshiny-dev"
environment:
name: "k8sdev-01/${NAMESPACE}/${CI_COMMIT_REF_SLUG}"
download-data-folder-from-prod:
extends: .download-data-folder-from-somewhere
variables:
NAMESPACE: "rshiny-prod"
environment:
name: "k8sprod-02/${NAMESPACE}/${CI_COMMIT_REF_SLUG}"
# you can create shortcuts for fetching one file or dir from time to time
download-prod-tracking:
extends: download-data-folder-from-prod
variables:
SUB_DIR_OR_FILE: "tracking.csv"
How to be able to delete the app in prod
By default we don’t provide a ci job to delete instance in prod due to its inherent risks. However here is the snippet you have to add to your gitlab ci in order to delete your application from you production namespace along with all you storage. You can keep the storage by defining keepOnDelete: true in production (more here).
delete-prod:
extends: delete-dev
stage: "🚀 🌐 deploy-in-prod"
needs: []
when: manual
variables:
NAMESPACE: "rshiny-dev"
environment:
name: "k8sprod-02/${NAMESPACE}/${CI_COMMIT_REF_SLUG}"
action: stop
What version do you propose
General guidelines are to propose images based on supported versions of ubuntu , R and Python . By default we only propose latest version of the Shiny Server.
Considering RShiny, we tend to propose all versions of the latest minor version, and latest patch version of other version. Example: If R 4.5.2 is the latest version, we will propose 4.5.2, 4.5.1, 4.4.3 (as there is no 4.4.4), but not 4.4.2 as 4.4.3 is a more recent version of the minor version 4.4.
We recommend to always use latest patch version of the minor version you use, i.e: using 4.4.3 instead of 4.4.1 or 4.4.2.
Version out of this scope can be added in a best effort approach, do not hesitate to ask us to add it.
Language |
Base os |
R/Python |
shiny-server |
Built image |
|---|---|---|---|---|
python |
bookworm |
3.10 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.10-slim |
python |
bookworm |
3.11 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.11-slim |
python |
bookworm |
3.12 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.12-slim |
python |
bookworm |
3.13 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.13-slim |
python |
bookworm |
3.14 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.14-slim |
python |
bookworm |
3.14 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:latest |
python |
bullseye |
3.10 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.10-slim-bullseye |
python |
bullseye |
3.11 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.11-slim-bullseye |
python |
bullseye |
3.12 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.12-slim-bullseye |
python |
bullseye |
3.13 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.13-slim-bullseye |
python |
bullseye |
3.14 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.14-slim-bullseye |
python |
trixie |
3.10 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.10-slim-trixie |
python |
trixie |
3.11 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.11-slim-trixie |
python |
trixie |
3.12 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.12-slim-trixie |
python |
trixie |
3.13 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.13-slim-trixie |
python |
trixie |
3.14 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.14-slim-trixie |
r |
focal |
4.1.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.1.3-focal |
r |
focal |
4.2.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.2.3-focal |
r |
focal |
4.3.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.3-focal |
r |
focal |
4.4.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.3-focal |
r |
focal |
4.5.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.5.3-focal |
r |
focal |
4.6.0 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.6.0-focal |
r |
jammy |
4.1.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.1.3 |
r |
jammy |
4.2.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.2.3 |
r |
jammy |
4.3.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.3 |
r |
jammy |
4.4.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.3 |
r |
jammy |
4.5.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.5.3 |
r |
jammy |
4.6.0 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.6.0 |
r |
jammy |
4.6.0 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:latest |
r |
noble |
4.3.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.3-noble |
r |
noble |
4.4.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.4.3-noble |
r |
noble |
4.5.3 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.5.3-noble |
r |
noble |
4.6.0 |
latest |
registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.6.0-noble |