@@ -350,6 +350,12 @@ def lmeval_minio_copy_pod(
350350 "command" : ["/bin/sh" , "-c" ],
351351 "args" : ["cp -r /mnt/data /shared" ],
352352 "volumeMounts" : [{"name" : "shared-data" , "mountPath" : "/shared" }],
353+ "securityContext" : {
354+ "allowPrivilegeEscalation" : False ,
355+ "capabilities" : {"drop" : ["ALL" ]},
356+ "runAsNonRoot" : True ,
357+ "seccompProfile" : {"type" : "RuntimeDefault" },
358+ },
353359 }
354360 ],
355361 containers = [
@@ -358,12 +364,20 @@ def lmeval_minio_copy_pod(
358364 "image" : "quay.io/minio/mc@sha256:470f5546b596e16c7816b9c3fa7a78ce4076bb73c2c73f7faeec0c8043923123" ,
359365 "command" : ["/bin/sh" , "-c" ],
360366 "args" : [
367+ # Set a writable config dir to avoid permission errors when running as non-root
368+ f"export MC_CONFIG_DIR=/shared/.mc && "
361369 f"mc alias set myminio http://{ minio_service .name } :{ MinIo .Metadata .DEFAULT_PORT } "
362- f"{ MinIo .Credentials .ACCESS_KEY_VALUE } { MinIo .Credentials .SECRET_KEY_VALUE } &&\n "
363- "mc mb --ignore-existing myminio/models &&\n "
370+ f"{ MinIo .Credentials .ACCESS_KEY_VALUE } { MinIo .Credentials .SECRET_KEY_VALUE } && "
371+ "mc mb --ignore-existing myminio/models && "
364372 "mc cp --recursive /shared/data/ myminio/models"
365373 ],
366374 "volumeMounts" : [{"name" : "shared-data" , "mountPath" : "/shared" }],
375+ "securityContext" : {
376+ "allowPrivilegeEscalation" : False ,
377+ "capabilities" : {"drop" : ["ALL" ]},
378+ "runAsNonRoot" : True ,
379+ "seccompProfile" : {"type" : "RuntimeDefault" },
380+ },
367381 }
368382 ],
369383 wait_for_resource = True ,
0 commit comments