From e428f162058b5bceab6689941d730ffb581f5ec8 Mon Sep 17 00:00:00 2001 From: Greg Sheremeta Date: Wed, 3 Apr 2024 13:59:10 -0400 Subject: [PATCH] UPSTREAM: : feat: mount EmptyDir volumes for launcher write locations pt 2 follows up on dfe6edc, which does an EmptyDir mount for /.local and /.cache. /.config is another common write location, so EmptyDir mount that too. --- backend/src/v2/compiler/argocompiler/container.go | 12 ++++++++++++ .../testdata/create_mount_delete_dynamic_pvc.yaml | 4 ++++ .../compiler/argocompiler/testdata/hello_world.yaml | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/backend/src/v2/compiler/argocompiler/container.go b/backend/src/v2/compiler/argocompiler/container.go index d674308fa00..9d000a90211 100644 --- a/backend/src/v2/compiler/argocompiler/container.go +++ b/backend/src/v2/compiler/argocompiler/container.go @@ -42,6 +42,8 @@ const ( dotLocalScratchName = "dot-local-scratch" dotCacheScratchLocation = "/.cache" dotCacheScratchName = "dot-cache-scratch" + dotConfigScratchLocation = "/.config" + dotConfigScratchName = "dot-config-scratch" ) func (c *workflowCompiler) Container(name string, component *pipelinespec.ComponentSpec, container *pipelinespec.PipelineDeploymentConfig_PipelineContainerSpec) error { @@ -289,6 +291,12 @@ func (c *workflowCompiler) addContainerExecutorTemplate() string { EmptyDir: &k8score.EmptyDirVolumeSource{}, }, }, + { + Name: dotConfigScratchName, + VolumeSource: k8score.VolumeSource{ + EmptyDir: &k8score.EmptyDirVolumeSource{}, + }, + }, }, InitContainers: []wfapi.UserContainer{{ Container: k8score.Container{ @@ -338,6 +346,10 @@ func (c *workflowCompiler) addContainerExecutorTemplate() string { Name: dotCacheScratchName, MountPath: dotCacheScratchLocation, }, + { + Name: dotConfigScratchName, + MountPath: dotConfigScratchLocation, + }, }, EnvFrom: []k8score.EnvFromSource{metadataEnvFrom}, Env: commonEnvs, diff --git a/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml b/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml index dad0b7dd1ac..e3b427d2455 100644 --- a/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml +++ b/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml @@ -152,6 +152,8 @@ spec: name: dot-local-scratch - mountPath: /.cache name: dot-cache-scratch + - mountPath: /.config + name: dot-config-scratch initContainers: - command: - launcher-v2 @@ -188,6 +190,8 @@ spec: name: dot-local-scratch - emptyDir: { } name: dot-cache-scratch + - emptyDir: { } + name: dot-config-scratch - dag: tasks: - arguments: diff --git a/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml b/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml index ff77e358897..5685ece5de5 100644 --- a/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml +++ b/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml @@ -135,6 +135,8 @@ spec: name: dot-local-scratch - mountPath: /.cache name: dot-cache-scratch + - mountPath: /.config + name: dot-config-scratch initContainers: - command: - launcher-v2 @@ -171,6 +173,8 @@ spec: name: dot-local-scratch - emptyDir: {} name: dot-cache-scratch + - emptyDir: {} + name: dot-config-scratch - dag: tasks: - arguments: