fix(connect): propagate sharedStorage.subPath to launcher-managed job volumeMounts#774
Conversation
dbkegley
left a comment
There was a problem hiding this comment.
First of all, thank you for identifying this issue and submitting a fix! I think there's 1 edge case related to execution environment volume mounts that would need to be addressed but this looks like it's very much on the right track
| - {{ nindent 14 (toYaml .) | trim -}} | ||
| - {{- range $key, $value := . -}} | ||
| {{- if and (eq $key "subPath") ($templateData.sharedStorage.subPath) -}} | ||
| {{ nindent 14 $key }}: "{{ $templateData.sharedStorage.subPath }}/{{ $value }}" |
There was a problem hiding this comment.
I think this implementation breaks when the execution environment contains any custom volume mounts. I believe this should only prepend the subPath only if sharedStorage.name != $volumeMount.name. Otherwise we'll end up prepending subPath to all volumes and not just the DataDirPVC volume.
There was a problem hiding this comment.
Ahh, I see. I will adjust the logic such that it can only apply to sharedStorage volume mounts.
There was a problem hiding this comment.
Adjusted such that this only applies to mounts of the sharedStorage volume.
…b volumeMounts of that volume
…to-job-volumeMounts
|
Adjusted the logic such that it can only prepend The configmap template now also pushes sharedStorage pvc name into the The job template now finds the volume whose pvc name matches the above, and only considers prepending for mounts of that volume. |
|
Ran this locally and confirmed that it works as expected. Thanks for this! Unfortunately we can't run CI for contributor PRs so I'll close this and open one so we can get this changed merged. |
When
launcher.enabled, and whensharedStorage.subPathis non-empty, launcher-managed job pod volumeMounts did not prepend that subPath to their job-specific volumeMounts, which had the effect of mounting them higher on the shared storage volume than intended, which caused the job pods to quit immediately when they could not find expected files.This change ensures that when
sharedStorage.subPathis non-empty, it is prepended to the job-specific subPaths of the launcher-managed job pod volumeMounts.Tested by deploying the chart with clean shared storage volume and fresh database, and then adding a few gallery examples via the web UI, which we could then open and interact with.
fixes #759
Details:
The default values file now prepares an empty value at
.Values.launcher.templateValues.sharesStorage.subPath.https://github.com/FairwindsOps/rstudio-helm/blob/e8ea3daea13f5b1e6ab9ec579d997b1b0a9c2fac/charts/rstudio-connect/values.yaml#L381-L382
The configmap template now pushes
.Values.sharedStorage.subPathinto the$sessionTemplateforjob.tplto pick up.https://github.com/FairwindsOps/rstudio-helm/blob/e8ea3daea13f5b1e6ab9ec579d997b1b0a9c2fac/charts/rstudio-connect/templates/configmap.yaml#L60-L63
The job template now looks for the
subPathkey of.Job.volumeMountsitems and prepends$templateData.sharedStorage.subPathto its value if non-empty.https://github.com/FairwindsOps/rstudio-helm/blob/e8ea3daea13f5b1e6ab9ec579d997b1b0a9c2fac/charts/rstudio-connect/files/job.tpl#L285-L293