rstudio / helm

Helm Resources for RStudio Products
MIT License
35 stars 28 forks source link

Git shouldn't clone internal repositories to root path #403

Closed odysseu closed 1 year ago

odysseu commented 1 year ago

Hi, I am having an issue serving R packages stored in Git to a internal posit-package-manager instance.

Correction needed

When using the posit-package-manager helm chart, git shouldn't clone repositories in / root path. Instead it should be able to take a suggested path or clone it to /tmp for instance.

🥇 This is also a good application of the principle of least privilege (PoLP).

Maybe a gitDir variable should be added to the helm chart so git knows where to clone by default.

Goal

Have internal R packages on the package-manager instance.

Context

values.yaml ```yaml rstudio-pm: pod: securityContext: runAsNonRoot: false # <-- internal cluster constraint runAsUser: 999 fsGroup: 0600 env: - name: https_proxy value: - name: http_proxy value: - name: NO_PROXY value: <.internal-no-proxy.fr> - name: no_proxy value: <.internal-no-proxy.fr> license: key: <45-days-trial-key> ingress: enabled: true ingressClassName: hosts: - host: paths: - / enableSandboxing: false enableMigration: false sharedStorage: create: true name: "" accessModes: ["ReadWriteOnce"] ```
Chart.yaml ```yaml apiVersion: v2 name: rstudio-pm description: rstudio-pm-0.5.12 keywords: - rstudio-pm type: application version: 0.0.1 dependencies: - name: rstudio-pm version: 0.5.12 repository: https://helm.rstudio.com ```

Following the guide to use a git repo

issue

At step 2 of the rspm commands, when I write :

rspm create git-builder --url=https://<internal-gitlab.fr>/r-pkg.git --source=internal-src --build-trigger=tags

I get

Cloning repo and waiting for initial package builds...

This could take some time depending on the size of the repo and the number of package builds...

Error: Please make sure you have the correct access rights and the repository exists.

Attempted git command 'git clone --depth 1 --single-branch https://<internal-gitlab.fr>/r-pkg.git qI4plF9CdIfn'.

Full command output:

Cloning into 'qI4plF9CdIfn'...
fatal: unable to access 'https://<internal-gitlab.fr>/r-pkg.git/': Received HTTP code 403 from proxy after CONNECT

I know the problem isn't a proxy issue. Indeed, I (as user rstudio-pm) can git clone --depth 1 --single-branch https://<internal-gitlab.fr>/r-pkg.git /tmp/qI4plF9CdIfn (I added /tmp/ in front of the random-generated path name) but I can't git clone --depth 1 --single-branch https://<internal-gitlab.fr>/r-pkg.git /qI4plF9CdIfn. Also I made sure the https://<internal-gitlab.fr>/r-pkg.git repo was public.