Skip to content

Commit bc273a9

Browse files
authored
fix: ld.so.preload is not an ELF file bug (#412)
1 parent 458ae74 commit bc273a9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

internal/constants/env.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ const (
8585
LdLibraryPathFile = "/etc/ld.so.conf.d/zz_tensor-fusion.conf"
8686

8787
TFLibsVolumeName = "tf-libs"
88+
TFConfVolumeName = "tf-conf-lib-paths"
8889
TFLibsVolumeMountPath = "/tensor-fusion"
90+
TFConfVolumeMountPath = "/tensor-fusion-conf"
8991
TFConnectionNamePrefix = "-tf-vgpu-"
9092
TFConnectionNameNoPrefix = "tf-vgpu-"
9193

internal/utils/compose.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ func AddTFDefaultClientConfBeforePatch(
178178
Name: constants.TFLibsVolumeName,
179179
MountPath: constants.TFLibsVolumeMountPath,
180180
},
181+
{
182+
Name: constants.TFConfVolumeName,
183+
MountPath: constants.TFConfVolumeMountPath,
184+
},
181185
},
182186
Resources: v1.ResourceRequirements{
183187
Requests: injectLibResource,
@@ -191,6 +195,12 @@ func AddTFDefaultClientConfBeforePatch(
191195
EmptyDir: &v1.EmptyDirVolumeSource{},
192196
},
193197
})
198+
pod.Spec.Volumes = append(pod.Spec.Volumes, v1.Volume{
199+
Name: constants.TFConfVolumeName,
200+
VolumeSource: v1.VolumeSource{
201+
EmptyDir: &v1.EmptyDirVolumeSource{},
202+
},
203+
})
194204

195205
for _, injectContainerIndex := range injectContainerIndices {
196206
pod.Spec.Containers[injectContainerIndex].Env = append(pod.Spec.Containers[injectContainerIndex].Env, v1.EnvVar{
@@ -205,12 +215,12 @@ func AddTFDefaultClientConfBeforePatch(
205215
pod.Spec.Containers[injectContainerIndex].VolumeMounts = append(
206216
pod.Spec.Containers[injectContainerIndex].VolumeMounts,
207217
v1.VolumeMount{
208-
Name: constants.TFLibsVolumeName,
218+
Name: constants.TFConfVolumeName,
209219
MountPath: constants.LdPreloadFile,
210220
SubPath: constants.LdPreloadFileName,
211221
ReadOnly: true,
212222
}, v1.VolumeMount{
213-
Name: constants.TFLibsVolumeName,
223+
Name: constants.TFConfVolumeName,
214224
MountPath: constants.LdLibraryPathFile,
215225
SubPath: constants.LdLibraryPathFileName,
216226
ReadOnly: true,

0 commit comments

Comments
 (0)