From 47d07665f95c6ee2efd3ad3ea5c0fc7f2e71a4b8 Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Thu, 23 Sep 2021 11:55:04 -0700 Subject: [PATCH] fix: Prevent chmod errors in log after unexpected triton restart (#36) * fix: Prevent chmod errors in log after unexpected triton restart Motivation Errors were observed by @tedhtchang in this situation: chmod: changing permissions of '/models/_triton_models/simple-string-1180__ksp-a53a19561f/config.pbtxt': Operation not permitted chmod: changing permissions of '/models/_triton_models/simple-string-167__ksp-a53a19561f': Operation not permitted chmod: changing permissions of '/models/_triton_models/simple-string-167__ksp-a53a19561f/config.pbtxt': Operation not permitted ... Since the /models/_triton_models dir contains files created by the adapter container which may run as a different user. Only the dir itself needs permissions set so that the adapter can write to it after it's first created. Modifications Remove -R from chmod command in triton-2.x ServingRuntime yaml. Result Avoid unnecessary errors in the log * Update unit test fixture accordingly --- config/runtimes/triton-2.x.yaml | 2 +- controllers/testdata/servingruntime_controller.golden | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/runtimes/triton-2.x.yaml b/config/runtimes/triton-2.x.yaml index f777da37..9a256abf 100644 --- a/config/runtimes/triton-2.x.yaml +++ b/config/runtimes/triton-2.x.yaml @@ -40,7 +40,7 @@ spec: args: - -c - 'mkdir -p /models/_triton_models; - chmod -R 777 /models/_triton_models; + chmod 777 /models/_triton_models; exec tritonserver "--model-repository=/models/_triton_models" "--model-control-mode=explicit" diff --git a/controllers/testdata/servingruntime_controller.golden b/controllers/testdata/servingruntime_controller.golden index 13bd6357..7ea09e02 100644 --- a/controllers/testdata/servingruntime_controller.golden +++ b/controllers/testdata/servingruntime_controller.golden @@ -631,7 +631,7 @@ spec: readOnly: true - args: - -c - - 'mkdir -p /models/_triton_models; chmod -R 777 /models/_triton_models; exec + - 'mkdir -p /models/_triton_models; chmod 777 /models/_triton_models; exec tritonserver "--model-repository=/models/_triton_models" "--model-control-mode=explicit" "--strict-model-config=false" "--strict-readiness=false" "--allow-http=true" "--allow-sagemaker=false" '