Skip to content

Commit 57262c2

Browse files
committed
refactor model repository path to store different models
Signed-off-by: Manjunath-A-C <[email protected]>
1 parent fc7ab3e commit 57262c2

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

examples/tritonserver/tritonserver.container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=Run fraud detection application using onnx runtime
2+
Description=Run tritonserver with ONNX runtime to serve deep learning/machine learning models
33
Requires=tritonserver_config.service
44
After=tritonserver_config.service
55

examples/tritonserver/tritonserver_config.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=Mount and setup fraud detection config
2+
Description=Mount and setup triton server config
33
Requires=network-online.target cloud-config.target
44
After=network-online.target cloud-config.target
55

examples/tritonserver/tritonserver_config.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22

33
set -x
44

5-
mkdir -p /etc/pim/models/fraud_detection
5+
[ -f /etc/pim/tritonserver.conf ] || touch /etc/pim/tritonserver.conf
66

7-
[ -f /etc/pim/fraud_detection.conf ] || touch /etc/pim/fraud_detection.conf
7+
# List of AI applications to be served from tritonserver
8+
ai_apps=("fraud")
89

9-
mkdir -p /var/models/fraud_detection
10-
mkdir -p /var/models/fraud_detection/model_repository/fraud/1
10+
for app in "${ai_apps[@]}"; do
11+
mkdir -p /var/models/model_repository/${app}/1
1112

12-
ONNX_MODEL_SOURCE=$(jq -r '.modelSource' /etc/pim/pim_config.json)
13-
# Download model from the http server
14-
if [[ -n "$ONNX_MODEL_SOURCE" ]]; then
15-
curl "$ONNX_MODEL_SOURCE" --output /var/models/fraud_detection/model_repository/fraud/1/model.onnx
16-
fi
13+
ONNX_MODEL_SOURCE=$(jq -r '.modelSource' /etc/pim/pim_config.json)
14+
if [[ -n "$ONNX_MODEL_SOURCE" ]]; then
15+
curl "$ONNX_MODEL_SOURCE" --output /var/models/model_repository/${app}/1/model.onnx
16+
fi
1717

18-
CONFIG_FILE=$(jq -r '.configSource' /etc/pim/pim_config.json)
19-
if [[ -n "$CONFIG_FILE" ]]; then
20-
curl "$CONFIG_FILE" --output /var/models/fraud_detection/model_repository/fraud/config.pbtxt
21-
fi
18+
CONFIG_FILE=$(jq -r '.configSource' /etc/pim/pim_config.json)
19+
if [[ -n "$CONFIG_FILE" ]]; then
20+
curl "$CONFIG_FILE" --output /var/models/model_repository/${app}/config.pbtxt
21+
fi
22+
done
2223

23-
var_to_add=MODEL_REPOSITORY=/var/models/fraud_detection/model_repository
24-
sed -i "/^MODEL_REPOSITORY=.*/d" /etc/pim/fraud_detection.conf && echo "$var_to_add" >> /etc/pim/fraud_detection.conf
24+
var_to_add=MODEL_REPOSITORY=/var/models/model_repository
25+
sed -i "/^MODEL_REPOSITORY=.*/d" /etc/pim/tritonserver.conf && echo "$var_to_add" >> /etc/pim/tritonserver.conf

0 commit comments

Comments
 (0)