FAQ_user.rst

Add new answer for installation of tidyverse R package. Fix typos for docker-compose command replaced by docker compose
FAQ
Job failed in log-fetcher-in-dev job / image can't pulled
See :ref:`why_image_cannot_be_pulled`
Why does Kubernetes indicat that it cannot pull image?
If you have a waring/error in job log-fetcher-in-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 :ref:`Private registry helm` to indicate that the registry is private, and then provide the credentials with :ref:`Define registry token`.
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 :
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 :ref:`Adapting the Dockerfile to your needs<dockefile>` ) as below.
After modification, you have just to run again the docker compose
command line ( see dedicated section :ref:`run locally<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"
You need to install some system dependencies in your docker image. Please check the dependencies needed with the R command pak::pkg_sysreqs("tidyverse")
Add the dependenciesin the Dockerfile
file like bellow :
How to upgrade my helm dependency / I can't enable a feature
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: