Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 8dfa6c8

Browse files
namannandanNaman Nandan
andauthored
Update default address from 0.0.0.0 to 127.0.0.1 in documentation and examples (#2624)
* Initial pass to update default address from 0.0.0.0 to 127.0.0.1 * update docker config to default bridge address * revert config updates and retain doc updates --------- Co-authored-by: Naman Nandan <namannan@amazon.com>
1 parent 5f36b20 commit 8dfa6c8

File tree

19 files changed

+183
-185
lines changed

19 files changed

+183
-185
lines changed

benchmarks/config_kf.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ inference_address=http://0.0.0.0:8080
22
management_address=http://0.0.0.0:8081
33
service_envelope=kserve
44
number_of_netty_threads=32
5-
job_queue_size=1000
5+
job_queue_size=1000

docs/batch_inference_with_ts.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* [Introduction](#introduction)
66
* [Prerequisites](#prerequisites)
77
* [Batch Inference with TorchServe's default handlers](#batch-inference-with-torchserves-default-handlers)
8-
* [Batch Inference with TorchServe using ResNet-152 model](#batch-inference-with-torchserve-using-resnet-152-model)
8+
* [Batch Inference with TorchServe using ResNet-152 model](#batch-inference-with-torchserve-using-resnet-152-model)
99
* [Demo to configure TorchServe ResNet-152 model with batch-supported model](#demo-to-configure-torchserve-resnet-152-model-with-batch-supported-model)
1010
* [Demo to configure TorchServe ResNet-152 model with batch-supported model using Docker](#demo-to-configure-torchserve-resnet-152-model-with-batch-supported-model-using-docker)
1111

@@ -16,7 +16,7 @@ TorchServe was designed to natively support batching of incoming inference reque
1616
because most ML/DL frameworks are optimized for batch requests.
1717
This optimal use of host resources in turn reduces the operational expense of hosting an inference service using TorchServe.
1818

19-
In this document we show an example of how to use batch inference in Torchserve when serving models locally or using docker containers.
19+
In this document we show an example of how to use batch inference in Torchserve when serving models locally or using docker containers.
2020

2121
## Prerequisites
2222

@@ -54,7 +54,7 @@ requests before this timer time's out, it sends what ever requests that were rec
5454
Let's look at an example using this configuration through management API:
5555

5656
```bash
57-
# The following command will register a model "resnet-152.mar" and configure TorchServe to use a batch_size of 8 and a max batch delay of 50 milliseconds.
57+
# The following command will register a model "resnet-152.mar" and configure TorchServe to use a batch_size of 8 and a max batch delay of 50 milliseconds.
5858
curl -X POST "localhost:8081/models?url=resnet-152.mar&batch_size=8&max_batch_delay=50"
5959
```
6060
Here is an example of using this configuration through the config.properties:
@@ -97,8 +97,8 @@ First things first, follow the main [Readme](../README.md) and install all the r
9797
```text
9898
$ cat config.properties
9999
...
100-
inference_address=http://0.0.0.0:8080
101-
management_address=http://0.0.0.0:8081
100+
inference_address=http://127.0.0.1:8080
101+
management_address=http://127.0.0.1:8081
102102
...
103103
$ torchserve --start --model-store model_store
104104
```
@@ -193,13 +193,13 @@ models={\
193193
}\
194194
}
195195
```
196-
* Then will start Torchserve by passing the config.properties using `--ts-config` flag
196+
* Then will start Torchserve by passing the config.properties using `--ts-config` flag
197197

198198
```bash
199199
torchserve --start --model-store model_store --ts-config config.properties
200200
```
201201
* Verify that TorchServe is up and running
202-
202+
203203
```text
204204
$ curl localhost:8080/ping
205205
{
@@ -265,9 +265,9 @@ Here, we show how to register a model with batch inference support when serving
265265
* Set the batch `batch_size` and `max_batch_delay` in the config.properties as referenced in the [dockered_entrypoint.sh](../docker/dockerd-entrypoint.sh)
266266
267267
```text
268-
inference_address=http://0.0.0.0:8080
269-
management_address=http://0.0.0.0:8081
270-
metrics_address=http://0.0.0.0:8082
268+
inference_address=http://127.0.0.1:8080
269+
management_address=http://127.0.0.1:8081
270+
metrics_address=http://127.0.0.1:8082
271271
number_of_netty_threads=32
272272
job_queue_size=1000
273273
model_store=/home/model-server/model-store
@@ -291,7 +291,7 @@ models={\
291291
./build_image.sh -g -cv cu102
292292
```
293293

294-
* Start serving the model with the container and pass the config.properties to the container
294+
* Start serving the model with the container and pass the config.properties to the container
295295

296296
```bash
297297
docker run --rm -it --gpus all -p 8080:8080 -p 8081:8081 --name mar -v /home/ubuntu/serve/model_store:/home/model-server/model-store -v $ path to config.properties:/home/model-server/config.properties pytorch/torchserve:latest-gpu

docs/configuration.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,15 @@ See [Enable SSL](#enable-ssl) to configure HTTPS.
8181
* `inference_address`: Inference API binding address. Default: `http://127.0.0.1:8080`
8282
* `management_address`: Management API binding address. Default: `http://127.0.0.1:8081`
8383
* `metrics_address`: Metrics API binding address. Default: `http://127.0.0.1:8082`
84-
* To run predictions on models on a public IP address, specify the IP address as `0.0.0.0`.
85-
To run predictions on models on a specific IP address, specify the IP address and port.
84+
* To run predictions on models on a specific IP address, specify the IP address and port.
8685

8786
```properties
88-
# bind inference API to all network interfaces with SSL enabled
89-
inference_address=https://0.0.0.0:8443
87+
# bind inference API to localhost with SSL enabled
88+
inference_address=https://127.0.0.1:8443
9089
```
9190

9291
```properties
93-
# bind inference API to private network interfaces
92+
# bind inference API to private network interfaces with SSL enabled
9493
inference_address=https://172.16.1.10:8080
9594
```
9695

examples/asr_rnnt_emformer/config.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
inference_address=http://0.0.0.0:8080
2-
management_address=http://0.0.0.0:8081
3-
metrics_address=http://0.0.0.0:8082
1+
inference_address=http://127.0.0.1:8080
2+
management_address=http://127.0.0.1:8081
3+
metrics_address=http://127.0.0.1:8082
44
number_of_netty_threads=32
55
job_queue_size=1000
66
model_store=/home/model-server/model-store

examples/cloudformation/ec2-asg.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Parameters:
2929
Type: String
3030
MinLength: '9'
3131
MaxLength: '18'
32-
Default: '0.0.0.0/0'
32+
Default: '127.0.0.1/0'
3333
AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})
3434
ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x/x.
3535
ModelPath:
@@ -41,7 +41,7 @@ Parameters:
4141
Type: String
4242
MinLength: '9'
4343
MaxLength: '18'
44-
Default: '0.0.0.0/0'
44+
Default: '127.0.0.1/0'
4545
AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})
4646
ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x/x.
4747
Mappings:
@@ -469,9 +469,9 @@ Resources:
469469
files:
470470
/etc/torchserve/config.properties:
471471
content: !Sub |
472-
inference_address=http://0.0.0.0:8080
473-
management_address=http://0.0.0.0:8081
474-
metrics_address=http://0.0.0.0:8082
472+
inference_address=http://127.0.0.1:8080
473+
management_address=http://127.0.0.1:8081
474+
metrics_address=http://127.0.0.1:8082
475475
load_models=ALL
476476
model_store=/mnt/efs/model_store
477477
mode: '000400'

examples/cloudformation/ec2.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ Resources:
267267
files:
268268
/etc/torchserve/config.properties:
269269
content: !Sub |
270-
inference_address=https://0.0.0.0:8080
271-
management_address=https://0.0.0.0:8081
272-
metrics_address=https://0.0.0.0:8082
270+
inference_address=https://127.0.0.1:8080
271+
management_address=https://127.0.0.1:8081
272+
metrics_address=https://127.0.0.1:8082
273273
private_key_file=/etc/torchserve/server.key
274274
certificate_file=/etc/torchserve/server.pem
275275
mode: '000400'

examples/diffusers/config.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Sample config.properties. In production config.properties at /mnt/models/config/config.properties will be used
2-
inference_address=http://0.0.0.0:8080
3-
management_address=http://0.0.0.0:8081
4-
metrics_address=http://0.0.0.0:8082
2+
inference_address=http://127.0.0.1:8080
3+
management_address=http://127.0.0.1:8081
4+
metrics_address=http://127.0.0.1:8082
55
enable_envvars_config=true
66
install_py_dep_per_model=true
77
load_models=all

examples/large_models/Huggingface_accelerate/config.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
inference_address=http://0.0.0.0:8080
2-
management_address=http://0.0.0.0:8081
3-
metrics_address=http://0.0.0.0:8082
1+
inference_address=http://127.0.0.1:8080
2+
management_address=http://127.0.0.1:8081
3+
metrics_address=http://127.0.0.1:8082
44
enable_envvars_config=true
55
install_py_dep_per_model=true
66
number_of_gpu=1
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
inference_address=http://0.0.0.0:8080
2-
management_address=http://0.0.0.0:8081
3-
metrics_address=http://0.0.0.0:8082
1+
inference_address=http://127.0.0.1:8080
2+
management_address=http://127.0.0.1:8081
3+
metrics_address=http://127.0.0.1:8082
44
enable_envvars_config=true
55
install_py_dep_per_model=true
6-

examples/large_models/deepspeed_mii/config.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
inference_address=http://0.0.0.0:8080
2-
management_address=http://0.0.0.0:8081
3-
metrics_address=http://0.0.0.0:8082
1+
inference_address=http://127.0.0.1:8080
2+
management_address=http://127.0.0.1:8081
3+
metrics_address=http://127.0.0.1:8082
44
enable_envvars_config=true
55
install_py_dep_per_model=true
66
load_models=all

0 commit comments

Comments
 (0)